[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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.
2
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,1
LINKS
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 *)
PROG
(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
CROSSREFS
Sequence in context: A103540 A065159 A240265 * A308983 A032826 A190709
KEYWORD
nice,nonn
AUTHOR
Felice Russo, Dec 21 1999
EXTENSIONS
More terms from Michel Marcus, Sep 28 2013
STATUS
approved