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.

Showing 1-2 of 2 results.

A056526 First differences of Flavius Josephus's sieve.

Original entry on oeis.org

2, 4, 6, 6, 8, 12, 10, 14, 16, 12, 18, 24, 14, 34, 26, 16, 30, 36, 18, 42, 38, 12, 60, 22, 48, 38, 46, 36, 60, 54, 44, 36, 84, 22, 60, 84, 18, 78, 72, 60, 38, 112, 12, 96, 114, 26, 88, 92, 34, 90, 138, 26, 82, 98, 112, 54, 170, 36, 60, 168, 52, 128, 52, 128, 94, 108, 90, 188
Offset: 1

Views

Author

Henry Bottomley, Jun 16 2000

Keywords

Comments

Also run lengths in A100617. - Reinhard Zumkeller, Jan 14 2015

Examples

			Flavius's sieve starts 1,3,7,13,19,27,39,49 so first differences are 2,4,6,6,8,12,10.
		

Crossrefs

Cf. A000960 for definition, A139363 (records), A139364 (where records occur).

Programs

  • Haskell
    a056526 n = a056526_list !! (n-1)
    a056526_list = zipWith (-) (tail a000960_list) a000960_list
    -- Reinhard Zumkeller, Jan 14 2015

Formula

a(n) = A000960(n+1) - A000960(n).

A100618 Initially there are n people in a room. At each step, if there are currently M people in the room, [M/k^2] of them leave, for k = 2, 3, ... Sequence gives number who are left at the end.

Original entry on oeis.org

1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 8, 8, 9, 10, 11, 11, 12, 13, 14, 14, 15, 15, 15, 15, 16, 17, 18, 18, 19, 20, 21, 21, 22, 23, 23, 23, 24, 24, 25, 25, 26, 27, 28, 28, 29, 29, 29, 29, 30, 31, 32, 32, 33, 34, 35, 35, 35, 36, 36, 36, 37, 38, 39, 39, 40, 41, 42, 42, 43, 43, 43, 43, 44, 45, 46, 46
Offset: 1

Views

Author

N. J. A. Sloane, Dec 03 2004

Keywords

Comments

If [M/k^2] is changed to [M/k] we get A100617.

Examples

			10 -> 10 - [10/4] = 8 -> 8 - [8/9] = 8, which is now fixed, so a(10) = 8.
		

Crossrefs

Cf. A250007 (run lengths).

Programs

  • Haskell
    a100618 n = f 2 n where
       f k n | n' == 0   = n
             | otherwise = f (k+1) (n-n') where n' = div n (k^2)
    -- Reinhard Zumkeller, Sep 15 2011
  • Maple
    f:=proc(n) local i,j,k; k:=n; for i from 2 to 10000 do j := floor(k/(i^2)); if j < 1 then break; fi; k := k-j; od; k; end;
  • Mathematica
    a[n_] := (k = 2; FixedPoint[# - Floor[#/(k++)^2]&, n]); Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Feb 10 2018 *)
Showing 1-2 of 2 results.