login
A356365
For any nonnegative integer n with binary expansion Sum_{k = 1..w} 2^e_k, let m be the least integer such that the values e_k mod m are all distinct; a(n) = Sum_{k = 1..w} 2^(e_k mod m).
1
0, 1, 1, 3, 1, 5, 3, 7, 1, 3, 3, 11, 3, 13, 7, 15, 1, 3, 3, 19, 6, 7, 7, 23, 3, 25, 11, 27, 7, 29, 15, 31, 1, 3, 6, 7, 3, 7, 7, 39, 5, 11, 7, 43, 14, 15, 15, 47, 3, 7, 19, 51, 7, 53, 23, 55, 7, 57, 27, 59, 15, 61, 31, 63, 1, 5, 3, 7, 5, 7, 7, 71, 3, 13, 14, 15
OFFSET
0,4
COMMENTS
See A293390 for the corresponding m's.
FORMULA
A000120(a(n)) = A000120(n).
a(n) = 1 iff n is a power of 2.
a(2^k - 1) = 2^k - 1 for any k >= 0.
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