OFFSET
1,3
COMMENTS
Visually, if we consider a row of bricks of widths r_1, ..., r_k (in that order) above a row of widths r_k, ..., r_1 (in that order), we never have 4 bricks whose corners meet.
There are A108411(k) terms with k binary digits (ignoring leading zeros).
LINKS
EXAMPLE
The binary expansion of 35 is "100011", the corresponding run lengths are (1, 3, 2); the sums 1, 1+3 are distinct from the sums 3+2, 2, so 35 is a term. Visually, if we consider a row of bricks of widths 1, 3, 2 (in that order) above a row of widths 2, 3, 1 (in that order), we never have 4 bricks whose corners meet:
.-.-----.---.
| | | |
.-.-.---.-.-.
| | | |
.---.-----.-.
PROG
(PARI) toruns(n) = { my (r = []); while (n, my (v = valuation(n+n%2, 2)); n \= 2^v; r = concat(v, r)); r }
is(n) = { if (n, my (r = toruns(n)); setintersect(vector(#r, k, vecsum(r[1..k])), vector(#r, k, vecsum(r[#r+1-k..#r])))==[vecsum(r)], 1); }
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Sep 22 2024
STATUS
approved