OFFSET
1,2
COMMENTS
A108571 is a list of all such strings with at most 9 distinct letters, using 1, 2, ..., 9 as the letters, hence that sequence has length a(9)=66712890763701234740813164553708284.
a(n) is the number of positive integers such that, in base n + 1, every digit d that appears occurs exactly d times. - Felix Huber, Jan 13 2026
LINKS
Felix Huber, Table of n, a(n) for n = 1..36 (First 23 terms from Robin Jones)
FORMULA
a(n) = Sum_{X a non-empty subset of {1, ..., n}} ((Sum_{x in X} x)! / Product_{x in X} (x!)).
a(n) = Sum_{i>=1} i! * [x^i] Product_{k=1..n} (1 + x^k/k!). - Andrew Howroyd, Oct 14 2025
a(n) = Sum_{i=1..n} A262073(i). - Felix Huber, Jan 13 2026
EXAMPLE
a(1) = 1 as the only nonempty string we can make with either 0 or 1 copies of the letter A is A.
a(2) = 5 as the nonempty strings we can make with either 0 or 1 copies of the letter A, and either 0 or 2 copies of the letter B are A, BB, ABB, BAB and BBA.
MAPLE
A389772 := proc(n) option remember; `if`(n = 1, 1, A389772(n - 1) + A262073(n)); end proc: seq(A389772(n), n = 1 .. 12); # Felix Huber, Jan 13 2026
PROG
(PARI) a(n)={my(m=binomial(n+1, 2)); vecsum(Vec(serlaplace(prod(k=1, n, 1 + x^k/k!, 1 + O(x*x^m)))))-1} \\ Andrew Howroyd, Oct 14 2025
CROSSREFS
KEYWORD
nonn
AUTHOR
Robin Jones, Oct 14 2025
STATUS
approved
