login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A349643
Smallest prime p = prime(k) such that the n-th difference of (prime(k), ..., prime(k+n)) is zero.
6
3, 17, 347, 41, 211, 271, 23, 191, 33151, 541, 70891, 152681, 856637, 158047, 2010581, 24239, 7069423, 15149419, 9472693, 347957, 479691493, 994339579, 132480637, 4462552643, 1342424483, 4757283367, 20674291411, 21170786093, 9941224877, 68864319317, 8660066477
OFFSET
2,1
COMMENTS
Equivalently, a(n) is the smallest prime p = prime(k) such that there is a polynomial f of degree at most n-1 such that f(j) = prime(j) for k <= j <= k+n.
a(n) = prime(k), where k is the smallest positive integer such that A095195(k+n,n) = 0.
FORMULA
Sum_{j=0..n} (-1)^j*binomial(n,j)*prime(k+j) = 0, where prime(k) = a(n).
EXAMPLE
The first six consecutive primes for which the fifth difference is 0 are (41, 43, 47, 53, 59, 61), so a(5) = 41. The successive differences are (2, 4, 6, 6, 2), (2, 2, 0, -4), (0, -2, -4), (-2, -2), and (0).
MATHEMATICA
With[{prs=Prime[Range[10^6]]}, Table[SelectFirst[Partition[prs, n+1, 1], Differences[#, n]=={0}&][[1]], {n, 2, 21}]] (* The program generates the first 20 terms of the sequence. *) (* Harvey P. Dale, Aug 10 2024 *)
PROG
(Python)
from math import comb
from sympy import nextprime
def A349643(n):
plist, clist = [2], [1]
for i in range(1, n+1):
plist.append(nextprime(plist[-1]))
clist.append((-1)**i*comb(n, i))
while True:
if sum(clist[i]*plist[i] for i in range(n+1)) == 0: return plist[0]
plist = plist[1:]+[nextprime(plist[-1])] # Chai Wah Wu, Nov 25 2021
CROSSREFS
First column of A349644.
Cf. A095195.
Sequence in context: A051294 A192556 A144033 * A098138 A009719 A332758
KEYWORD
nonn
AUTHOR
STATUS
approved