login
First differences of non-prime-powers (exclusive, so 1 is not a prime-power).
30

%I #13 Sep 10 2024 00:25:54

%S 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,

%T 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,

%U 2,2,1,1,2,1,1,1,1,1,1,2,1,1,2,3,1,2,1

%N First differences of non-prime-powers (exclusive, so 1 is not a prime-power).

%C Non-prime-powers (exclusive) are listed by A361102.

%C Warning: For this sequence, 1 is not a prime-power but is a non-prime-power.

%e The 6th non-prime-power (exclusive) is 15, and the 7th is 18, so a(6) = 3.

%t Differences[Select[Range[100],!PrimePowerQ[#]&]]

%o (Python)

%o from itertools import count

%o from sympy import primepi, integer_nthroot, primefactors

%o def A375708(n):

%o def f(x): return int(n+sum(primepi(integer_nthroot(x,k)[0]) for k in range(1,x.bit_length())))

%o m, k = n, f(n)

%o while m != k: m, k = k, f(k)

%o return next(i for i in count(m+1) if len(primefactors(i))>1)-m # _Chai Wah Wu_, Sep 09 2024

%Y For prime-powers (A000961, A246655) we have A057820, gaps A093555.

%Y For perfect powers (A001597) we have A053289.

%Y For nonprime numbers (A002808) we have A073783.

%Y For squarefree numbers (A005117) we have A076259.

%Y First differences of A361102, inclusive A024619.

%Y Positions of 1's are A375713.

%Y If 1 is considered a prime power we have A375735.

%Y Runs of non-prime-powers:

%Y - length: A110969

%Y - first: A373676

%Y - last: A373677

%Y - sum: A373678

%Y A000040 lists all of the primes, differences A001223.

%Y A007916 lists non-perfect-powers, differences A375706.

%Y A013929 lists the nonsquarefree numbers, differences A078147.

%Y Prime-power runs: A373675, min A373673, max A373674, length A174965.

%Y Prime-power antiruns: A373576, min A120430, max A006549, length A373671.

%Y Non-prime-power antiruns: A373679, min A373575, max A255346, length A373672.

%Y Cf. A046933, A061399, A176246, A251092, A375709.

%K nonn

%O 1,1

%A _Gus Wiseman_, Aug 31 2024