The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A242261 Lexicographically last sequence such that every odd prime is the sum of at least two terms of the sequence. 0
1, 2, 4, 10, 18, 36, 72, 148, 156, 312, 456, 1068, 2136, 2436, 6552, 12036, 17976, 29400, 46308, 93228, 119736, 200928, 509556, 911412, 1351812, 2665080, 3978348, 7988688, 17315172, 18646416 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
Every term is 1 less than a prime.
LINKS
EXAMPLE
3 could be represented by 1+2 or 0+3, but 1,2 is lexicographically later than 0,3; so the sequence starts with 1,2.
Once 4 is added to sequence for 1+4 = 5, 7 = 1+2+4 is already a sum. So the next thing we need to add is 10 for 1+10=11.
PROG
(PARI) issum(v, k, tot, n)={if(n>=tot, n==tot,
n==0||(n>=v[k]&&issum(v, k-1, tot-v[k], n-v[k]))||issum(v, k-1, tot-v[k], n))}
al(n) = {local(r=vector(n), k=1, p=3, tot=1); r[1]=1;
while(k<n, if(!issum(r, k, tot, p), tot+=r[k++]=p-1); p=nextprime(p+1));
r}
CROSSREFS
Sequence in context: A320098 A320968 A279359 * A189892 A240877 A218008
KEYWORD
nonn
AUTHOR
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 17 19:53 EDT 2024. Contains 372607 sequences. (Running on oeis4.)