OFFSET
1,2
COMMENTS
The function is like a chase that ends when n1(i) = n2(i). For example, when n = 14:
n1(1) = 14, n2(1) = 0
n1(2) = 14 = 14 + digsum(0), n2(2) = 5 = 0 + digsum(14)
n1(3) = 19 = 14 + digsum(5), n2(3) = 10 = 5 + digsum(14)
n1(4) = 20 = 19 + digsum(10), n2(4) = 20 = 10 + digsum(19)
Because n1 = n2 = 20, the chase ends and a(14) = 20. When n = 81, a(81) > 10^8 and the chase may never end. In other bases, some different number first produces a prolonged chase with no result. E.g., in base 9, the number is 64 = 71 (b9); in base 12, the number is 110 = 92 (b12). In base 2, when n = 178, n1 = n2 = 6181 and when n = 179, n1 = n2 = 267684506.
If a(81) exists, it is larger than 5*10^14. - Giovanni Resta, Jul 21 2017
LINKS
Anthony Sand, Table of n, a(n) for n = 1..80
FORMULA
n1(1) = n, n2(1) = 0, then n1(i) = n1(i-1) + digsum(n2(i-1)), n2(i) = n2(i-1) + digsum(n1(i-1)) until n1(i) = n2(i).
EXAMPLE
n1(1) = 12, n2(1) = 0
n1(2) = 12 = 12 + digsum(0), n2(2) = 3 = 0 + digsum(12)
n1(3) = 15 = 12 + digsum(3), n2(3) = 6 = 3 + digsum(12)
n1(4) = 21 = 15 + digsum(6), n2(4) = 12 = 6 + digsum(15)
n1(5) = 24 = 21 + 3, n2(5) = 15 = 12 + 3
n1(6) = 30 = 24 + 6, n2(6) = 21 = 15 + 6
n1(7) = 33 = 30 + 3, n2(7) = 24 = 21 + 3
n1(8) = 39 = 33 + 6, n2(8) = 30 = 24 + 6
n1(9) = 42 = 39 + 3, n2(9) = 42 = 30 + 12
MATHEMATICA
Table[NestWhileList[{#1 + Total@ IntegerDigits[#2], #2 + Total@ IntegerDigits[#1]} & @@ # &, {n, 0}, UnsameQ @@ # &, 1, 10^4][[-1, -1]], {n, 80}] (* Michael De Vlieger, Jul 17 2017 *)
CROSSREFS
KEYWORD
nonn,base,more
AUTHOR
Anthony Sand, Jul 17 2017
STATUS
approved