OFFSET
1,1
COMMENTS
FORMULA
EXAMPLE
The first terms, in decimal and in binary, are:
n a(n) bin(n) bin(a(n))
-- ---- ------ ---------
1 2 1 10
2 3 10 11
3 4 11 100
4 6 100 110
5 9 101 1001
6 7 110 111
7 8 111 1000
8 12 1000 1100
9 10 1001 1010
10 11 1010 1011
11 13 1011 1101
12 14 1100 1110
13 17 1101 10001
14 15 1110 1111
15 16 1111 10000
16 24 10000 11000
PROG
(PARI) r1(n) = my (c=0); while (n, my (v=valuation(n+(n%2), 2)); if (n%2, c++); n\=2^v); c
a(n) = my (r=r1(n)); for (k=n+1, oo, if (r==r1(k), return (k)))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Feb 15 2019
STATUS
approved