OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..390
EXAMPLE
a(2) = 17 = 2 * 7 + 3.
a(3) = 37 = 2 * 17 + 3.
a(4) = 151 = 4 * 37 + 3.
MAPLE
A214634 := proc(n)
option remember;
local k;
if n = 1 then
7;
else
for k from 1 do
if isprime(k*procname(n-1)+3) then
return k*procname(n-1)+3 ;
end if;
end do:
end if;
end proc:
seq(A214634(n), n=1..20) ; # R. J. Mathar, Jul 23 2012
MATHEMATICA
spf[n_]:=Module[{k=1}, While[!PrimeQ[k*n+3], k++]; k*n+3]; NestList[spf, 7, 25] (* Harvey P. Dale, Aug 02 2017 *)
PROG
(PARI) a=7; for(n=1, 200, b=a*n+3; if(isprime(b), a=b; print1(a, ", "); next(n=1)))
CROSSREFS
KEYWORD
nonn
AUTHOR
Robin Garcia, Jul 23 2012
EXTENSIONS
More terms from Robert Israel, Nov 23 2016
STATUS
approved