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.

A343332 a(1) = 0; thereafter a(n+1) = floor((a(n)+y)/2), where y is the number of numbers m < n such that a(m) = a(n).

Original entry on oeis.org

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

Views

Author

Pontus von Brömssen, Apr 12 2021

Keywords

Comments

Variant of A340488, with XOR(a,y) replaced by floor((a+y)/2).
Every number appears, and their first occurrences are in increasing order.
Apparently, a(n) <= A343333(n) for all n.

Crossrefs

Programs

  • Python
    def A343332_list(n_max):
      a=0
      a_list=[0]
      count=[]
      for i in range(n_max-1):
        if a==len(count): count.append(0)
        else: count[a]+=1
        a=(a+count[a])//2
        a_list.append(a)
      return a_list

A343334 a(1) = 0; thereafter a(n+1) = abs(a(n)-y), where y is the number of numbers m < n such that a(m) = a(n).

Original entry on oeis.org

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

Views

Author

Pontus von Brömssen, Apr 12 2021

Keywords

Comments

Variant of A340488, with XOR(a,y) replaced by abs(a-y).
Every number appears, and their first occurrences are in increasing order.
Let N_k(n) denote the number of occurrences of k among the first n terms. It appears that N_0(n) ~ sqrt(n/2) and N_k(n) ~ sqrt(2*n) for k > 0.

Crossrefs

Programs

  • Python
    def A343334_list(n_max):
      a=0
      a_list=[0]
      count=[]
      for i in range(n_max-1):
        if a==len(count): count.append(0)
        else: count[a]+=1
        a=abs(a-count[a])
        a_list.append(a)
      return a_list
Showing 1-2 of 2 results.