OFFSET
1,1
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
FORMULA
sqrt(n) < a(n) <= sqrt(n) + 2. - Charles R Greathouse IV, Mar 23 2015
MATHEMATICA
Table[m = 1; While[! IntegerQ[Sqrt[n + 2*m]], m++]; Sqrt[n + 2 m], {n, 100}] (* Michael De Vlieger, Mar 20 2015 *)
PROG
(PARI) a(n)=m=1; while(!issquare(n+2*m), m++); sqrt(n+2*m)
vector(100, n, round(a(n))) \\ Derek Orr, Mar 22 2015
(PARI) a(n)=my(s=sqrtint(n)); if((s-n)%2, s+1, s+2) \\ Charles R Greathouse IV, Mar 23 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Zak Seidov, Mar 20 2015
STATUS
approved