A087377 Triangle read by rows: n-th row contains n smallest numbers k (say) such that nk+1 is a prime.
1, 1, 2, 2, 4, 6, 1, 3, 4, 7, 2, 6, 8, 12, 14, 1, 2, 3, 5, 6, 7, 4, 6, 10, 16, 18, 28, 30, 2, 5, 9, 11, 12, 14, 17, 24, 2, 4, 8, 12, 14, 18, 20, 22, 30, 1, 3, 4, 6, 7, 10, 13, 15, 18, 19, 2, 6, 8, 18, 30, 32, 36, 38, 42, 56, 60, 1, 3, 5, 6, 8, 9, 13, 15, 16, 19, 20, 23, 4, 6, 10, 12, 24, 34
Offset: 1
Examples
1 1 2 2 4 6 1 3 4 7 2 6 8 12 14 1 2 3 5 6 7 4 6 10 16 18 28 30
Links
- Ivan Neretin, Table of n, a(n) for n = 1..5050
Programs
-
Maple
F:= proc(n) local res,count,k; res:= NULL: count:= 0: for k from 1 while count < n do if isprime(n*k+1) then res:= res,k; count:= count+1 fi od; res end proc: seq(F(n),n=1..20); # Robert Israel, May 22 2015
-
Mathematica
a = {}; Do[k = 0; ar = {}; While[Length[ar] < n, k++; If[PrimeQ[k n + 1], AppendTo[ar, k]]]; a = Join[a, ar], {n, 13}]; a (* Ivan Neretin, May 22 2015 *)
-
PARI
tabl(nn) = {for (n = 1, nn, j = 0; for (k = 1, n, j++; while (!isprime(n*j+1), j++); print1(j, ", ");); print(););} \\ Michel Marcus, May 23 2015
Extensions
More terms from Sam Alexander, Feb 27 2004
Comments