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.

A051956 a(n) = smallest number > a(n-1) such that a(1)*a(2)*...*a(n) + 1 and a(1)*a(2)*...*a(n) - 1 are primes.

Original entry on oeis.org

4, 15, 17, 19, 29, 57, 77, 285, 318, 354, 379, 405, 520, 521, 595, 625, 938, 1706, 1738, 2085, 2345, 2817, 4319, 4529, 7005, 8207, 8232, 9451, 9839, 11044, 11170, 12386, 12421, 12722, 14153, 15220, 15371, 17052, 17965, 18279, 18811, 19890, 21628, 22667, 22746
Offset: 1

Views

Author

Felice Russo, Dec 21 1999

Keywords

Crossrefs

Programs

  • Mathematica
    a[1] = 4; a[n_] := a[n] = For[k = a[n-1]+1, True, k++, p = Times @@ Array[a, n-1]; If[PrimeQ[k*p+1] && PrimeQ[k*p-1], Print[k]; Return[k]]]; Array[a, 45] (* Jean-François Alcover, Oct 23 2016 *)
  • PARI
    lista(nn) = {my (v = vector(nn)); for (n = 1, nn, if (n == 1, p = 1; k = 0; , p = prod(j=1, n-1, v[j]); k = v[n-1]+1); while (! isprime(p*k+1) || ! isprime(p*k-1), k++); v[n] = k; print1(k, ", "););} \\ Michel Marcus, Sep 28 2013

Extensions

More terms from Michel Marcus, Sep 28 2013