oeis.org

A002200 - OEIS

2, 3, 5, 7, 11, 13, 17, 19, 31, 37, 41, 61, 73, 97, 101, 109, 151, 163, 181, 193, 241, 251, 257, 271, 401, 433, 487, 541, 577, 601, 641, 751, 769, 811, 1153, 1201, 1297, 1459, 1601, 1621, 1801, 2161, 2251, 2593, 2917, 3001, 3457, 3889, 4001, 4051, 4801, 4861

REFERENCES

M. Kraitchik, Recherches sur la Théorie des Nombres. Gauthiers-Villars, Paris, Vol. 1, 1924, Vol. 2, 1929, see Vol. 1, p. 53.

N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).

N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

MATHEMATICA

up=10^6; a=1; Sort[Reap[While[ a<up, b=a; While[ b<up, c=b; While[ c<up, If[ PrimeQ[ c+1], Sow[ c+1]]; c *= 5]; b *= 3]; a *= 2]][[2, 1]]] (* Giovanni Resta, Jul 18 2017 *)

PROG

(PARI) { default(primelimit, 16600000); n=0; forprime (p=2, 16600000, m=p-1; p2=p3=p5=0; s=m; r=0; while(r==0, q=s\2; r=s-2*q; s=q; if(r==0, p2++)); s=m; r=0; while(r==0, q=s\3; r=s-3*q; s=q; if(r==0, p3++)); s=m; r=0; while(r==0, q=s\5; r=s-5*q; s=q; if(r==0, p5++)); if (m == 2^p2*3^p3*5^p5, n++; write("b002200.txt", n, " ", p)); if (n >= 200, break); ); } \\ Harry J. Smith, May 25 2009

(PARI) { n=5000; cache=10^5; v=vector(cache); x2=2; x3=3; x5=5; i=j=k=1; v[1]=1; for(m=2, cache, v[m]=t=min(x2, min(x3, x5)); if(x2==t, x2=2*v[i++]); if(x3==t, x3=3*v[j++]); if(x5==t, x5=5*v[k++]); ); i=0; c=0; while(c<n, i++; if(isprime(v[i]+1), c++; print(c" "v[i]+1))); } \\ Jean-Marie Madiot, Jul 17 2017

(Magma) [p: p in PrimesUpTo(5000) | forall{d: d in PrimeDivisors(p-1) | d le 5}]; // Bruno Berselli, Sep 24 2012

(GAP)

K:=10^7;; # to get all terms <= K.

A:=Filtered([1..K], IsPrime);;

B:=List(A, i->Factors(i-1));;

C:=[];; for i in B do if Elements(i)=[2] or Elements(i)=[2, 3] or Elements(i)=[2, 5] or Elements(i)=[2, 3, 5] then Add(C, Position(B, i)); fi; od;

EXTENSIONS

Better description and more terms from Vladeta Jovovic, May 08 2003