A207063 a(n) is the smallest number larger than a(n-1) with mutual Hamming distance 2 and a(1)=0.
0, 3, 5, 6, 10, 12, 15, 23, 27, 29, 30, 46, 54, 58, 60, 63, 95, 111, 119, 123, 125, 126, 190, 222, 238, 246, 250, 252, 255, 383, 447, 479, 495, 503, 507, 509, 510, 766, 894, 958, 990, 1006, 1014, 1018, 1020, 1023, 1535, 1791, 1919, 1983, 2015, 2031, 2039, 2043
Offset: 1
Examples
| n | a(n) | A007088(a(n))| A000120(a(n))| +---+------+--------------+--------------+ | 1 | 0 | 0 | 0 | | 2 | 3 | 11 | 2 | | 3 | 5 | 101 | 2 | | 4 | 6 | 110 | 2 | | 5 | 10 | 1010 | 2 | | 6 | 12 | 1100 | 2 | | 7 | 15 | 1111 | 4 | | 8 | 23 | 10111 | 4 |
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..20000
Crossrefs
Programs
-
Maple
g:= proc(n) option remember; local l; l:= g(n-1); `if`(nops(l)=1, [l[1]+1, l[1]-1], `if`(nops(l)=2, `if`(l[2]<>0, [l[1], l[2]-1], [l[1]+1, 0, l[1]-1]), `if`(l[3]<>1, [l[1], l[2], l[3]-1], [l[1]]))) end: g(1):= [2, 0, 1]: a:= n-> (l-> 2^l[1]-1 -add(2^l[i], i=2..nops(l)))(g(n)): seq(a(n), n=1..300);
-
Python
def aupton(terms): alst = [0] for n in range(2, terms+1): an = alst[-1] + 1 while bin(an^alst[-1]).count('1') != 2: an += 1 alst.append(an) return alst print(aupton(54)) # Michael S. Branicky, Jul 07 2021
Comments