OFFSET
1,2
COMMENTS
Every term begins with 1, 4, 5, 6 or 9.
LINKS
David A. Corneth, Table of n, a(n) for n = 1..10000
EXAMPLE
The smallest square not yet in the data that begins with 1 is 16, hence a(2) = 16.
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 *)
PROG
(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
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
Bernard Schott, Sep 03 2020
EXTENSIONS
More terms from Michel Marcus, Sep 04 2020
STATUS
approved