login
A106215
The first n primes, connected by, from left to right, alternating + and * signs.
1
2, 5, 17, 24, 94, 107, 315, 334, 752, 781, 1651, 1688, 3168, 3211, 5189, 5242, 8316, 8377, 12403, 12474, 17586, 17665, 24143, 24232, 32776, 32877, 43179, 43286, 54842, 54955, 69193, 69324, 87140, 87279, 107851, 108002, 131558, 131721, 158779
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
Sequence in context: A176582 A023867 A024594 * A211548 A277208 A243183
KEYWORD
easy,nonn
AUTHOR
Jonathan Vos Post, Jul 12 2005
STATUS
approved