OFFSET
1,1
COMMENTS
Suggested by Chinese Remainder Theorem.
a(n) is prime for n = 1, 5, 10, 23, 30.
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..349
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