login
Smallest multiple of n with digit sum = 9, or 0 if no such number exists (e.g., a(11k) = 0).
5

%I #14 Feb 15 2024 01:13:37

%S 9,18,9,36,45,18,63,72,9,90,0,36,117,126,45,144,153,18,171,180,63,0,

%T 207,72,225,234,27,252,261,90,1116,1152,0,306,315,36,333,342,117,360,

%U 1107,126,1161,0,45,414,423,144,441,450,153,1404,1431,54,0,504,171,522

%N Smallest multiple of n with digit sum = 9, or 0 if no such number exists (e.g., a(11k) = 0).

%C a(n) = 0 if n is a multiple of 11, 101, 271, 999 or 4649. - _Robert Israel_, Feb 14 2024

%H Robert Israel, <a href="/A069528/b069528.txt">Table of n, a(n) for n = 1..10000</a>

%p unfinished:= true: V:= Vector(1000): V0:= select(t -> igcd(t, 11*101*271*4649) = 1 and t mod 999 <> 0, {$1..1000}):

%p for i1 from 0 while unfinished do

%p for i2 from 0 to i1 while unfinished do

%p for i3 from 0 to i2 while unfinished do

%p for i4 from 0 to i3 while unfinished do

%p for i5 from 0 to i4 while unfinished do

%p for i6 from 0 to i5 while unfinished do

%p for i7 from 0 to i6 while unfinished do

%p for i8 from 0 to i7 while unfinished do

%p for i9 from 0 to i8 while unfinished do

%p v:= 10^i1 + 10^i2 + 10^i3 + 10^i4 + 10^i5 + 10^i6 + 10^i7 + 10^i8 + 10^i9;

%p dv:= numtheory:-divisors(v);

%p for s in V0 intersect dv do

%p V[s]:= v;

%p od;

%p V0:= V0 minus dv;

%p unfinished:= evalb(V0 <> {});

%p od od od od od od od od od:

%p convert(V,list); # _Robert Israel_, Feb 14 2024

%Y Cf. A069521, A069522, A069523, A069524, A069525, A069526, A069527.

%K base,nonn

%O 1,1

%A _Amarnath Murthy_, Apr 01 2002

%E More terms from _Sascha Kurz_, Apr 08 2002