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

This page as a plain text file.
%I A333663 #54 Sep 19 2020 23:24:24
%S A333663 1,16,64,4,49,9,900,961,100,121,144,400,441,169,9025,529,9216,625,576,
%T A333663 676,6084,484,4096,6241,196,6400,4225,5041,1024,4356,6561,1089,9409,
%U A333663 9604,4489,9801,1156,6724,4624,4761,1225,5184,4900,90000,90601,1296,6889,91204
%N 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).
%C A333663 Every term begins with 1, 4, 5, 6 or 9.
%H A333663 David A. Corneth, <a href="/A333663/b333663.txt">Table of n, a(n) for n = 1..10000</a>
%e A333663 The smallest square not yet in the data that begins with 1 is 16, hence a(2) = 16.
%t A333663 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 *)
%o A333663 (PARI) nxt(va, d) = {my(k=1); while ((digits(k^2)[1]!=d) || #select(x->(x==k^2), va), k++); k^2;}
%o A333663 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
%Y A333663 Cf. A155985 (variant).
%Y A333663 Subsequences of squares with initial digit k: A045784 (k=1), A045787 (k=4), A045788 (k=5), A045789 (k=6), A045793 (k=9).
%K A333663 nonn,easy,base
%O A333663 1,2
%A A333663 _Bernard Schott_, Sep 03 2020
%E A333663 More terms from _Michel Marcus_, Sep 04 2020