OFFSET
1,2
LINKS
Harry J. Smith, Table of n, a(n) for n = 1..2000
FORMULA
a(n) = 3 if n=2; floor(sqrt((n+1)^3 - 1)) - floor(sqrt(n^3+1)) otherwise. - Ralf Stephan, Mar 28 2003 [Corrected by Sean A. Irvine, Jan 29 2023]
EXAMPLE
a(2) = 3 as there are three squares (9, 16 and 25) between 8 and 27.
a(3)= 2 as there are two squares (36 and 49) between 27 and 64. (64 is not counted, as it is not strictly between 27 and 64.)
MATHEMATICA
a[1] = 1; a[2] = 3; a[n_] := Floor[Sqrt[(n+1)^3-1]] - Floor[Sqrt[n^3+1]]; Array[a, 100] (* Jean-François Alcover, Dec 04 2015, adapted from PARI *)
PROG
(PARI) print1("1, 3, "):for(n=3, 100, print1(sqrtint((n+1)^3-1)-sqrtint(n^3+1)", "))
(PARI) { for (n=1, 2000, a=sqrtint((n+1)^3-1)-sqrtint(n^3+1); if (n==2, a=3); write("b061266.txt", n, " ", a); ) } \\ Harry J. Smith, Jul 20 2009
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Apr 24 2001
EXTENSIONS
More terms from Ralf Stephan, Mar 28 2003
Offset changed from 0 to 1 by Harry J. Smith, Jul 20 2009
STATUS
approved