|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
The main sequence is A331786; this is added because some people may search for this.
|
|
LINKS
|
Index entries for linear recurrences with constant coefficients, signature (1,0,0,0,0,0,0,0,10,-10).
|
|
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.
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
|
|
|
PROG
|
(PARI) a(n) = my(s=(n-1)\9, t=(n-1)%9+1); 10^s*(2*t-gcd(t, 9)+1)-1
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|