OFFSET
1,2
LINKS
Vincenzo Manto, Table of n, a(n) for n = 1..10000
EXAMPLE
Letting | denote the concatenation of digits:
a(10) = 1 | (1 + 0) | 0 = 110,
a(36) = 3 | (3 + 6) | 6 = 396,
a(47) = 4 | (4 + 7) mod 10 | 7 = 4 | 1 | 7 = 417,
a(159) = 1 | (1 + 5) | 5 | (5 + 9) mod 10 | 9 = 16549.
MATHEMATICA
a[n_]:=Module[{d=IntegerDigits[n]}, l=Length[d]; If[l==1, n, Do[j=2i; d=Insert[d, Mod[d[[j-1]]+d[[j]], 10], j], {i, l-1}]; FromDigits[d]]]; Array[a, 54] (* James C. McMahon, Apr 25 2026 *)
PROG
(Python)
def a(n):
s = str(n)
if len(s) < 2: return n
res = []
for i in range(len(s) - 1):
d1, d2 = int(s[i]), int(s[i+1])
res.append(s[i])
res.append(str((d1 + d2) % 10))
res.append(s[-1])
return int("".join(res))
print([a(n) for n in range(1, 55)])
CROSSREFS
KEYWORD
AUTHOR
Vincenzo Manto, Apr 20 2026
STATUS
approved
