A333663 a(1) = 1, then a(n) is the smallest square not occurring earlier and starting with the last nonzero digit of a(n-1).
1, 16, 64, 4, 49, 9, 900, 961, 100, 121, 144, 400, 441, 169, 9025, 529, 9216, 625, 576, 676, 6084, 484, 4096, 6241, 196, 6400, 4225, 5041, 1024, 4356, 6561, 1089, 9409, 9604, 4489, 9801, 1156, 6724, 4624, 4761, 1225, 5184, 4900, 90000, 90601, 1296, 6889, 91204
Offset: 1
Examples
The smallest square not yet in the data that begins with 1 is 16, hence a(2) = 16.
Links
- David A. Corneth, Table of n, a(n) for n = 1..10000
Crossrefs
Programs
-
Mathematica
Nest[Block[{a = #, k = 1, d = Mod[#[[-1]]/10^IntegerExponent[#[[-1]] ], 10]}, While[Nand[FreeQ[a, #], d == Floor[#/10^(IntegerLength[#] - 1)] ] &[k^2], k++]; Append[a, k^2]] &, {1}, 47] (* Michael De Vlieger, Sep 11 2020 *)
-
PARI
nxt(va, d) = {my(k=1); while ((digits(k^2)[1]!=d) || #select(x->(x==k^2), va), k++); k^2;} lista(nn) = {my(va = vector(nn)); va[1] = 1; for (n=2, nn, va[n] = nxt(va, digits(fromdigits(Vecrev(digits(va[n-1]))))[1]);); va;} \\ Michel Marcus, Sep 04 2020
Extensions
More terms from Michel Marcus, Sep 04 2020
Comments