OFFSET
0,3
LINKS
Pierre CAMI, Table of n, a(n) for n = 0..225
EXAMPLE
6*1^prime(1)-1 = 5 prime so a(1)=1, prime (2)=3, 6*3^3-1 = 161 composite, 6*5^3-1 = 749 composite, 6*7^3-1 = 2057 composite, 6*9^3-1 = 4373 prime so a(2) = 9.
MATHEMATICA
a[0] = 0; a[n_] := a[n] = Module[{k = Boole[OddQ@ #] + # + 1 &@ a[n - 1]}, While[! PrimeQ[6*k^Prime[n] - 1], k += 2]; k]; Table[a@ n, {n, 0, 43}] (* Michael De Vlieger, Mar 15 2017 *)
PROG
(PARI) foddk(n, k) = {while (! isprime(6*k^prime(n)-1), k+=2); k; }
lista(nn) = {k = 1; for (n=1, nn, k = foddk(n, k); print1(k, ", "); k += 2; ); } \\ Michel Marcus, Mar 18 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierre CAMI, Mar 14 2017
STATUS
approved