login
A391433
a(n) is the greatest prime that starts a sequence of two or more consecutive primes whose sum is A050936(n).
2
2, 3, 2, 5, 3, 2, 7, 5, 11, 3, 2, 13, 7, 17, 3, 11, 19, 7, 13, 23, 5, 3, 2, 17, 29, 7, 31, 19, 13, 3, 2, 37, 23, 41, 17, 43, 5, 29, 3, 47, 13, 19, 31, 53, 17, 59, 37, 5, 3, 61, 2, 41, 13, 67, 19, 43, 71, 7, 73, 5, 17, 3, 47, 2, 23, 79, 37, 13, 83, 53, 19, 29, 41, 89, 59, 5, 3, 17, 97, 61, 43, 101
OFFSET
1,1
LINKS
EXAMPLE
a(14) = 17 because A050936(14) = 36 is the sum of two or more consecutive primes in two ways, 17 + 19 and 5 + 7 + 11 + 13, and 17 is the greatest starting prime of these.
MAPLE
N:= 1000: # for terms of A050936 up to N
P:= select(isprime, [2, seq(i, i=3..N, 2)]):
SP:= ListTools:-PartialSums([0, op(P)]): nSP:= nops(SP):
S:= {}:
for i from nSP-2 to 1 by -1 do
for j from i+2 to nSP do
s:= SP[j]-SP[i];
if s > N then break fi;
if not member(s, S) then
S:= S union {s};
R[s]:= P[i];
fi
od od:
S:= sort(convert(S, list)):
[seq(R[S[i]], i=1..nops(S))];
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Will Gosnell and Robert Israel, Dec 09 2025
STATUS
approved