OFFSET
1,1
COMMENTS
a(n) is prime for n = 1, 2, 3, 6, 15, 18, 31, 43, 82, ... a(n) is semiprime for n = 5, 8, 10, 11, 16, 19, 22, 23, 35, 36, 39, 41, 47, 50, 55, 56, 58, 63, 65, 66, 80, 83, ...
EXAMPLE
a(1) = 2, itself a prime;
a(2) = 2+3 = 5, itself a prime;
a(3) = 2+3*5 = 17, itself a prime;
a(4) = 2+3*5+7 = 24;
a(5) = 2+3*5+7*11 = 94;
a(15) = 2+3*5+7*11+13*17+19*23+29*31+37*41+43*47 = 5189, prime;
a(31) =
2+3*5+7*11+13*17+19*23+29*31+37*41+43*47+53*59+61*67+71*73+79*83+89*97+101*103+107*109+113*127 = 69193, which is prime.
MAPLE
A106215 := proc(n) if type(n, 'odd') then a := 2 ; for i from 2 to n by 2 do a := a+ithprime(i)*ithprime(i+1) ; end do: else a := 2 +ithprime(n); for i from 2 to n-1 by 2 do a := a+ithprime(i)*ithprime(i+1) ; end do: end if; a; end proc: # R. J. Mathar, Dec 22 2010
MATHEMATICA
a[1]=2; a[n_]:= If[EvenQ[n], a[n-1]+Prime[n], a[n-2]+Prime[n-1]*Prime[n]]; Table[a[n], {n, 39}] (* James C. McMahon, Jan 31 2024 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Jonathan Vos Post, Jul 12 2005
STATUS
approved