cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A245584 Let f(m) put the leftmost digit of the positive integer m at its end; a(n) is the sequence of all positive integers m with f^2(m)=f(m^2).

This page as a plain text file.
%I A245584 #22 Sep 25 2023 16:54:50
%S A245584 1,2,3,12,122,1222,12222,122222,1222222,12222222,122222222
%N A245584 Let f(m) put the leftmost digit of the positive integer m at its end; a(n) is the sequence of all positive integers m with f^2(m)=f(m^2).
%F A245584 One can easily prove that all integers of the form 12...2 are elements of the sequence.
%e A245584 122^2=14884 and 221^2=48841.
%t A245584 f[m_Integer] := Module[{w}, w := IntegerDigits[m]; FromDigits[Rest[AppendTo[w, First[w]]]]]; a245584[n_Integer] :=
%t A245584 Select[Range[n], If[f[#]^2 == f[#^2] && ! Mod[#, 10] == 0, True, False] &]; a245584[10^5] (* _Michael De Vlieger_, Aug 17 2014 *)
%o A245584 (Python)
%o A245584 import math
%o A245584 max = 10000
%o A245584 print('los')
%o A245584 for n in range(1, max):
%o A245584    nst = str(n*n)
%o A245584    nnewst = nst[1:] + nst[0]
%o A245584    d = int(nnewst)
%o A245584    e = int(math.sqrt(d))
%o A245584    est = str(e)
%o A245584    enewst = est[len(est)-1] + est[:len(est)-1]
%o A245584    if (e * e == d) and (nnewst[0] != "0") and (str(n) == enewst):
%o A245584       print(n, '  ',  e)
%o A245584 print('End.')
%Y A245584 Cf. A045878, A090843.
%K A245584 nonn,base,more
%O A245584 1,2
%A A245584 _Reiner Moewald_, Jul 26 2014