%I #18 Sep 10 2024 17:26:04
%S 0,1,1,1,1,2,1,2,1,2,0,4,2,1,3,0,3,1,2,1,3,2,0,2,5,1,3,1,1,3,3,2,1,3,
%T 1,2,2,2,1,2,2,3,6,1,1,1,4,1,1,3,3,1,3,4,1,2,3,1,2,3,2,3,2,3,3,2,1,4,
%U 2,1,1,0,7,1,1,4,3,2,2,2,3,3,2,0,4,2,4
%N The number of cubefull numbers (A036966) between the consecutive cubes n^3 and (n+1)^3.
%C For each k >= 0 the sequence of solutions to a(x) = k has a positive asymptotic density (Shiu, 1991).
%H Amiram Eldar, <a href="/A337736/b337736.txt">Table of n, a(n) for n = 1..10000</a>
%H P. Shiu, <a href="https://doi.org/10.1017/S0017089500008351">The distribution of cube-full numbers</a>, Glasgow Mathematical Journal, Vol. 33, No. 3 (1991), pp. 287-295. See section 3, p. 291.
%F Asymptotic mean: lim_{m->oo} (1/m) Sum_{k=1..m} a(k) = A362974 - 1 = 3.659266... . - _Amiram Eldar_, May 11 2023
%e a(2) = 1 since there is one cubefull number, 16 = 2^4, between 2^3 = 8 and 3^3 = 27.
%t cubQ[n_] := Min[FactorInteger[n][[;; , 2]]] > 2; a[n_] := Count[Range[n^3 + 1, (n + 1)^3 - 1], _?cubQ]; Array[a, 100]
%o (Python)
%o from math import gcd
%o from sympy import integer_nthroot, factorint
%o def A337736(n):
%o def f(x):
%o c = 0
%o for w in range(1,integer_nthroot(x,5)[0]+1):
%o if all(d<=1 for d in factorint(w).values()):
%o for y in range(1,integer_nthroot(z:=x//w**5,4)[0]+1):
%o if gcd(w,y)==1 and all(d<=1 for d in factorint(y).values()):
%o c += integer_nthroot(z//y**4,3)[0]
%o return c
%o return f((n+1)**3-1)-f(n**3) # _Chai Wah Wu_, Sep 10 2024
%Y Cf. A000578, A036966, A119241, A337737, A362974.
%K nonn
%O 1,6
%A _Amiram Eldar_, Sep 17 2020