OFFSET
0,2
COMMENTS
When n < 10, a(n) is the number of six-digit numbers (with digits <= n) that have the property that the sum of the rightmost 3 digits equals the sum of the leftmost 3 digits. Some references call these balanced numbers. [Edited by M. F. Hasler, Mar 11 2013]
LINKS
Index entries for linear recurrences with constant coefficients, signature (6,-15,20,-15,6,-1).
FORMULA
G.f.: (x^4 + 19*x^3 + 36*x^2 + 10*x)/(x-1)^6.
a(n) = 6*a(n-1) - 15*a(n-2) + 20*a(n-3) - 15*a(n-4) + 6*a(n-5) - a(n-6) for n > 5; a(0)=0, a(1)=10, a(2)=96, a(3)=445, a(4)=1431, a(5)=3681.
a(n) = (66*n^5 + 275*n^4 + 440*n^3 + 325*n^2 + 94*n)/120 = n*(n+1)*(66*n^3 + 209*n^2 + 231*n + 94)/120.
EXAMPLE
When n=1, a(n)=10 because there are 10 solutions when viewed as balanced numbers: 111111, 110110, 110101, 110011, 101110, 101101, 101011, 100100, 100010, 100001.
MATHEMATICA
RecurrenceTable[{a[0] == 0, a[1] == 10, a[2] == 96, a[3] == 445, a[4] == 1431, a[5] == 3681, a[n] == 6 a[n - 1] - 15 a[n - 2] + 20 a[n - 3] - 15 a[n - 4] + 6 a[n - 5] - a[n - 6]}, a, {n, 0, 35}]
PROG
(Python)
def A197083(n): return n*(n*(n*(n*(66*n+275)+440)+325)+94)//120 # Chai Wah Wu, May 08 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Bobby Milazzo, Mar 11 2013
STATUS
approved