OFFSET
1,1
COMMENTS
Inclusive means 1 is a prime-power but not a non-prime-power. For the exclusive version, shift left once.
EXAMPLE
The non-prime-powers inclusive (A024619) are:
6, 10, 12, 14, 15, 18, 20, 21, 22, 24, 26, 28, 30, 33, 34, 35, 36, 38, 39, 40, ...
with first differences (A375735):
4, 2, 2, 1, 3, 2, 1, 1, 2, 2, 2, 2, 3, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, ...
with first differences (A376599):
-2, 0, -1, 2, -1, -1, 0, 1, 0, 0, 0, 1, -2, 0, 0, 1, -1, 0, 1, 0, -1, 0, 1, 0, ...
MATHEMATICA
Differences[Select[Range[100], !(#==1||PrimePowerQ[#])&], 2]
PROG
(Python)
from sympy import primepi, integer_nthroot
def A376599(n):
def iterfun(f, n=0):
m, k = n, f(n)
while m != k: m, k = k, f(k)
return m
def f(x): return int(n+1+sum(primepi(integer_nthroot(x, k)[0]) for k in range(1, x.bit_length())))
return (a:=iterfun(f, n))-((b:=iterfun(lambda x:f(x)+1, a))<<1)+iterfun(lambda x:f(x)+2, b) # Chai Wah Wu, Oct 02 2024
CROSSREFS
A007916 lists non-perfect-powers.
A057820 gives first differences of prime-powers inclusive, first appearances A376341, sorted A376340.
For non-prime-powers: A024619/A361102 (terms), A375735/A375708 (first differences), A376600 (inflections and undulations), A376601 (nonzero curvature).
KEYWORD
sign
AUTHOR
Gus Wiseman, Oct 02 2024
STATUS
approved