OFFSET
1,2
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
S:= [$2..300]:
s:= 1: R:= 1:
for i from 2 do
target:= isprime(i);
found:= false;
for j from 1 to nops(S) while not found do
if isprime(s+S[j]) = target then
found:= true;
s:= s+S[j];
if S[j] = i then R:= R, i fi;
S:= subsop(j=NULL, S);
fi
od;
if not found then break fi;
od:
R; # Robert Israel, Oct 07 2024
MATHEMATICA
For[n=1; s={}; sum=0, n<=300, n++, For[v=1, MemberQ[s, v]||Xor[PrimeQ[n], PrimeQ[sum+v]], v++, Null]; sum+=v; AppendTo[s, a[n]=v]]; Select[Range[300], a[ # ]==#&]
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Aug 17 2002
EXTENSIONS
Edited by Dean Hickerson, Oct 22 2002
STATUS
approved