OFFSET
1,1
COMMENTS
Also equals n + floor(sqrt(n) + sqrt(n+1/2)). Proof: floor(2*sqrt(n)) is the largest k such that k^2/4 <= n, while floor(sqrt(n) + sqrt(n+1/2)) is the largest k such that (k^2 - 1)/4 + 1/(16*k^2) <= n. All perfect squares are 0 or 1 (mod 4). In either case, it is easily verified that one of the inequalities is satisfied if and only if the other inequality is satisfied. - Nathaniel Johnston, Jun 26 2011
LINKS
Nathaniel Johnston, Table of n, a(n) for n = 1..5000
MAPLE
seq(n+floor(2*sqrt(n)), n=1..67); # Nathaniel Johnston, Jun 26 2011
MATHEMATICA
a=4; b=0;
Table[n+Floor[(a*n+b)^(1/2)], {n, 100}]
Table[n-1+Ceiling[(n*n-b)/a], {n, 70}]
PROG
(PARI) a(n) = n+floor(2*sqrt(n)); \\ Michel Marcus, Dec 08 2015
(Magma) [n+Floor(2*Sqrt(n)): n in [1..100]]; // Vincenzo Librandi, Dec 09 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Jan 07 2011
STATUS
approved