A177715 The position within sqrt(n) at which n first occurs.
0, 4, 2, 0, 36, 38, 4, 1, 0, 88, 19, 51, 221, 318, 48, 0, 11, 98, 24, 143, 60, 40, 8, 108, 0, 144, 9, 267, 32, 188, 183, 154, 370, 44, 107, 0, 117, 25, 10, 148, 145, 107, 4, 234, 48, 298, 252, 31, 0, 102, 211, 119, 178, 352, 118, 224, 63, 9, 107, 103, 239, 130, 94, 0, 16
Offset: 1
Examples
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"
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
Crossrefs
Cf. A000290.
Programs
-
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 *)
Comments