login
The smallest n-digit number whose last k digits are divisible by k^2 for k = 1..n, otherwise 0 (for n > 1).
1

%I #45 Dec 23 2021 00:33:47

%S 0,12,108,1072,10000,108000,1666000,10000000,810000000,1000000000,

%T 73810000000,873810000000,0,0,900000000000000,1000000000000000,

%U 28900000000000000,0,0,10000000000000000000,0,0,0,900000000000000000000000

%N The smallest n-digit number whose last k digits are divisible by k^2 for k = 1..n, otherwise 0 (for n > 1).

%C a(13)=0, a(14)=0 because there are no 13- or 14-digit numbers which satisfy the requirements. The sequence is infinite.

%H Shyam Sunder Gupta, <a href="/A228013/b228013.txt">Table of n, a(n) for n = 1..150</a>

%e There are ten one-digit numbers divisible by 1 and the smallest is 0 so a(1)=0.

%e For two-digit numbers, the second digit must make it divisible by 2^2, which gives 12 as the smallest to satisfy the requirement, so a(2)=12.

%t a = Table[j, {j, 0, 9}]; r = 2; s2 = 10; t = a; xs = {First[a]}; While[! a == {} , n = Length[a]; k = 1; b = {}; While[! k > n , z0 = a[[k]]; Do[z = 10^(r - 1)*j + z0; If[Mod[z, r*r] == 0 && r < 25, b = Append[b, z]; t = Append[t, z]], {j, 0, 9}]; k++]; s = Union[t]; s1 = Length[s]; If[r < 25, If[ s1 > s2, xs = Append[xs, s[[s2 + 1]]], xs = Append[xs, 0]]]; s2 = s1; a = b; r++]; xs

%Y Cf. A079238.

%K nonn,base

%O 1,2

%A _Shyam Sunder Gupta_, Aug 08 2013