A160112 Number of cubefree integers not exceeding 10^n.
1, 9, 85, 833, 8319, 83190, 831910, 8319081, 83190727, 831907372, 8319073719, 83190737244, 831907372522, 8319073725828, 83190737258105, 831907372580692, 8319073725807178, 83190737258070643, 831907372580707771
Offset: 0
Examples
a(0)=1 because 1 <= 10^0 is not a multiple of the cube of a prime. a(1)=9 because the 9 numbers 1,2,3,4,5,6,7,9,10 are cubefree; 8 is not. a(2)=85 because there are 85 cubefree integers equal to 100 or less. a(3)=833 because there are 833 cubefree integers below 1000 (which is not cubefree itself).
Links
- Chai Wah Wu, Table of n, a(n) for n = 0..31 (terms 0..29 from Gerard P. Michon)
- Gerard P. Michon, On the number of cubefree integers not exceeding N.
Crossrefs
Programs
-
Maple
with(numtheory): A160112:=n->add(mobius(i)*floor(10^n/(i^3)), i=1..10^n): (1,9,85,seq(A160112(n), n=3..5)); # Wesley Ivan Hurt, Aug 01 2015
-
Mathematica
Table[ Sum[ MoebiusMu[x]*Floor[10^n/(x^3)], {x, 10^(n/3)}], {n, 0, 18}] (* Robert G. Wilson v, May 27 2009 *)
-
Python
from sympy import mobius, integer_nthroot def A160112(n): return sum(mobius(k)*(10**n//k**3) for k in range(1, integer_nthroot(10**n,3)[0]+1)) # Chai Wah Wu, Aug 06 2024
-
Python
from bitarray import bitarray from sympy import integer_nthroot def A160112(n): # faster program q = 10**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
Formula
a(n) = Sum_{i=1..floor(10^(n/3))} A008683(i)*floor(10^n/i^3).
Comments