OFFSET
1,1
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..2123 (terms 1..500 from Amiram Eldar)
EXAMPLE
27 = 3^3 is a term since it is cubefull, and the next powerful number, 32 = 2^5, is also cubefull.
MATHEMATICA
cubQ[n_] := n == 1 || AllTrue[FactorInteger[n][[;; , 2]], # > 2 &];
seq[max_] := Module[{pows = Union[Flatten[Table[i^2*j^3, {j, 1, Surd[max, 3]}, {i, 1, Sqrt[max/j^3]}]]], ind = {}, d}, Do[If[cubQ[pows[[k]]], AppendTo[ind, k]], {k, 1, Length[pows]}]; d = Differences[ind]; pows[[ind[[Position[d, 1] // Flatten]]]]]; seq[10^6]
PROG
(PARI) iscubefull(n) = n == 1 || vecmin(factor(n)[, 2]) > 2;
lista(mx) = {my(s = List(), is1, is2); for(j = 1, sqrtnint(mx, 3), for(i = 1, sqrtint(mx\j^3), listput(s, i^2 * j^3))); s = Set(s); is1 = 1; for(i = 2, #s, is2 = iscubefull(s[i]); if(is1 && is2, print1(s[i-1], ", ")); is1 = is2); }
(Python)
from math import isqrt, gcd
from sympy import mobius, integer_nthroot, factorint
def A371189_gen(): # generator of terms
def squarefreepi(n): return int(sum(mobius(k)*(n//k**2) for k in range(1, isqrt(n)+1)))
def bisection(f, kmin=0, kmax=1):
while f(kmax) > kmax: kmax <<= 1
while kmax-kmin > 1:
kmid = kmax+kmin>>1
if f(kmid) <= kmid:
kmax = kmid
else:
kmin = kmid
return kmax
def f(x):
c, l, j = x-squarefreepi(integer_nthroot(x, 3)[0]), 0, isqrt(x)
while j>1:
k2 = integer_nthroot(x//j**2, 3)[0]+1
w = squarefreepi(k2-1)
c -= j*(w-l)
l, j = w, isqrt(x//k2**3)
return c+l
def g(x):
c = x
for w in range(1, integer_nthroot(x, 5)[0]+1):
if all(d<=1 for d in factorint(w).values()):
for y in range(1, integer_nthroot(z:=x//w**5, 4)[0]+1):
if gcd(w, y)==1 and all(d<=1 for d in factorint(y).values()):
c -= integer_nthroot(z//y**4, 3)[0]
return c
m, w = 1, 1
for n in count(2):
k = bisection(lambda x:g(x)+n, m, m)
if (a:=f(k))-w== k-1-m:
yield m
m, w = k, a # Chai Wah Wu, Sep 15 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Amiram Eldar, Mar 14 2024
STATUS
approved