Go and try to define the algorithm in pseudo code, e.g.
function test(int value) return void
begin
attempts = 100
while (attempts > 0 && value > 1) do
write_line("value: {1}", value)
attempts--
text = as_string(value)
value = 0;
for each char c in split_into_chars(text) do
value += char_square_to_int(c)
end for each
end while
write_line("ended with value {0}", value)
end function
function char_square_to_int(char c) return int
begin
return as_int(c-'0') * as_int(c-'0')
end function
Transforming into C# is left as exercise.
Cheers
Andi