OFFSET
0,2
COMMENTS
a(n) counts Abelian squares of length 2n over a 10-letter alphabet (strings xx' where x' is a permutation of x); i.e., f_{10}(n) in the notation of Richmond and Shallit (2008).
Consider all integers from 0 to 10^(2n)-1, written with leading zeros to pad to exactly 2n digits.
a(n) counts how many of these have the property that their second n digits are a rearrangement of their first n digits.
LINKS
Jonathan M. Borwein, Dirk Nuyens, Armin Straub and James Wan, Some Arithmetic Properties of Short Random Walk Integrals, preprint, FPSAC 2010, San Francisco, USA.
Jean-Francois Im, Palindromes and Anagrams in TOTP Codes.
Jean-Francois Im, Generalizing TOTP Anagram Counting for Different Bases.
Jean-Francois Im, Python program
L. Bruce Richmond and Jeffrey Shallit, Counting Abelian Squares, arXiv:0807.5028 [math.CO], 2008.
FORMULA
a(n) = (n!)^2 [x^n] hypergeom([], [1], x)^10.
a(n) = A287316(n, 10).
EXAMPLE
For n=1 (2-digit strings), the 10 matches are 00, 11, 22, 33, 44, 55, 66, 77, 88, 99.
For n=2 (4-digit strings), the 190 matches include 0000, 0101, 0110, 0202, 0220.
For n=3 (6-digit strings), the 5140 matches include 000000, 111111, (1 unique digit in the first half), 001001, 001010, 001100 (2 unique digits in the first half), 012012, 012021, 012120, etc. for 3 unique digits in the first half.
PROG
(Python) # See Links
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Jean-Francois Im, Apr 08 2026
STATUS
approved
