A111707 a(n) = Sum_{k = 1..ceiling(w/2)} d(k) * d(w+1-k), where (d(1), ..., d(w)) is the decimal expansion of n.
0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 0, 3, 6, 9, 12, 15, 18, 21, 24, 27, 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 0, 6, 12, 18, 24, 30, 36, 42, 48, 54, 0, 7, 14, 21, 28, 35, 42, 49, 56, 63, 0, 8
Offset: 0
Examples
a(12) = 1*2 = 2, a(12345) = 1*5 + 2*4 + 3*3 = 22.
Links
- Rémy Sigrist, Table of n, a(n) for n = 0..10000
Crossrefs
Cf. A085942.
Programs
-
Mathematica
Array[Sum[#1[[k]]*#1[[#2 + 1 - k]], {k, Ceiling[#2/2]}] & @@ {IntegerDigits[#], IntegerLength[#]} &, 82, 0] (* Michael De Vlieger, May 21 2021 *)
-
PARI
a(n) = { my (d=digits(n)); sum (k=1, ceil(#d/2), d[k]*d[#d+1-k]) } \\ Rémy Sigrist, May 21 2021
Extensions
More terms from Joshua Zucker, May 08 2006
a(0) = 0 prepended and name clarified by Rémy Sigrist, May 21 2021