OFFSET
1,1
EXAMPLE
5 is a term because 2 + 3 + 5 = 10.
23 is a term because 2 + 3 + 5 + 7 + 11 + 13 + 17 + 19 + 23 = 100.
53 is a term because 47 + 53 = 100.
And all the primes summed from 4999 up to including 6491 equal to 1000000.
PROG
(PARI)
scan(plim, tot)={my(s=0, q=0, L=List()); forprime(p=2, min(plim, tot), s+=p; while(s>tot, q=nextprime(q+1); s-=q); if(s==tot, listput(L, p))); Vec(L)}
upto(lim)={my(m=10, ub=0, r=[]); forprime(p=3, lim, ub+=p); while(m<ub, r = concat(r, scan(lim, m)); m*=10); Set(r)} \\ Andrew Howroyd, Jan 28 2026
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Leo Hennig, Jan 23 2026
EXTENSIONS
a(5)-a(7) from Andrew Howroyd, Jan 23 2026
STATUS
approved
