cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A349643 Smallest prime p = prime(k) such that the n-th difference of (prime(k), ..., prime(k+n)) is zero.

This page as a plain text file.
%I A349643 #14 Aug 10 2024 16:44:58
%S A349643 3,17,347,41,211,271,23,191,33151,541,70891,152681,856637,158047,
%T A349643 2010581,24239,7069423,15149419,9472693,347957,479691493,994339579,
%U A349643 132480637,4462552643,1342424483,4757283367,20674291411,21170786093,9941224877,68864319317,8660066477
%N A349643 Smallest prime p = prime(k) such that the n-th difference of (prime(k), ..., prime(k+n)) is zero.
%C A349643 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.
%C A349643 a(n) = prime(k), where k is the smallest positive integer such that A095195(k+n,n) = 0.
%F A349643 Sum_{j=0..n} (-1)^j*binomial(n,j)*prime(k+j) = 0, where prime(k) = a(n).
%e A349643 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).
%t A349643 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 *)
%o A349643 (Python)
%o A349643 from math import comb
%o A349643 from sympy import nextprime
%o A349643 def A349643(n):
%o A349643     plist, clist = [2], [1]
%o A349643     for i in range(1,n+1):
%o A349643         plist.append(nextprime(plist[-1]))
%o A349643         clist.append((-1)**i*comb(n,i))
%o A349643     while True:
%o A349643         if sum(clist[i]*plist[i] for i in range(n+1)) == 0: return plist[0]
%o A349643         plist = plist[1:]+[nextprime(plist[-1])] # _Chai Wah Wu_, Nov 25 2021
%Y A349643 First column of A349644.
%Y A349643 Cf. A095195.
%K A349643 nonn
%O A349643 2,1
%A A349643 _Pontus von Brömssen_, Nov 23 2021