OFFSET
-1,5
COMMENTS
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = -1..6646
FORMULA
a(n) = floor(sqrt(2^(n+1))) - floor(sqrt(2^n)).
EXAMPLE
Between 2^6=64 and 2^(6+1)=128 are the squares 81=9^2, 100=10^2, 121=11^2, so a(n)=3
MATHEMATICA
Table[Floor[Sqrt[2^(n + 1)]] - Floor[Sqrt[2^n]], {n, -1, 120}] (* G. C. Greubel, Aug 19 2018 *)
PROG
(PARI) a(n)=sqrtint(1<<(n+1))-sqrtint(1<<n) \\ Charles R Greathouse IV, May 12 2011
(Magma) [Floor(Sqrt(2^(n+1))) - Floor(Sqrt(2^n)): n in [-1..50]]; // G. C. Greubel, Aug 19 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
John W. Nicholson, May 12 2011
EXTENSIONS
Definition corrected by Bruno Berselli, May 13 2011
STATUS
approved