login
a(n) is the number of n-digit numbers divisible by their last digit.
0

%I #6 Mar 27 2018 08:48:23

%S 9,41,420,4203,42036,420357,4203572,42035714,420357143,4203571428,

%T 42035714286,420357142857,4203571428572,42035714285714,

%U 420357142857143,4203571428571428,42035714285714286,420357142857142857,4203571428571428572,42035714285714285714,420357142857142857143,4203571428571428571428

%N a(n) is the number of n-digit numbers divisible by their last digit.

%F For n >= 4, a(n) = (1177/28)*10^(n-2) + b(n mod 6)/7, where b(0)=-1, b(1)=4, b(2)=-2, b(3)=1, b(4)=-4, b(5)=2.

%e For n=2:

%e Nothing can be divided by 0.

%e All 9 two-digit numbers ending in 1 are divisible by 1.

%e All 9 two-digit numbers ending in 2 are divisible by 2.

%e Two two-digit numbers ending in 3 are divisible by 3 (namely 33, 63 and 93).

%e Four two-digit numbers ending in 4 are divisible by 4 (24, 44, 64 and 84).

%e All 9 two-digit numbers ending in 5 are divisible by 5.

%e Three two-digit numbers ending in 6 are divisible by 6 (namely 36, 66 and 96).

%e The only two-digit number ending in 7 and divisible by 7 is 77.

%e 2 two-digit numbers ending in 8 are divisible by 8: 48 and 88.

%e The only two-digit number ending in 9 and divisible by 9 is 99.

%e Thus a(2)=9+9+3+4+9+3+1+2+1=41.

%p B[0]:= -1: B[1]:= 4: B[2]:= -2:

%p B[3]:= 1: B[4]:= -4: B[5]:= 2:

%p F:= d -> (1177/28)*10^(d-2)+B[d mod 6]/7:

%p F(1):= 9: F(2):= 41: F(3):= 420:

%p map(F, [$1..30]);

%K nonn,base

%O 1,1

%A _Robert Israel_, Mar 26 2018