A308171 Limiting sequence of digits, read from the right, when starting with 5 we repeatedly replace each digit with its square (as in A308170).
5, 2, 4, 6, 1, 6, 3, 1, 6, 3, 9, 1, 6, 3, 9, 1, 8, 1, 6, 3, 9, 1, 8, 1, 4, 6, 1, 6, 3, 9, 1, 8, 1, 4, 6, 1, 6, 1, 6, 3, 1, 6, 3, 9, 1, 8, 1, 4, 6, 1, 6, 1, 6, 3, 1, 6, 3, 1, 6, 3, 9, 1, 6, 3, 9, 1, 8, 1, 4, 6, 1, 6, 1, 6, 3, 1, 6, 3, 1, 6, 3, 9, 1, 6, 3, 9, 1
Offset: 1
Examples
Replacing each digit with its square, we get 5 -> 25 -> 425 -> 16425 -> 13616425 -> .... The final digits converge to ...16425, or read from the right, to this sequence: 5, 2, 4, 6, 1, ... - _M. F. Hasler_, May 15 2019
Links
- Rémy Sigrist, Table of n, a(n) for n = 1..25000
Programs
-
Mathematica
s = {5}; Do[s = Flatten[ Reverse@ IntegerDigits[#^2] & /@ s]; If[Length[s] > 100, s = Take[s, 100]], {100}]; s (* Giovanni Resta, Jul 03 2019 *)
-
PARI
{ wanted = 87; a = [5]; while (1, b = concat(apply(d -> if (d, digits(d^2), [0]), a)); if (#b > wanted, b = b[#b-wanted+1..#b]); if (a==b, break, a = b)); print (Vecrev(a)) } \\ Rémy Sigrist, May 15 2019
-
PARI
A308171_vec(N, a=[5])={while(a!=a=concat(apply(t->digits(t^2), if(#a>N, a[-N..-1], a))),); Vecrev(a[-N..-1])} \\ M. F. Hasler, May 15 2019
Extensions
More terms from Rémy Sigrist, May 15 2019
Comments