|
|
A104055
|
|
Number of numbers 0 <= i <= n such that i is a square or a cube (or both).
|
|
1
|
|
|
1, 2, 2, 2, 3, 3, 3, 3, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
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).
|
|
LINKS
|
|
|
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
|
|
|
CROSSREFS
|
|
|
KEYWORD
|
easy,nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|