login
A267238
Sum of the triangular numbers whose indices are the digits of n.
2
1, 3, 6, 10, 15, 21, 28, 36, 45, 1, 2, 4, 7, 11, 16, 22, 29, 37, 46, 3, 4, 6, 9, 13, 18, 24, 31, 39, 48, 6, 7, 9, 12, 16, 21, 27, 34, 42, 51, 10, 11, 13, 16, 20, 25, 31, 38, 46, 55, 15, 16, 18, 21, 25, 30, 36, 43, 51, 60, 21, 22, 24, 27, 31, 36, 42, 49, 57, 66, 28, 29, 31, 34, 38, 43, 49, 56, 64, 73, 36, 37, 39, 42, 46, 51, 57, 64, 72, 81
OFFSET
1,2
FORMULA
From Robert Israel, Jan 21 2016: (Start)
G.f.: A(x) = Sum_{j >= 0} (1-x^(10^j))/((1-x)*(1-x^(10^(j+1)))) * Sum_{d=1..9} d*(d+1)/2 * x^(d*10^j)
satisfies A(x) = (1-x^10)*A(x^10)/(1-x) + (1+3*x^2+6*x^3+10*x^4+15*x^5+21*x^6+28*x^7+36*x^8+45*x^9)/(1-x^10).
a(10*m + j) = a(m) + j*(j+1)/2 for 0 <= j <= 9. (End)
EXAMPLE
a(12) = 1*2/2 + 2*3/2 = 4.
MAPLE
seq(add(d*(d+1)/2, d = convert(n, base, 10)), n=1..1000); # Robert Israel, Jan 21 2016
MATHEMATICA
f[n_]:=Total[IntegerDigits[n]*(IntegerDigits[n]+1)/2]; f/@Range@100
PROG
(PARI) a(n) = {my(d = digits(n)); sum(k=1, #d, d[k]*(d[k]+1)/2); } \\ Michel Marcus, Jan 12 2016
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Ivan N. Ianakiev, Jan 12 2016
STATUS
approved