A375708 First differences of non-prime-powers (exclusive, so 1 is not a prime-power).
5, 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, 1, 2, 1, 1, 1, 1, 2, 2, 1, 2, 1, 2, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 3, 1, 2, 1
Offset: 1
Keywords
Examples
The 6th non-prime-power (exclusive) is 15, and the 7th is 18, so a(6) = 3.
Crossrefs
Programs
-
Mathematica
Differences[Select[Range[100],!PrimePowerQ[#]&]]
-
Python
from itertools import count from sympy import primepi, integer_nthroot, primefactors def A375708(n): def f(x): return int(n+sum(primepi(integer_nthroot(x,k)[0]) for k in range(1,x.bit_length()))) m, k = n, f(n) while m != k: m, k = k, f(k) return next(i for i in count(m+1) if len(primefactors(i))>1)-m # Chai Wah Wu, Sep 09 2024
Comments