login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A076975
a(1) = 1, a(2n) = smallest composite number > (2n-1)-th partial sum of the sequence itself and a(2n+1) = smallest prime > 2n-th partial sum of the sequence.
1
1, 4, 7, 14, 29, 56, 113, 225, 457, 908, 1823, 3638, 7283, 14559, 29123, 58241, 116483, 232965, 465931, 931861, 1863731, 3727453, 7454933, 14909839, 29819701, 59639379, 119278801, 238557559, 477115271, 954230389, 1908460819, 3816921597
OFFSET
1,2
PROG
(PARI) print1(1, ", "); s=1; for(i=2, 100, n=s+1; if(i%2==0, while( isprime(n), n++), while(!isprime(n), n++)); s+=n; print1(n, ", ")) - Lambert Herrgesell (zero815(AT)googlemail.com), Mar 09 2006
CROSSREFS
Cf. A076974.
Sequence in context: A305124 A094968 A049946 * A050343 A245002 A199628
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Oct 23 2002
EXTENSIONS
More terms from Lambert Herrgesell (zero815(AT)googlemail.com), Mar 09 2006
STATUS
approved