OFFSET
1,2
COMMENTS
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..20000
EXAMPLE
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);
PROG
(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
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Alois P. Heinz, Feb 14 2012
STATUS
approved