OFFSET
1,1
COMMENTS
FORMULA
5 is in this sequence because (prime(2)^2 + 5*prime(2))/(prime(2) + 1) = 6 and 5 is prime.
MATHEMATICA
Table[q = 2; While[! IntegerQ[(Prime[n]^2 + q Prime@ n)/(Prime@ n + 1)], q = NextPrime@ q]; q, {n, 59}] (* Michael De Vlieger, Oct 26 2015 *)
PROG
(PARI) a(n) = {p = prime(n); q = 2; while ((p^2 + p*q) % (p + 1), q = nextprime(q+1)); q; } \\ Michel Marcus, Oct 26 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, Oct 25 2015
STATUS
approved