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”).

A157752
Smallest positive integer m such that m == prime(i) (mod prime(i+1)) for all 1<=i<=n.
4
2, 8, 68, 1118, 2273, 197468, 1728998, 1728998, 447914738, 10152454583, 1313795640428, 97783391392958, 5726413266646343, 38433316595821418, 15103232990013860963, 943894249589930135768, 52858423703753671390658, 932521283899305953765183, 8790842834979573009644273
OFFSET
1,1
COMMENTS
Suggested by Chinese Remainder Theorem.
a(n) is prime for n = 1, 5, 10, 23, 30.
LINKS
MAPLE
A157752 := proc(n)
local lrem, leval, i ;
lrem := [] ;
leval := [] ;
for i from 1 to n do
lrem := [op(lrem), ithprime(i+1)] ;
leval := [op(leval), ithprime(i)] ;
end do:
chrem(leval, lrem) ;
end proc: # R. J. Mathar, Apr 14 2016
MATHEMATICA
a[n_] := ChineseRemainder[Prime[Range[n]], Prime[Range[2, n + 1]]] a[ # ] & /@ Range[30]
Table[With[{pr=Prime[Range[n]]}, ChineseRemainder[Most[pr], Rest[pr]]], {n, 2, 30}] (* Harvey P. Dale, Jun 11 2017 *)
PROG
(PARI) x=Mod(1, 1); for(i=1, 20, x=chinese(x, Mod(prime(i), prime(i+1))); print1(component(x, 2), ", "))
(Python)
from sympy.ntheory.modular import crt
from sympy import prime
def A157752(n): return int(crt((s:=[prime(i+1) for i in range(1, n)])+[prime(n+1)], [2]+s)[0]) # Chai Wah Wu, May 02 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Mar 05 2009
EXTENSIONS
Edited by Charles R Greathouse IV, Oct 28 2009
STATUS
approved