OFFSET
0,2
COMMENTS
Sixth powers are counted only once (0 and 1 are both squares and cubes, for example, but they are not counted twice).
FORMULA
a(n) = 1 + floor(n^(1/2)) + floor(n^(1/3)) - floor(n^(1/6)). - N. J. A. Sloane, Mar 16 2005
EXAMPLE
a(9)=5 because we have 0,1,4,8 and 9.
MAPLE
seq(1+floor(evalf(n^(1/2)))+floor(evalf(n^(1/3)))-floor(evalf(n^(1/6))), n=0..94); # Emeric Deutsch
MATHEMATICA
Rest[Accumulate[Table[Which[IntegerQ[Sqrt[n]], 1, IntegerQ[Surd[n, 3]], 1, True, 0], {n, 0, 150}]]] (* Harvey P. Dale, Jun 24 2017 *)
PROG
(PARI) a(n)=sqrtint(n)+sqrtnint(n, 3)-sqrtnint(n, 6) \\ Charles R Greathouse IV, Jun 25 2017
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Giovanni Teofilatto, Mar 02 2005
EXTENSIONS
More terms from Emeric Deutsch, Mar 24 2005
Corrected by Harvey P. Dale, Jun 24 2017
Definition revised by N. J. A. Sloane, Jun 25 2017
STATUS
approved