OFFSET
0,3
LINKS
Robert Israel, Table of n, a(n) for n = 0..10000
S. H. Weintraub, An interesting recursion, Amer. Math. Monthly, 111 (No. 6, 2004), 528-530.
FORMULA
a(n) = n + 2*A053186(n).
G.f.: 3*x/(1-x)^2 - (2/(1-x)) * Sum_{k>=1} (2*k-1)*x^(k^2). The sum is related to Jacobi theta functions. - Robert Israel, Oct 23 2015
MAPLE
seq(3*n - 2*floor(sqrt(n))^2, n=0..1000); # Robert Israel, Oct 23 2015
PROG
(PARI) a(n) = 3*n - 2*sqrtint(n)^2; \\ Michel Marcus, Oct 23 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Jun 10 2004
STATUS
approved