login
A291633
Numbers k such that it is possible to form a palindrome by concatenating all the binary strings from 1 to k.
3
1, 2, 3, 11, 20, 22, 42, 43, 82, 162, 171, 322, 340, 342, 642, 682, 683, 1282, 1362, 2562, 2722, 2731
OFFSET
1,2
COMMENTS
Numbers that are not in the sequence include: 4, 6, 16, 18, 28, 30, 64, 66, 76, 78, 84, 86, 88, 90, ... as the total number of '0's and the total number of '1's in the binary expansion of 1 through k are both odd and thus cannot form a palindrome. - Chai Wah Wu, Jan 22 2018
From Tyler Busby, Feb 02 2023: (Start)
Concatenating the binary strings from 1 to n will always result in the same distribution of runs of consecutive '0's in the full string, regardless of ordering, as there are no leading zeros.
A palindrome of this form must have either an even number of zero groupings of each size, or an even number of groupings of all but one size (see A360320). The binary string corresponding to the highest power of two in the set will contain the largest '0' run. Thus, the highest power of two in the set, if it exists, must have its '0' grouping in the center of the palindrome.
With that center, k must have an even total number of '1's. These conditions leave prospective terms: 1, 2, 3, 11, 20, 22, 42, 43, 82, 162, 171, 322, 340, 342, 642, 682, 683, ..., with example palindromes up to 171 found.
(End)
EXAMPLE
Here are the first few solutions:
k=1: 1
k=2: 1|0|.1
k=3: 1.1|0|.11
k=11: 1010.1.1011.11.100.10|0|0.1001.111.10.110.101
k=20: 1101.10011.100.10100.111.1.1011.10001.1010.100|
00.10.101.1000.1110.1111.10010.1001.1100.110.11
k=22: 1000.1100.110.10100.10011.11.1010.1101.1011.1110.100|
00.10.1111.10110.1.10101.111.100.10010.101.1001.10001
CROSSREFS
KEYWORD
nonn,base,more,hard
AUTHOR
Dmitry Kamenetsky, Sep 11 2017
EXTENSIONS
a(7)-a(11) from Tyler Busby, Feb 02 2023
a(12)-a(22) from Max Alekseyev, Mar 30 2023
STATUS
approved