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.

A166342 Numbers n such that (n+2)*n!*Sum((-1)^k/k!),k=0..n+2 is prime.

Original entry on oeis.org

2, 3, 4, 8, 13, 42, 64, 166, 573, 1711
Offset: 1

Views

Author

Mike Oakes, Oct 12 2009

Keywords

Comments

No further terms up to n=20000. The sequence a[n]=(n+2)*n!*Sum((-1)^k/k!),k=0..n+2 is A000255.

Examples

			For n=3, a[3]=11 which is prime.
		

Crossrefs

Cf. A000255 (corresponding sequence).

Programs

  • PARI
    z_even=1;z_odd=1;
    for(n=1,20000,
    if(n%2==1,
    z_odd=(n+2)*(n-1)*z_odd+1; if((ispseudoprime(z_odd)),print(n="n)),
    z_even=(n+2)*(n-1)*z_even-1; if((ispseudoprime(z_odd)),print(n="n))););

Formula

n is an index of the sequence a[n]=(n+2)*n!*Sum((-1)^k/k!),k=0..n+2 such that a[n] is prime.