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.

A275272 a(n) = p - n!, where p is the second smallest prime > n!.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 19, 31, 23, 19, 17, 43, 73, 41, 149, 41, 53, 61, 109, 37, 37, 71, 109, 193, 97, 173, 47, 101, 229, 163, 241, 83, 139, 103, 83, 577, 311, 47, 269, 61, 61, 107, 97, 89, 379, 149, 269, 83, 137, 167, 281, 89, 79, 443, 229, 157, 179, 563, 389
Offset: 1

Views

Author

Clark Kimberling, Jul 23 2016

Keywords

Comments

p-n! where p = nextprime(nextprime(n!)).
Is every term a prime?

Examples

			For n = 4, we have n! = 24, so that p = 31 and a(4) = 7.
		

Crossrefs

Programs

  • Mathematica
    Table[NextPrime[n!, 2] - n!, {n, 1, 150}]
  • PARI
    a(n) = nextprime(nextprime(n!+1)+1) - n!; \\ Michel Marcus, Mar 05 2022
    
  • Python
    from sympy import factorial, nextprime
    def a(n): fn = factorial(n); return nextprime(nextprime(fn)) - fn
    print([a(n) for n in range(1, 60)]) # Michael S. Branicky, Mar 05 2022

Formula

a(n) = A187874(n) - A000142(n). - Michel Marcus, Mar 05 2022