entiers multiples de p avec nombres impairs distincts

count(p):=block([a,b,c,d,n,nbr],
nbr:0,
for a:1 thru 9 step 2 do 
for b:1 thru 9 step 2 do 
for c:1 thru 9 step 2 do 
for d:1 thru 9 step 2 do 
(n:a*1000+b*100+c*10+d,
if a#b and a#c and a#d and b#c and b#d and c#d and mod(n,p)=0 then
 (nbr:nbr+1,disp(n))),
nbr);

count(7);