%I #12 Sep 05 2019 09:30:39
%S 5,14,0,32,5,0,14,32,0,50,0,0,104,14,0,32,221,0,1121,140,0,0,23,0,50,
%T 104,0,140,203,0,2201,32,0,2210,140,0,0,3002,0,320,41,0,2021,0,0,230,
%U 2021,0,22001,50,0,104,212,0,0,1400,0,2030,1121,0,122,22010,0,320,1040
%N Smallest multiple of n with digit sum = 5, or 0 if no such number exists, e.g. a(3k) = a(11k) = 0.
%C a(3k)= a(11k) =a(37k)=0. - _Ray Chandler_, Jul 30 2003
%H Robert Israel, <a href="/A069524/b069524.txt">Table of n, a(n) for n = 1..3000</a>
%F a(n) = n*A088394(n). - _R. J. Mathar_, Aug 06 2019
%p nextL:= proc(L)
%p local m,q,Lp;
%p for m from 1 do
%p if L[m] > 0 then
%p if m = LinearAlgebra:-Dimension(L) then return <4,0$(m-1),1>
%p else Lp:= L;
%p Lp[1]:= L[m]-1;
%p Lp[2..m]:= 0;
%p Lp[m+1]:= L[m+1]+1;
%p return Lp;
%p fi
%p fi
%p od;
%p end proc:
%p N:= 300:
%p Agenda:= remove(t -> ormap(s -> (t mod s = 0), [3,11,37,101,137,239]), {$1..N}):
%p L:= <5>: x:= 5:
%p A:= Vector(N):
%p while Agenda <> {} and x < 10^40 do
%p x:= add(L[i]*10^(i-1),i=1..LinearAlgebra:-Dimension(L));
%p found,Agenda:= selectremove(t -> x mod t = 0, Agenda);
%p if found <> {} then
%p A[convert(found,list)]:= x;
%p fi;
%p L:= nextL(L);
%p od:
%p convert(A,list): # _Robert Israel_, Sep 05 2019
%Y Cf. A052219, A069521, A069522, A069523.
%K base,nonn
%O 1,1
%A _Amarnath Murthy_, Apr 01 2002
%E More terms from _Ray Chandler_, Jul 30 2003
|