A couple other things. These numbers are going to get really big really fast. I didn't look closely at your algorithm, just the syntax, and there are a couple issues.
- Your For loop won't ever exit if you don't have a test to escape when i gets too large and x doesn't satisfy your conditions.
You're not incrementing i in the correct place. Your increment is the third argument, not the 4th.
Do[For[i = 0, x != 1 && x != 4 && i < 10, i++,
x = ((x - Mod[x, 10])/10)^2 + (Mod[x, 10])^2];
Print[{i, x}], {x, 10}]
I've decreased the range of i and x to 9 and 10. You'll probably want to skip the print statement if you've hit the upper bound of i that you set i.e. If[i<10,Print[{i,x}]. Even with this very truncated version the numbers get large fast:
{0,1}
{1,4}
{10,485}
{0,4}
{10,29052125}
{10,145}
{10,7341998783795942461}
{10,53905}
{10,2329}
{1,1}