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-3 of 3 results.

A293168 Partial sums of A054868.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 13, 14, 16, 18, 19, 20, 21, 22, 24, 25, 27, 29, 30, 31, 33, 35, 36, 38, 39, 40, 42, 43, 44, 45, 47, 48, 50, 52, 53, 54, 56, 58, 59, 61, 62, 63, 65, 66, 68, 70, 71, 73, 74, 75, 77, 79, 80, 81, 83, 84, 86, 88, 90, 91, 92, 93, 95, 96, 98, 100, 101, 102, 104, 106
Offset: 0

Views

Author

N. J. A. Sloane, Oct 17 2017

Keywords

Crossrefs

This is the next term in the sequence A000120, A000788, A054868.

Programs

  • Mathematica
    Accumulate[Table[DigitCount[DigitCount[n, 2, 1], 2, 1], {n, 0, 100}]] (* Amiram Eldar, Jul 20 2023 *)

A291317 A variation of the Josephus problem: a(n) is the surviving integer under the following elimination process. Arrange 1,2,3,...,n in a circle, increasing clockwise. Starting with i=1, at k-th stage, move k places clockwise and delete the current number.

Original entry on oeis.org

1, 1, 1, 3, 4, 3, 7, 7, 6, 10, 7, 12, 3, 10, 11, 7, 11, 1, 12, 6, 21, 1, 7, 12, 25, 3, 25, 28, 16, 26, 25, 6, 32, 19, 15, 21, 28, 3, 12, 21, 24, 13, 21, 36, 17, 45, 41, 45, 8, 40, 11, 6, 25, 41, 23, 4, 43, 52, 51, 57, 28, 21, 11, 47, 26, 29, 57, 51, 48, 56, 12
Offset: 1

Views

Author

Rémy Sigrist, Aug 22 2017

Keywords

Comments

In the classical Josephus problem (A006257), one moves one place clockwise at each stage, and in the A054995 version, one moves two places clockwise at each stage; here, on the other hand, the number of moves is progressive, and the resulting sequence seems random.
No term belongs to A000096 (for the same reason that there are no even positive terms in A006257).
See also A128982 for another variation of the Josephus problem.
a(n) = 1 for n = 1, 2, 3, 18, 22, 171, 195, 234, 1262, 2136, ...
a(n) = n for n = 1, 7, 10, 12, 21, 25, 28, 235, 822, ...
More formally, for any function f over the natural numbers, let us define the function j_f with these rules: for any n > 0:
- let L = (1, 2, ..., n) be the list of the first n natural numbers,
- for k = 1 to n-1:
- for i = 1 to f(k): move the first element of L to the end,
- after these moves, discard the first element of L,
- j_f(n) = the remaining element in L.
In particular:
- and j_A000027 = a (this sequence),
- see also Links section for the scatterplots of j_f for certain classical or basic functions f.
We have the following properties:
- j_f(1) = 1,
- if f(1) = 1 mod 2 then j_f(2) = 1 else j_f(2) = 2,
- j_f(n) never equals k + Sum_{i=1..k} f(i),
- iterating j_f(n), j_f(j_f(n)), ... eventually leads to a fixed point,
- likely j_f = j_g iff f = g.

Examples

			The different stages for n=6 are (where ^ indicates the counting reference position):
- stage 1:  1^ 2  3  4  5  6
- stage 2:  1     3^ 4  5  6
- stage 3:  1     3  4     6^
- stage 4:  1     3        6^
- stage 5:        3^       6
- stage 6:        3^
Hence, a(6) = 3.
		

Crossrefs

Programs

  • PARI
    a(n) = my (l = List(vector(n,i,i)), i = 0); for (k = 1, n-1, i += k; my (p = i \ #l); listpop(l, 1 + (i % #l)); i -= p); return (l[1])

A089224 In binary representation: number of zeros of number of zeros of n.

Original entry on oeis.org

0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 2, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 2, 2, 0, 2, 0, 0, 1, 2, 0, 0, 1, 0, 1, 1, 0, 2, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 2, 1, 2, 2, 0, 1, 2, 2, 0, 2, 0, 0, 1, 1, 2, 2, 0, 2, 0, 0, 1, 2, 0, 0, 1, 0, 1, 1, 0, 1, 2, 2, 0, 2, 0
Offset: 0

Views

Author

Reinhard Zumkeller, Dec 10 2003

Keywords

Examples

			a(0) = 0; a(1) = 1; a(16) = 2; a(256) = 3; a(65536) = 4.
		

Crossrefs

Programs

  • Haskell
    a089224 = a023416 . a023416  -- Reinhard Zumkeller, Mar 31 2015
    
  • Maple
    a:= n-> (z-> z(z(n)))(k-> `if`(k=0, 1, add(1-i, i=Bits[Split](k)))):
    seq(a(n), n=0..100);  # Alois P. Heinz, Jul 04 2022
  • Mathematica
    a[n_] := DigitCount[DigitCount[n, 2, 0], 2, 0]; Array[a, 100, 0] (* Amiram Eldar, Jul 24 2023 *)
  • Python
    def a(n): return bin(bin(n)[2:].count("0"))[2:].count("0")
    print([a(n) for n in range(102)]) # Michael S. Branicky, Jul 04 2022

Formula

a(n) = A023416(A023416(n)).
Showing 1-3 of 3 results.