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.

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).

This page as a plain text file.
%I A343332 #14 Apr 16 2021 00:02:56
%S A343332 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,
%T A343332 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,
%U A343332 6,6,6,7,6,7,7,7,8,4,8,4,8,5,8,5,8,6,8
%N 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).
%C A343332 Variant of A340488, with XOR(a,y) replaced by floor((a+y)/2).
%C A343332 Every number appears, and their first occurrences are in increasing order.
%C A343332 Apparently, a(n) <= A343333(n) for all n.
%H A343332 Pontus von Brömssen, <a href="/A343332/b343332.txt">Table of n, a(n) for n = 1..10000</a>
%o A343332 (Python)
%o A343332 def A343332_list(n_max):
%o A343332   a=0
%o A343332   a_list=[0]
%o A343332   count=[]
%o A343332   for i in range(n_max-1):
%o A343332     if a==len(count): count.append(0)
%o A343332     else: count[a]+=1
%o A343332     a=(a+count[a])//2
%o A343332     a_list.append(a)
%o A343332   return a_list
%Y A343332 Cf. A340488, A343333, A343334.
%K A343332 nonn,look
%O A343332 1,9
%A A343332 _Pontus von Brömssen_, Apr 12 2021