OFFSET
0,2
COMMENTS
For any n >= 0:
- let s(n) be the unique finite set of nonnegative integers such that n = Sum_{e in s(n)} 2^e,
- then s(a(n)) corresponds to the set of nonnegative integers that are not the sum of two nonnegative integers not in s(n).
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..8192
FORMULA
a(2^n-1) = 4^n-1.
EXAMPLE
The first terms, alongside the corresponding sets, are:
n a(n) s(n) s(a(n))
-- ---- ------------ ------------------------
0 0 {} {}
1 3 {0} {0, 1}
2 2 {1} {1}
3 15 {0, 1} {0, 1, 2, 3}
4 0 {2} {}
5 11 {0, 2} {0, 1, 3}
6 6 {1, 2} {1, 2}
7 63 {0, 1, 2} {0, 1, 2, 3, 4, 5}
8 0 {3} {}
9 3 {0, 3} {0, 1}
10 10 {1, 3} {1, 3}
11 47 {0, 1, 3} {0, 1, 2, 3, 5}
12 8 {2, 3} {3}
13 27 {0, 2, 3} {0, 1, 3, 4}
14 14 {1, 2, 3} {1, 2, 3}
15 255 {0, 1, 2, 3} {0, 1, 2, 3, 4, 5, 6, 7}
PROG
(PARI) a(n) = { my (v=0); for (x=0, 2*#binary(n), my (f=0); for (y=0, x, if (!bittest(n, y) && !bittest(n, x-y), f=1; break)); if (!f, v+=2^x)); return (v) }
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Mar 17 2021
STATUS
approved