OFFSET
1,2
COMMENTS
a(n) is the number of n-digit integers such that the sum of the odd-positioned digits is equal to the sum of the even-positioned digits, leading zeros being allowed in the integers.
LINKS
Colin Barker, Table of n, a(n) for n = 1..200
EXAMPLE
The number 28754 is one of the 4840 5-digit numbers because 2+7+4 = 8+5.
PROG
(PARI) a(n) = {nb = 0; for (i=0, 10^n-1, digs = digits(i, 10); while(#digs != n, digs = concat(0, digs)); so = 0; forstep(j=1, n, 2, so += digs[j]); se = 0; forstep(j=2, n, 2, se += digs[j]); if (se == so, nb++); ); return (nb); } \\ Michel Marcus, Jun 08 2013
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Colin Barker, Oct 13 2011
STATUS
approved