OFFSET
0,4
COMMENTS
See A293390 for the corresponding m's.
LINKS
FORMULA
EXAMPLE
The first terms, alongside their binary expansions and the corresponding m's, are:
n a(n) bin(n) bin(a(n)) m
--- ---- ------- --------- -
0 0 0 0 0
1 1 1 1 1
2 1 10 1 1
3 3 11 11 2
4 1 100 1 1
5 5 101 101 3
6 3 110 11 2
7 7 111 111 3
8 1 1000 1 1
9 3 1001 11 2
10 3 1010 11 3
11 11 1011 1011 4
12 3 1100 11 2
13 13 1101 1101 4
14 7 1110 111 3
15 15 1111 1111 4
16 1 10000 1 1
PROG
(PARI) a(n) = { my (b=vector(hammingweight(n))); for (i=1, #b, n-=2^b[i]=valuation(n, 2); ); for (m=1, oo, if (#Set(b%m)==#b, b%=m; break; ); ); sum(i=1, #b, 2^b[i]); }
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Oct 16 2022
STATUS
approved