A336112 a(n) is the least number k such that the Sum_{i=0..k} sqrt(k) equals or exceeds n.
0, 1, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 21, 22, 22, 22, 22, 23, 23, 23, 23
Offset: 0
Keywords
Examples
a(0) = 0 since the sqrt(0) = 0; a(1) = 1 since the sqrt(0) + sqrt(1) = 1; a(2) = 2 since the sqrt(0) + sqrt(1) + sqrt(2) ~ 2.41421... which exceeds 2; a(3) = 3 since the sqrt(0) + sqrt(1) + sqrt(2) + sqrt(3) ~ 4.146264... which easily exceeds 3; a(4) = 3 because the sqrt(0) + sqrt(1) + sqrt(2) + sqrt(3) ~ 4.146264... which barely exceeds 4; etc.
Programs
-
Mathematica
f[n_] := Block[{k = s = 0}, While[s < n, k++; s = s + Sqrt@k]; k]; Array[f, 75, 0]
-
PARI
a(n) = my(s=0, k=0); while ((s+=sqrt(k)) < n, k++); k; \\ Michel Marcus, Jul 09 2020
Formula
a(k*n) ~ k^(2/3)*a(n).
Comments