OFFSET
0,3
COMMENTS
For n > 100 the maximum value of a(n) increases by 1 a total of nine times for every order-of-magnitude increase of n; for n up to 10^10 the largest value of a(n) is 89.
The frequency of occurrence for the values of a(n) for large values of n has an interesting distribution - it is a bell-shaped curve but with large increases for a(n) = 8, and a smaller increase for a(n) = 17. The value a(n) = 8 is likely the most common value as every time n increases by 100 the value of a(n) goes through ten smaller cycles, and 8 appears to be the only value that is present in all ten cycles. The reason a(n) = 17 also appears more often is not clear, although the distribution for n up to 10^10 also shows a slight increase in the number of occurrences for a(n) = 26, suggesting that a(n) values of the form a(n) = 8 + 9 * k, where k >= 0, occur more frequently than one would predicted from the surrounding bell-curve distribution.
The sequence is unbounded because a(10^k-2) = 9*k-1 for k>0. - Giovanni Resta, Oct 19 2019
LINKS
Scott R. Shannon, Table of n, a(n) for n = 0..19999
Scott R. Shannon, Frequency distribution for a(n), where 0 <= a(n) <= 89, for n up to 10^10. The large peak is a(n) = 8, which occurs 900169158 times. The smaller peak is a(n) = 17. There is also a small bump on the bell-curve at a(n) = 26; this may become a separate peak when n >> 10^10. The bell-curve maximum value is at a(n) = 44.
EXAMPLE
a(1) = sum of digits of 1 mod sum of digits of 2 = 1 mod 2 = 1.
a(9) = sum of digits of 9 mod sum of digits of 10 = 9 mod 1 = 0.
a(38) = sum of digits of 38 mod sum of digits of 39 = 11 mod 12 = 11.
a(39) = sum of digits of 39 mod sum of digits of 40 = 12 mod 4 = 0.
MATHEMATICA
sod[n_] := Plus @@ IntegerDigits@ n; a[n_] := Mod[sod[n], sod[n+1]]; Array[a, 100, 0] (* Giovanni Resta, Oct 19 2019 *)
PROG
(PARI) a(n) = sumdigits(n) % sumdigits(n+1); \\ Michel Marcus, Oct 19 2019
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Scott R. Shannon, Oct 19 2019
STATUS
approved