Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
A331788
a(n) is the smallest m such that for any N, at least one of S(N), S(N+1), ..., S(N+m-1) is divisible by n, where S(N) is the sum of digits of N.
5
1, 3, 3, 7, 9, 9, 13, 15, 9, 19, 39, 39, 79, 99, 99, 139, 159, 99, 199, 399, 399, 799, 999, 999, 1399, 1599, 999, 1999, 3999, 3999, 7999, 9999, 9999, 13999, 15999, 9999, 19999, 39999, 39999, 79999, 99999, 99999, 139999, 159999, 99999, 199999, 399999, 399999, 799999
OFFSET
1,2
COMMENTS
The main sequence is A331786; this is added because some people may search for this.
FORMULA
If n = 9*s + t, 1 <= t <= 9, then a(n) = 10^s*(2*t-gcd(t,9)+1) - 1. See A331787 for a proof of the formula in base b.
a(n) = A331786(n) + 1.
Conjectures from Colin Barker, Jan 26 2020: (Start)
G.f.: x*(1 + 2*x + 4*x^3 + 2*x^4 + 4*x^6 + 2*x^7 - 6*x^8) / ((1 - x)*(1 - 10*x^9)).
a(n) = a(n-1) + 10*a(n-9) - 10*a(n-10) for n>10.
(End) [This conjecture is correct.]
a(n) = O(10^(n/9)).
EXAMPLE
See A331786.
PROG
(PARI) a(n) = my(s=(n-1)\9, t=(n-1)%9+1); 10^s*(2*t-gcd(t, 9)+1)-1
CROSSREFS
Cf. A007953 (S(N)), A051885, A331786.
Row 10 of A331789.
Sequence in context: A143088 A360875 A131036 * A375404 A206433 A301589
KEYWORD
nonn,base,easy
AUTHOR
Jianing Song, Jan 25 2020
STATUS
approved