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.

A207063 a(n) is the smallest number larger than a(n-1) with mutual Hamming distance 2 and a(1)=0.

This page as a plain text file.
%I A207063 #36 Jul 07 2021 11:25:49
%S A207063 0,3,5,6,10,12,15,23,27,29,30,46,54,58,60,63,95,111,119,123,125,126,
%T A207063 190,222,238,246,250,252,255,383,447,479,495,503,507,509,510,766,894,
%U A207063 958,990,1006,1014,1018,1020,1023,1535,1791,1919,1983,2015,2031,2039,2043
%N A207063 a(n) is the smallest number larger than a(n-1) with mutual Hamming distance 2 and a(1)=0.
%C A207063 The binary expansion of a(n) has an even number of 1's. So this is a subsequence of A001969. The odd analog is A206853.
%C A207063 This sequence has 4*k+1 = A016813(k) numbers with exactly 2*k 1's and no number with more than two 0's in their binary expansion.
%H A207063 Alois P. Heinz, <a href="/A207063/b207063.txt">Table of n, a(n) for n = 1..20000</a>
%e A207063 | n | a(n) | A007088(a(n))| A000120(a(n))|
%e A207063 +---+------+--------------+--------------+
%e A207063 | 1 |   0  |         0    |       0      |
%e A207063 | 2 |   3  |        11    |       2      |
%e A207063 | 3 |   5  |       101    |       2      |
%e A207063 | 4 |   6  |       110    |       2      |
%e A207063 | 5 |  10  |      1010    |       2      |
%e A207063 | 6 |  12  |      1100    |       2      |
%e A207063 | 7 |  15  |      1111    |       4      |
%e A207063 | 8 |  23  |     10111    |       4      |
%p A207063 g:= proc(n) option remember; local l; l:= g(n-1);
%p A207063       `if`(nops(l)=1, [l[1]+1, l[1]-1], `if`(nops(l)=2,
%p A207063       `if`(l[2]<>0, [l[1], l[2]-1], [l[1]+1, 0, l[1]-1]),
%p A207063       `if`(l[3]<>1, [l[1], l[2], l[3]-1], [l[1]])))
%p A207063     end: g(1):= [2, 0, 1]:
%p A207063 a:= n-> (l-> 2^l[1]-1 -add(2^l[i], i=2..nops(l)))(g(n)):
%p A207063 seq(a(n), n=1..300);
%o A207063 (Python)
%o A207063 def aupton(terms):
%o A207063     alst = [0]
%o A207063     for n in range(2, terms+1):
%o A207063         an = alst[-1] + 1
%o A207063         while bin(an^alst[-1]).count('1') != 2:  an += 1
%o A207063         alst.append(an)
%o A207063     return alst
%o A207063 print(aupton(54)) # _Michael S. Branicky_, Jul 07 2021
%Y A207063 Cf. A182187 (next with Hamming distance 2), A206853 (iterate from 1).
%Y A207063 Cf. A000120, A001969, A007088, A016813.
%K A207063 nonn,base
%O A207063 1,2
%A A207063 _Alois P. Heinz_, Feb 14 2012