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.

A268696 a(1)=1; thereafter a(n+1) = floor(m/2), where m = number of occurrences of a(n) in [a(1),...,a(n)].

Original entry on oeis.org

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

Views

Author

David Seelmann, Feb 11 2016

Keywords

Comments

It appears that a(n) <= ceiling(sqrt(n)).
Comments from N. J. A. Sloane, Feb 12 2016: (Start)
In fact it appears that a(n) <= floor(sqrt(n)) except when n belongs to the sequence S := [99, 120, 142, 167, 193, 222, 252, 285, 319, ...], which has second differences 1,3,1,3,1,3,... and is the sequence {99; A035608(k)+21*k+120, k>=0}. For these values of n it appears that a(n) = ceiling(sqrt(n)). The first example is a(99) = 10 = ceiling(sqrt(99)).
The zeros occur at positions [2, 3, 8, 13, 19, 28, 38, 51, 65, 82, 100, 121, 143, 168, 194, 223, 253, 286, 320, ...], which apart from the initial terms appears to be S+1.
Without the division by 2 in the definition (that is, if a(n+1)=m), we get A158416. (End)

Examples

			a(2) is equal to the number of times a(1) = 1 appears in the sequence before, divided by two, rounding down. Since 1 appears once before, a(2) = floor(1/2) = 0.
a(3) is  equal to the number of times 0 appears in the sequence before, which is again once, divided by two, rounding down. So a(3) = floor(1/2) = 0.
a(4) is the number of times 0 appears before (twice) divided by two, which gives us 1.
		

Crossrefs

Programs

  • Mathematica
    a = {1}; Do[AppendTo[a, Floor[Count[a, n_ /; n == a[[k - 1]]]/2]], {k, 2, 120}]; a (* Michael De Vlieger, Feb 11 2016 *)

Extensions

More terms from Michael De Vlieger, Feb 11 2016