

A326746


a(n) = (sum of digits of n) mod (sum of digits of n+1).


1



0, 1, 2, 3, 4, 5, 6, 7, 8, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 4, 5, 6, 7, 8, 9, 10, 11, 12, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 2, 6, 7, 8, 9, 10, 11, 12, 13, 14, 1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 8, 9, 10, 11, 12, 13, 14, 15, 16, 8, 9, 10
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

0,3


COMMENTS

For n > 100 the maximum value of a(n) increases by 1 a total of nine times for every orderofmagnitude 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 bellshaped 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 bellcurve distribution.
The sequence is unbounded because a(10^k2) = 9*k1 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 bellcurve at a(n) = 26; this may become a separate peak when n >> 10^10. The bellcurve 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

Cf. A070635, A180160.
Sequence in context: A031087 A010878 A309788 * A257849 A190727 A195832
Adjacent sequences: A326743 A326744 A326745 * A326747 A326748 A326749


KEYWORD

nonn,base,easy


AUTHOR

Scott R. Shannon, Oct 19 2019


STATUS

approved



