OFFSET
0,2
COMMENTS
Analogous to A351489 (which is the corresponding sequence for palindromes over binary alphabet).
REFERENCES
Hermann Gruber and Markus Holzer, Optimal Regular Expressions for Palindromes of Given Length. Extended journal version, in preparation, 2022.
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
Let SumOfDigitsInBase(m,b) denote the digit sum of nonnegative integer m in base b. Then the general formula for alphabet size q reads as
T(n,k) = 2*n + (2*q*(k-1))/(q-1) - (2*SumOfDigitsInBase(k-1,q))/(q-1). [Gruber and Holzer 2022 theorem 27]
EXAMPLE
Triangle T(n,k) begins:
k=1 2 3 4 5 6 ...
n=0: 0,
n=1: 2, 4, 6;
n=2: 4, 6, 8, 12, 14, 16, 20, 22, 24;
n=3: 6, 8, 10, 14, 16, 20, 22, 24, 26, 32, 34, 36, 40, 42, 44, 48, 50, 52, 58, 60, 62, 66, 68, 70, 74, 76, 78;
...
CROSSREFS
KEYWORD
nonn,easy,tabf
AUTHOR
Hermann Gruber, Feb 13 2022
STATUS
approved