OFFSET
1,2
COMMENTS
Following the notation in Gruber/Holzer (2021), for n >= 1 and 1 <= k <= 2^n, let P'_{n,k} denote the set containing the lexicographically first k palindromes of odd length 2n-1 over the binary alphabet {a,b}. T(n,k) is the minimum number of alphabetic symbols in any regular expression describing the set P'_{n,k}.
LINKS
Hermann Gruber and Markus Holzer, Optimal Regular Expressions for Palindromes of Given Length, Proceedings of the 46th International Symposium on Mathematical Foundations of Computer Science, Article No. 53, pp. 53:1-53:15, 2021.
FORMULA
T(n,k) = 2*n + 3*(k-1) - 2*hamming_weight(k-1)-1. See theorem 20 in Gruber/Holzer (2021).
EXAMPLE
Triangle T(n,k) begins:
1, 2;
3, 4, 7, 8;
5, 6, 9, 10, 15, 16, 19, 20;
7, 8, 11, 12, 17, 18, 21, 22, 29, 30, 33, 34, 39, 40, 43, 44;
...
MATHEMATICA
Flatten[Table[2n+3(k-1)-2Total[IntegerDigits[k-1, 2]]-1, {n, 6}, {k, 2^n}]] (* Stefano Spezia, Feb 13 2022 *)
PROG
(PARI) T(n, k) = 2*n + 3*(k-1) - 2*hammingweight(k-1) - 1 \\ Andrew Howroyd, Feb 12 2022
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Hermann Gruber, Feb 12 2022
STATUS
approved