%I #15 Aug 07 2015 02:43:42
%S 1,12,123,3456,12345,123456,3456789,56789101112,123456789,12345678910,
%T 910111213141516171819,123456789101112,45678910111213141516,
%U 7891011121314151617181920,123456789101112131415,567891011121314151617181920
%N Smallest multiple of n formed by the concatenation of n successive numbers, or 0 if no such number exists.
%H Paul Tek, <a href="/A077306/b077306.txt">Table of n, a(n) for n = 1..333</a>
%p digs := proc(inp::integer) local resul,shiftinp : resul := 1 : shiftinp := iquo(inp,10) : while shiftinp > 0 do resul := resul+1 : shiftinp := iquo(shiftinp,10) : od : RETURN(resul) : end: # provide number of concatenation of frst up to lst newnum := proc(frst::integer,lst::integer) local resul,i : resul:= frst : for i from frst+1 to lst do resul := resul*10^digs(i)+i : od : RETURN(resul) ; end : n := 1 : while n < 20 do nold := n : newfeedstrt := 1 : newfeedend := newfeedstrt + n-1 : while nold = n do trythis := newnum(newfeedstrt,newfeedend) : if ( trythis mod n ) = 0 then printf("%a,",trythis) ; n := n+ 1: break : fi : newfeedstrt := newfeedstrt + 1 : newfeedend := newfeedstrt + n-1 : od : od : # _R. J. Mathar_, Mar 13 2006
%t a[n_] := Block[{v, k = 1}, While[Mod[v = FromDigits@ Flatten@ IntegerDigits@ Range[k, k+n-1], n] > 0, k++]; v]; Array[a,20] (* _Giovanni Resta_, May 12 2013 *)
%Y Cf. A075000, A077308.
%K base,nonn
%O 1,2
%A _Amarnath Murthy_, Nov 03 2002
%E More terms from _R. J. Mathar_, Mar 13 2006