A028392 a(n) = n + floor(sqrt(n)).
0, 2, 3, 4, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27, 28, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 72, 73, 74, 75, 76, 77, 78, 79
Offset: 0
Examples
G.f. = 2*x + 3*x^2 + 4*x^3 + 6*x^4 + 7*x^5 + 8*x^6 + 9*x^7 + 10*x^8 + 12*x^9 + ...
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
- L. F. Klosinski, G. L. Alexanderson and A. P. Hillman, The William Lowell Putnam Mathematical Competition: Problem B4, Amer. Math. Monthly 91 (1984), 487-495.
Crossrefs
Complement of A028387.
Cf. A000196. - Reinhard Zumkeller, Oct 14 2010
Programs
-
Haskell
a028392 n = n + a000196 n -- Reinhard Zumkeller, Oct 28 2012
-
Mathematica
Table[n + Floor[Sqrt[n]], {n, 0, 99}] (* Vladimir Joseph Stephan Orlovsky, Mar 29 2010 *)
-
PARI
{a(n) = if( n<0, 0, n + sqrtint(n))}; /* Michael Somos, Jun 11 2003 */
-
Python
from math import isqrt def A028392(n): return n+isqrt(n) # Chai Wah Wu, May 16 2023
-
Scala
(0 to 99).map(n => (n + Math.floor(Math.sqrt(n))).toInt) // Alonso del Arte, Nov 03 2019
Formula
a(n) = 2*n - A028391(n).
G.f.: x / (1 - x)^2 + (theta3(x) - 1) / (2 * (1 - x)). - Michael Somos, Mar 24 2012
Comments