OFFSET
0,2
COMMENTS
LINKS
Philippe Beaudoin, Table of n, a(n) for n = 0..132
PROG
(PARI) a055941(n) = {my(b=binary(n)); nb = 0; for (i=1, #b-1, if (b[i], nb += sum(j=i+1, #b, !b[j])); ); nb; }
lista(nn) = {vmax = 0; print1(vmax, ", "); for (n=1, nn, vnew = a055941(n); if (vnew > vmax, vmax = vnew; print1(n, ", "); ); ); } \\ Michel Marcus, Aug 29 2014
(Python)
A243112, a = [0], 0
for n in range(1, 2**30):
s = bin(n)[2:]
b = sum(s[i:].count('0') for i, d in enumerate(s, start=1) if d == '1')
if b > a:
A243112.append(n)
a = b # Chai Wah Wu, Sep 07 2014
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Philippe Beaudoin, Aug 20 2014
STATUS
approved