OFFSET
1,2
COMMENTS
Determine position from the decimal point, and define a(n)=0 for perfect squares (A000290).
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
EXAMPLE
a(1)=0 because 1 is a perfect square.
a(2)=4 because the first "2" occurs at position 4 in "1.41421356...".
a(5)=36 because the first "5" occurs at position 36 in "2.236067977499789696409173668731276235"
MATHEMATICA
max = 500; a[n_] := If[IntegerQ @ Sqrt[n], 0, SequencePosition[(r = RealDigits[ FractionalPart @ Sqrt[n], 10, max])[[1]], IntegerDigits[n]][[1, 1]] - r[[2]]]; Array[a, 100] (* Amiram Eldar, Sep 25 2020 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Gil Broussard, May 12 2010
STATUS
approved