Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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

%I #19 Feb 01 2020 12:08:27

%S 1,3,3,7,9,9,13,15,9,19,39,39,79,99,99,139,159,99,199,399,399,799,999,

%T 999,1399,1599,999,1999,3999,3999,7999,9999,9999,13999,15999,9999,

%U 19999,39999,39999,79999,99999,99999,139999,159999,99999,199999,399999,399999,799999

%N 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.

%C The main sequence is A331786; this is added because some people may search for this.

%H Jianing Song, <a href="/A331788/b331788.txt">Table of n, a(n) for n = 1..1000</a>

%H <a href="/index/Rec#order_10">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,0,0,0,0,0,0,10,-10).

%F 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.

%F a(n) = A331786(n) + 1.

%F Conjectures from _Colin Barker_, Jan 26 2020: (Start)

%F 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)).

%F a(n) = a(n-1) + 10*a(n-9) - 10*a(n-10) for n>10.

%F (End) [This conjecture is correct.]

%F a(n) = O(10^(n/9)).

%e See A331786.

%o (PARI) a(n) = my(s=(n-1)\9, t=(n-1)%9+1); 10^s*(2*t-gcd(t,9)+1)-1

%Y Cf. A007953 (S(N)), A051885, A331786.

%Y Row 10 of A331789.

%K nonn,base,easy

%O 1,2

%A _Jianing Song_, Jan 25 2020