|
|
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
|
|
|
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"
(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
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|