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