OFFSET
1,1
COMMENTS
Original definition: Write down the numbers from 3 to infinity. Take next number, M say, that has not been crossed off. Counting through the numbers that have not yet been crossed off after that M, cross off every 4th term. Repeat, always crossing off every 4th term of those that remain. The numbers that are left form the sequence.
LINKS
Robert Israel, Table of n, a(n) for n = 1..7987
Popular Computing (Calabasas, CA), Sieves: Problem 43, Vol. 2 (No. 13, Apr 1974), pp. 6-7. This is Sieve #6 with K=4. [Annotated and scanned copy]
FORMULA
a(1)=3, a(n+1) = a(n) + floor(a(n)/3). - Ben Paul Thurston, Jan 09 2008
MAPLE
R:= 3: x:= 3:
for i from 2 to 100 do x:= x + floor(x/3); R:= R, x od:
R; # Robert Israel, Sep 09 2024
MATHEMATICA
t = Range[3, 2500000]; r = {}; While[Length[t] > 0, AppendTo[r, First[t]]; t = Drop[t, {1, -1, 4}]; ]; r (* Ray Chandler, Dec 02 2004 *)
NestList[#+Floor[#/3]&, 3, 50] (* Harvey P. Dale, Jan 14 2019 *)
PROG
(PARI) a(n, s=3)=for(i=2, n, s+=s\3); s \\ M. F. Hasler, Oct 06 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Dec 01 2004
EXTENSIONS
More terms from Ray Chandler, Dec 02 2004
Simpler definition from M. F. Hasler, Oct 06 2014
STATUS
approved