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!)
A005209 Multilevel sieve: at k-th step, accept k numbers, reject k, accept k, ...
(Formerly M2792)
4
1, 3, 9, 25, 57, 145, 337, 793, 1921, 3849, 8835, 18889, 41473, 92305, 203211, 432699, 944313, 2027529, 4077769, 8745153, 18133305, 37898113, 80713737, 169730259, 358760457, 750591867, 1575313473, 3255787851, 6751959507, 14108682265, 29364255033, 61173205587 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
Start with the natural numbers. For k=1,2,3,... successively do the following: accept k numbers, reject k numbers, accept k numbers, repeat indefinitely.
REFERENCES
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
N. J. A. Sloane, Table of n, a(n) for n = 1..1000 [Computed using Tom Duff's bc program]
Popular Computing (Calabasas, CA), Contest 7 Results (based on solution from Tom Duff and Hugh Redelmeier), Vol. 4 (No. 43, Oct 1976), pp. 14-16. [Annotated scanned copy]
PROG
(bc)
for(k=1; k<=100; k++){
n=k;
for(i=k-1; i>=1; --i) n=2*n-((n-1)%i)-1;
print k, " ", n, "\n"
} /* Tom Duff, Apr 24 2015 */
(Python)
from itertools import count, islice
def agen(): # generator of terms
for k in count(1):
n = k
for i in range(k-1, 0, -1): n = 2*n-((n-1)%i)-1
yield n
print(list(islice(agen(), 32))) # Michael S. Branicky, Aug 06 2022 after Tom Duff
CROSSREFS
Sequence in context: A204448 A032681 A293852 * A112522 A005262 A101357
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 April 28 06:27 EDT 2024. Contains 372020 sequences. (Running on oeis4.)