login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A180109
a(1)=1 , thereafter, a(n) is the smallest integer k not yet in the sequence, such that k^2 contains in consecutive digits the decimal representation of a(n-1)
1
1, 4, 2, 5, 15, 34, 59, 77, 76, 24, 18, 43, 66, 108, 33, 58, 126, 355, 596, 186, 432, 208, 457, 214, 463, 681, 41, 21, 11, 46, 68, 83, 94, 97, 176, 42, 65, 81, 9, 3, 6, 8, 17, 131, 146, 121, 110, 105
OFFSET
1,2
LINKS
EXAMPLE
a(1)=1
a(2)=4, because 4^2=16 which contains 1
...
a(5)=15
a(6)=34, because 34^2=1156, which contains 15
a(7)=59, because 59^2=3481, which contains 34
...
MATHEMATICA
but = 1500000; s = {1}; f[x_] := (sc = Complement[Range[but] , s]; n = ToString[x]; j = 1; While[StringPosition[ToString[sc[[j]]^2], n] == {}, j++]; sc[[j]]); a = 1; k = 1; While[a < 10001, k = f[k]; AppendTo[s, k]; a++]; Print[s]
CROSSREFS
Sequence in context: A163358 A121709 A283747 * A019170 A107504 A141674
KEYWORD
base,nonn
AUTHOR
Jean-Marc Falcoz, Jan 16 2011
STATUS
approved