OFFSET
0,2
COMMENTS
An alternate definition specifying "less than 2^n" would yield the same sequence except for the first 3 terms: 0,1,3,7,14,27,54,107, etc. (since powers of 2 beyond 8 are not cubefree).
The limit of a(n)/2^n is the inverse of Apery's constant, 1/zeta(3) [see A088453].
LINKS
Chai Wah Wu, Table of n, a(n) for n = 0..103 (terms 0..80 from Gerard P. Michon)
Gerard P. Michon, On the number of cubefree integers not exceeding N.
FORMULA
a(n) = Sum_{i=1..2^(n/3)} A008683(i)*floor(2^n/i^3).
EXAMPLE
a(0)=1 because there is just one cubefree integer (1) not exceeding 2^0 = 1.
a(3)=7 because 1,2,3,4,5,6,7 are cubefree but 8 is not.
MATHEMATICA
a[n_] := Sum[ MoebiusMu[i]*Floor[2^n/i^3], {i, 1, 2^(n/3)}]; Table[a[n], {n, 0, 32}] (* Jean-François Alcover, Dec 20 2011, from formula *)
Module[{nn=20, mu}, mu=Table[If[Max[FactorInteger[n][[All, 2]]]<3, 1, 0], {n, 2^nn}]; Table[Total[Take[mu, 2^k]], {k, 0, nn}]] (* The program generates the first 20 terms of the sequence. To get more, increase the value (constant) for nn, but the program may take a long time to run. *) (* Harvey P. Dale, Aug 13 2021 *)
PROG
(Haskell)
a160113 = a060431 . (2 ^) -- Reinhard Zumkeller, Jul 27 2015
(Python)
from sympy import mobius, integer_nthroot
def A160113(n): return sum(mobius(k)*((1<<n)//k**3) for k in range(1, integer_nthroot(1<<n, 3)[0]+1)) # Chai Wah Wu, Aug 06 2024
(Python)
from bitarray import bitarray
from sympy import integer_nthroot
def A160113(n): # faster program
q = 1<<n
m = integer_nthroot(q, 3)[0]+1
a, b = bitarray(m), bitarray(m)
a[1], p, i, c = 1, 2, 4, q-sum(q//k**3 for k in range(2, m))
while i < m:
j = 2
while i < m:
if j==p:
c -= (b[i]^1 if a[i] else -1)*(q//i**3)
j, a[i], b[i] = 0, 1, 1
else:
t1, t2 = a[i], b[i]
if (t1&t2)^1:
a[i], b[i] = (t1^1)&t2, ((t1^1)&t2)^1
c += (t2 if t1 else 2)*(q//i**3) if (t1^1)&t2 else (t2-2 if t1 else 0)*(q//i**3)
i += p
j += 1
p += 1
while a[p]|b[p]:
p += 1
i = p<<1
return c # Chai Wah Wu, Aug 06 2024
CROSSREFS
KEYWORD
easy,nice,nonn
AUTHOR
Gerard P. Michon, May 02 2009
STATUS
approved