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.

A157752 Smallest positive integer m such that m == prime(i) (mod prime(i+1)) for all 1<=i<=n.

Original entry on oeis.org

2, 8, 68, 1118, 2273, 197468, 1728998, 1728998, 447914738, 10152454583, 1313795640428, 97783391392958, 5726413266646343, 38433316595821418, 15103232990013860963, 943894249589930135768, 52858423703753671390658, 932521283899305953765183, 8790842834979573009644273
Offset: 1

Views

Author

Zak Seidov, Mar 05 2009

Keywords

Comments

Suggested by Chinese Remainder Theorem.
a(n) is prime for n = 1, 5, 10, 23, 30.

Crossrefs

Programs

  • 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 *)
  • 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

Extensions

Edited by Charles R Greathouse IV, Oct 28 2009