A023961 First digit after decimal point of square root of n.
0, 4, 7, 0, 2, 4, 6, 8, 0, 1, 3, 4, 6, 7, 8, 0, 1, 2, 3, 4, 5, 6, 7, 8, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 1, 2, 3, 4, 4, 5, 6, 7, 7, 8, 9, 0, 0, 1, 2, 2, 3, 4, 4, 5, 6, 6, 7, 8, 8, 9, 0, 0, 1, 1, 2, 3, 3, 4, 4, 5, 6, 6, 7, 7, 8, 8, 9, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 0, 0, 0, 1, 1, 2
Offset: 1
Examples
sqrt(1) = 1.00000000... hence a(1) = 0. sqrt(2) = 1.41421356... hence a(2) = 4. sqrt(3) = 1.73205080... hence a(3) = 7. sqrt(4) = 2.00000000... hence a(4) = 0. Note that 26 = 2 * 13 and sqrt(26) = 5.09901951... so a(26) = 0 even though 26 is not a perfect square.
Links
- Nathaniel Johnston, Table of n, a(n) for n = 1..10000
Crossrefs
Programs
-
Maple
A023961 := proc(n) return floor(10*sqrt(n)) mod 10: end: seq(A023961(n),n=1..100); # Nathaniel Johnston, May 04 2011
-
Mathematica
Array[Function[n, RealDigits[N[Power[n, 1/2], 10], 10] // (#[[1, #[[2]] + 1]]) &], 110] fd[n_] := Module[{rd = RealDigits[Sqrt[n], 10, 10]}, First[rd][[Last[rd] + 1]]]; Array[fd, 90] (* Harvey P. Dale, Jan 16 2014 *)
-
PARI
a(n) = floor(10*sqrt(n)) % 10; \\ Michel Marcus, Sep 21 2015
Comments