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.

A346306 Position in A076478 of the binary complement of the n-th word in A076478.

This page as a plain text file.
%I A346306 #21 Mar 31 2023 18:33:59
%S A346306 2,1,6,5,4,3,14,13,12,11,10,9,8,7,30,29,28,27,26,25,24,23,22,21,20,19,
%T A346306 18,17,16,15,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,
%U A346306 43,42,41,40,39,38,37,36,35,34,33,32,31,126,125,124,123
%N A346306 Position in A076478 of the binary complement of the n-th word in A076478.
%C A346306 Permutation of the positive integers obtained by reversing their order within successive subsets of length 2, 4, 8, 16, ... - _Paolo Xausa_, Mar 09 2023
%H A346306 Michael S. Branicky, <a href="/A346306/b346306.txt">Table of n, a(n) for n = 1..16382</a> (for all words with length <= 13)
%H A346306 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F A346306 a(n) = 3*(2^d - 1) - n, where 2^d - 1 <= n <= 2^(d+1) - 2. - _Michael S. Branicky_, Sep 03 2021
%e A346306 The first fourteen words w(n) are 0, 1, 00, 01, 10, 11, 000, 001, 010, 011, 100, 101, 110, 111, so that a(3) = 6.
%e A346306 From _Paolo Xausa_, Mar 09 2023: (Start)
%e A346306 Written as an irregular triangle, where row r >= 1 has length 2^r and row sum is A103897(r), the sequence begins:
%e A346306    2,  1;
%e A346306    6,  5,  4,  3;
%e A346306   14, 13, 12, 11, 10,  9,  8,  7;
%e A346306   30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15;
%e A346306   ... (End)
%t A346306 (See A007931.)
%t A346306 A346306[rowmax_]:=Table[Range[2^(r+1)-2,2^r-1,-1],{r,rowmax}]; A346306[6] (* _Paolo Xausa_, Mar 09 2023 *)
%o A346306 (Python)
%o A346306 from itertools import product
%o A346306 def comp(s): z, o = ord('0'), ord('1'); return s.translate({z:o, o:z})
%o A346306 def wgen(maxdigits):
%o A346306     for digits in range(1, maxdigits+1):
%o A346306         for b in product("01", repeat=digits):
%o A346306             yield "".join(b)
%o A346306 def auptod(maxdigits):
%o A346306     w = [None] + [wn for wn in wgen(maxdigits)]
%o A346306     return [w.index(comp(w[n])) for n in range(1, 2**(maxdigits+1) - 1)]
%o A346306 print(auptod(6)) # _Michael S. Branicky_, Sep 03 2021
%Y A346306 Cf. A007931, A076478, A103897, A171757, A346303, A346304.
%K A346306 nonn,tabf,base
%O A346306 1,1
%A A346306 _Clark Kimberling_, Aug 16 2021