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.

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).

Original entry on oeis.org

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

Views

Author

Bernard Schott, Sep 03 2020

Keywords

Comments

Every term begins with 1, 4, 5, 6 or 9.

Examples

			The smallest square not yet in the data that begins with 1 is 16, hence a(2) = 16.
		

Crossrefs

Cf. A155985 (variant).
Subsequences of squares with initial digit k: A045784 (k=1), A045787 (k=4), A045788 (k=5), A045789 (k=6), A045793 (k=9).

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