OFFSET
1,4
EXAMPLE
a(20) = 5 because 40*3^5 + 1 is prime and 40*3^k + 1 is not prime for k=1..4.
MATHEMATICA
{b, h} = {3, 2}; f[n_, k_] := n*b^k - h
s[n_] := Select[Range[20], PrimeQ[f[n, #]] &, 1]
Flatten[Table[s[n], {n, 1, 200}]]
CROSSREFS
KEYWORD
nonn
AUTHOR
Clark Kimberling, Oct 31 2024
STATUS
approved