cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A100617 There are n people in a room. The first half (i.e., floor(n/2)) of them leave, then 1/3 (i.e., floor of 1/3) of those remaining leave, then 1/4, then 1/5, etc.; sequence gives number who remain at the end.

Original entry on oeis.org

1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11
Offset: 1

Views

Author

N. J. A. Sloane, Dec 03 2004

Keywords

Examples

			7 -> 7 - [7/2] = 7 - 3 = 4 -> 4 - [4/3] = 4 - 1 = 3 -> 3 - [3/4] = 3 - 0 = 3, which is now fixed, so a(7) = 3.
		

References

  • V. Brun, Un procédé qui ressemble au crible d'Ératosthène, Analele Stiintifice Univ. "Al. I. Cuza", Iasi, Romania, Sect. Ia Matematica, 1965, vol. 11B, pp. 47-53.

Crossrefs

Least monotonic left inverse of A000960, partial sums of A278169.
Cf. A100618.
Cf. A056526 (run lengths).

Programs

  • Haskell
    a100617 = f 2 where
       f k x = if x' == 0 then x else f (k + 1) (x - x') where x' = div x k
    -- Reinhard Zumkeller, Jul 01 2013, Sep 15 2011
    
  • Maple
    f:=proc(n) local i,j,k; k:=n; for i from 2 to 10000 do j := floor(k/i); if j < 1 then break; fi; k := k-j; od; k; end;
  • Mathematica
    a[n_] := (k = 2; FixedPoint[# - Floor[# / k++]&, n]); Table[a[n], {n, 1, 96}] (* Jean-François Alcover, Nov 15 2011 *)
  • Scheme
    ;; With my IntSeq-library.
    (define A100617 (LEFTINV-LEASTMONO 1 1 A000960))
    ;; Antti Karttunen, Nov 23 2016

Formula

a(n) = k for Fl(k) <= n < Fl(k+1), where Fl(i) = A000960(i).
For all n >= 1, a(A000960(n)) = n. [From above.] - Antti Karttunen, Nov 23 2016