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.

A049563 a(n) = ((prime(n)-1)! + 1) mod (prime(n) + 2).

Original entry on oeis.org

2, 3, 4, 1, 7, 1, 10, 1, 1, 16, 1, 1, 22, 1, 1, 1, 31, 1, 1, 37, 1, 1, 1, 1, 1, 52, 1, 55, 1, 1, 1, 1, 70, 1, 76, 1, 1, 1, 1, 1, 91, 1, 97, 1, 100, 1, 1, 1, 115, 1, 1, 121, 1, 1, 1, 1, 136, 1, 1, 142, 1, 1, 1, 157, 1, 1, 1, 1, 175, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 211, 1, 217, 1, 1, 1, 1, 1
Offset: 1

Views

Author

Keywords

Comments

Residue of (prime(n)-1)!+1 modulo prime(n)+2.

Examples

			a(3) = 4 since prime(3) = 5, and 4! + 1 = 25 gives residue 4 when divided by prime(3) + 2 = 7.
		

Crossrefs

Programs

  • Magma
    [(Factorial(p-1)+1) mod (p+2): p in PrimesUpTo(500)]; // Bruno Berselli, Apr 10 2015
    
  • Mathematica
    Table[Mod[(Prime[k] - 1)! + 1, Prime[k] + 2], {k, 1, 200}]
  • PARI
    a(n) = ((prime(n)-1)! + 1) % (prime(n) + 2); \\ Michel Marcus, May 28 2018
  • Sage
    [Mod(factorial(p-1)+1,p+2) for p in primes(500)] # Bruno Berselli, Apr 10 2015
    

Formula

a(n) = A060371(n) mod A052147(n). - Amiram Eldar, Mar 13 2025