login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A155985 a(1)=1, then a(n) is the smallest square not occurring earlier, not ending with zero and starting with the last digit of a(n-1). 4

%I #20 May 06 2022 13:13:51

%S 1,16,64,4,49,9,961,121,144,441,169,9025,529,9216,625,576,676,6084,

%T 484,4096,6241,196,6561,1024,4225,5041,1089,9409,9604,4356,6724,4489,

%U 9801,1156,6889,90601,1225,5184,4624,4761,1296,60025,5329,91204,40401,1369

%N a(1)=1, then a(n) is the smallest square not occurring earlier, not ending with zero and starting with the last digit of a(n-1).

%H David A. Corneth, <a href="/A155985/b155985.txt">Table of n, a(n) for n = 1..10000</a>

%H David A. Corneth, <a href="/A155985/a155985_1.gp.txt">PARI program</a>

%o (PARI) nxt(va, d) = {my(k=1); while ((digits(k^2)[1]!=d) || !(k%10) || #select(x->(x==k^2), va), k++); k^2;}

%o lista(nn) = {my(va = vector(nn)); va[1] = 1; for (n=2, nn, va[n] = nxt(va, Vecrev(digits(va[n-1]))[1]);); va;} \\ _Michel Marcus_, Sep 04 2020

%o (PARI) See Corneth link \\ _David A. Corneth_, Sep 05 2020

%Y Cf. A076653 (similar, with primes), A155986.

%K nonn,easy,base

%O 1,2

%A _Zak Seidov_, Feb 01 2009

%E Name edited by _Michel Marcus_, Sep 04 2020

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 14:04 EDT 2024. Contains 371792 sequences. (Running on oeis4.)