login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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). 1
1, 2, 3, 12, 122, 1222, 12222, 122222, 1222222, 12222222, 122222222 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

LINKS

Table of n, a(n) for n=1..11.

FORMULA

One can easily prove that all integers of the form 12...2 are elements of the sequence.

EXAMPLE

122^2=14884 and 221^2=48841.

MATHEMATICA

f[m_Integer] := Module[{w}, w := IntegerDigits[m]; FromDigits[Rest[AppendTo[w, First[w]]]]]; a245584[n_Integer] :=

Select[Range[n], If[f[#]^2 == f[#^2] && ! Mod[#, 10] == 0, True, False] &]; a245584[10^5] (* Michael De Vlieger, Aug 17 2014 *)

PROG

(PYTHON)

import math

max = 10000

print('los')

for n in range(1, max):

...nst = str(n*n)

...nnewst = nst[1:] + nst[0]

...d = int(nnewst)

...e = int(math.sqrt(d))

...est = str(e)

...enewst = est[len(est)-1] + est[:len(est)-1]

...if (e * e == d) and (nnewst[0] != "0") and (str(n) == enewst):

......print(n, '  ',  e)

print('End.')

CROSSREFS

Cf. A045878, A090843.

Sequence in context: A162053 A162075 A333166 * A102878 A132501 A067338

Adjacent sequences:  A245581 A245582 A245583 * A245585 A245586 A245587

KEYWORD

nonn,base

AUTHOR

Reiner Moewald, Jul 26 2014

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 14 17:51 EDT 2021. Contains 345037 sequences. (Running on oeis4.)