OFFSET
1,2
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000 (terms 1..1000 from Zhining Yang)
EXAMPLE
s = 123456789101112131415161718192021222324252627282930313233343536... .
a(4) = 22 because the first occurrence of 4^2 = 16 in s starts at the 22nd digit.
MATHEMATICA
t = ""; k = 0; Table[ While[(z = StringPosition[t, ToString[n^2], 1]) == {}, t = t <> ToString[++k]]; z[[1, 1]], {n, 61}] (* Giovanni Resta, Aug 11 2017 *)
Module[{nn=15000, s}, s=Flatten[IntegerDigits/@Range[nn]]; Flatten[Table[ SequencePosition[s, IntegerDigits[n^2], 1], {n, 70}], 1]][[All, 1]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jul 05 2021 *)
PROG
(VBA)
Sub test()
Dim i&, t$
For i = 1 To 10000
t = t & i
Next
For i = 1 To 100
Debug.Print InStr(t, i ^ 2); ", ";
Next
End Sub
CROSSREFS
KEYWORD
AUTHOR
Zhining Yang, Aug 08 2017
STATUS
approved