OFFSET
1,1
COMMENTS
Consider the sequence of powerful numbers A001694, superset of A246547, the sequence of composite prime powers. Let s = A001694(k) such that omega(s) > 1 be followed by t = A001694(k+1) such that omega(t) = 1.
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
Michael De Vlieger, Scatterplot of a(n), n = 1..2^16, highlighting in red terms s that in A001694 are succeeded by a prime power t.
EXAMPLE
The number 36 is the smallest powerful number that is not a prime power; the next powerful number that is not a prime power is 72, and their difference is 36, hence a(1) = 36.
MATHEMATICA
With[{nn = 2^25}, Differences@ Select[Rest@ Union@ Flatten@ Table[a^2*b^3, {b, nn^(1/3)}, {a, Sqrt[nn/b^3]}], ! PrimePowerQ[#] &]]
PROG
(Python)
from math import isqrt
from sympy import integer_nthroot, primepi, mobius
def A358173(n):
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 = n+x+1+sum(primepi(integer_nthroot(x, k)[0]) for k in range(2, x.bit_length())), 0
j = 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)
c -= squarefreepi(integer_nthroot(x, 3)[0])-l
return c
return -(a:=bisection(f, n, n))+bisection(lambda x:f(x)+1, a, a) # Chai Wah Wu, Sep 10 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Michael De Vlieger, Nov 01 2022
STATUS
approved