A307629 Let decimal expansion of n be d_1 d_2 ... d_k; a(n) = Sum_{i=1..k-1} Sum_{j=i+1..k} (d_i + d_j).
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 2, 4, 6
Offset: 0
Examples
For n<10 there is only one decimal digit so a(n)=0. a(102) = 1+0 + 1+2 + 0+2 = 6.
Links
- Michael De Vlieger, Table of n, a(n) for n = 0..10000
Programs
-
Maple
a:= n-> (d-> (nops(d)-1)*add(i, i=d))(convert(n, base, 10)): seq(a(n), n=0..120); # Alois P. Heinz, Apr 19 2019
-
Mathematica
Array[Total@ Flatten@ Subsets[IntegerDigits@ #, {2}] &, 103, 0] (* Michael De Vlieger, Apr 19 2019 *)
Formula
From Alois P. Heinz, Apr 19 2019: (Start)
Comments