[go: up one dir, main page]

login
A376596
Second differences of consecutive prime-powers inclusive (A000961). First differences of A057820.
29
0, 0, 0, 1, -1, 0, 1, 0, 1, -2, 1, 2, -2, 0, 0, 0, -1, 4, -1, -2, 2, -2, 2, 2, -4, 1, 0, 1, -2, 4, -4, 0, 4, 2, -4, -2, 2, -2, 2, 4, -4, -2, -1, 2, 3, -4, 8, -8, 4, 0, -2, -2, 2, 2, -4, 8, -8, 2, -2, 10, 0, -8, -2, 2, 2, -4, 0, 6, -3, -4, 5, 0, -4, 4, -2, -2
OFFSET
1,10
COMMENTS
For the exclusive version, shift left once.
EXAMPLE
The prime-powers inclusive (A000961) are:
1, 2, 3, 4, 5, 7, 8, 9, 11, 13, 16, 17, 19, 23, 25, 27, 29, 31, 32, 37, 41, 43, ...
with first differences (A057820):
1, 1, 1, 1, 2, 1, 1, 2, 2, 3, 1, 2, 4, 2, 2, 2, 2, 1, 5, 4, 2, 4, 2, 4, 6, 2, 3, ...
with first differences (A376596):
0, 0, 0, 1, -1, 0, 1, 0, 1, -2, 1, 2, -2, 0, 0, 0, -1, 4, -1, -2, 2, -2, 2, 2, ...
MATHEMATICA
Differences[Select[Range[1000], #==1||PrimePowerQ[#]&], 2]
PROG
(Python)
from sympy import primepi, integer_nthroot
def A376596(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+x-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
The version for A000002 is A376604, first differences of A054354.
For first differences we had A057820, sorted firsts A376340(n)+1 (except first term).
Positions of zeros are A376597, complement A376598.
Sorted positions of first appearances are A376653, exclusive A376654.
A000961 lists prime-powers inclusive, exclusive A246655.
A001597 lists perfect-powers, complement A007916.
A023893 and A023894 count integer partitions into prime-powers, factorizations A000688.
A064113 lists positions of adjacent equal prime gaps.
For prime-powers inclusive: A057820 (first differences), A376597 (inflections and undulations), A376598 (nonzero curvature).
For second differences: A036263 (prime), A073445 (composite), A376559 (perfect-power), A376562 (non-perfect-power), A376590 (squarefree), A376593 (nonsquarefree), A376599 (non-prime-power).
Sequence in context: A093101 A082469 A206566 * A088151 A286129 A230322
KEYWORD
sign
AUTHOR
Gus Wiseman, Oct 02 2024
STATUS
approved