login
A020965
a(n) = Sum_{k >= 1} floor(n*sqrt(2)^(1-k)).
2
1, 4, 7, 10, 12, 17, 18, 23, 26, 29, 30, 37, 39, 41, 44, 50, 54, 56, 58, 63, 64, 67, 73, 77, 79, 83, 85, 88, 92, 95, 96, 104, 106, 112, 113, 117, 120, 122, 124, 131, 132, 135, 138, 142, 143, 151, 153, 158, 161, 164, 168, 171, 173, 177, 178, 183, 188, 191, 192, 197
OFFSET
1,2
LINKS
C. Kimberling, Problem 10520, Amer. Math. Mon. 103 (1996) p. 347.
FORMULA
a(n) = kn + O(log n) where k = 2 + sqrt(2) = 3.414213562.... - Charles R Greathouse IV, Feb 27 2017
MATHEMATICA
Table[Sum[Floor[n * Sqrt[2] ^ (1-k)], {k, 1, n+1}], {n, 1, 60}] (* Indranil Ghosh, Feb 27 2017 *)
PROG
(PARI) a(n) = sum(k=1, n+1, floor(n * sqrt(2) ^ (1-k))); \\ Indranil Ghosh, Feb 27 2017
(PARI) a(n)=sum(k=0, logint(n^2, 2), sqrtint(n^2\2^k)) \\ Charles R Greathouse IV, Feb 27 2017
(Magma) [(&+[Floor(n*Sqrt(2)^(1-k)): k in [1..1000]]): n in [1..60]]; // G. C. Greubel, May 31 2018
CROSSREFS
Sequence in context: A104280 A083032 A284933 * A065713 A184850 A331207
KEYWORD
nonn,easy
EXTENSIONS
More terms from Jon E. Schoenfield, Jan 24 2009
STATUS
approved