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”).

A187562
Least k >= 0 such that prime(n)*(prime(n)-k)+1 is prime.
1
0, 1, 3, 1, 3, 1, 3, 7, 3, 11, 9, 3, 3, 3, 3, 9, 5, 3, 1, 11, 9, 1, 9, 5, 7, 5, 3, 9, 7, 11, 3, 21, 23, 1, 11, 1, 3, 1, 9, 3, 5, 15, 5, 1, 3, 9, 3, 13, 3, 7, 3, 5, 13, 21, 9, 21, 9, 21, 21, 5, 3, 21, 3, 3, 9, 11, 15, 1, 11, 1, 3
OFFSET
1,3
MAPLE
A187562 := proc(n) local p, k; p := ithprime(n) ; for k from 0 do if isprime( p*(p-k)+1 ) then return k; end if; end do: end proc: # R. J. Mathar, Mar 13 2011
MATHEMATICA
Table[k = 0; While[! PrimeQ[Prime[n]*(Prime[n] - k) + 1], k++]; k, {n, 100}]
CROSSREFS
Sequence in context: A332031 A023511 A035628 * A370719 A057024 A023892
KEYWORD
nonn
AUTHOR
Pierre CAMI, Mar 13 2011
STATUS
approved