A375735 First differences of non-prime-powers (inclusive).
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, 1
Offset: 1
Keywords
Examples
The 5th non-prime-power (inclusive) is 15, and the 6th is 18, so a(5) = 3.
Crossrefs
Programs
-
Mathematica
Differences[Select[Range[2,100],!PrimePowerQ[#]&]]
-
Python
from itertools import count from sympy import primepi, integer_nthroot, primefactors def A375735(n): def f(x): return int(n+1+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 10 2024
Comments