login
Odd numbers that are divisible by the product of their digits.
1

%I #16 May 26 2021 09:00:18

%S 1,3,5,7,9,11,15,111,115,135,175,315,735,1111,1113,1115,1131,1197,

%T 1311,1575,1715,3111,3171,3915,7119,9315,11111,11115,11133,11313,

%U 11331,11711,13113,13131,13311,17115,31113,31131,31311,33111,35175,51975,77175,111111,111115,111135

%N Odd numbers that are divisible by the product of their digits.

%C Odd terms in A007602.

%H David A. Corneth, <a href="/A342949/b342949.txt">Table of n, a(n) for n = 1..6430</a>

%e 135 is in the sequence as it is odd and it is divisible by the product of its digits namely 1*3*5 = 15.

%t Select[Range[1,100000,2],Quiet@Mod[#,Times@@IntegerDigits@#]==0&] (* _Giorgos Kalogeropoulos_, Mar 30 2021 *)

%o (PARI) is(n) = {if(n%2 == 0, return(0)); my(vp = vecprod(digits(n))); if(vp > 0, c = n/vp; if(denominator(c) == 1, return(1))); 0 } \\ _David A. Corneth_, Mar 30 2021

%o (Python)

%o from math import prod

%o def pd(o): return prod(int(d) for d in str(o))

%o def aupto(limit):

%o return [o for o in range(1, limit+1, 2) if pd(o) and o%pd(o) == 0]

%o print(aupto(111135)) # _Michael S. Branicky_, Mar 30 2021

%Y Cf. A005408, A007602.

%Y Supersequence of repunits (A002275 \ {0}).

%K nonn,base

%O 1,2

%A _David A. Corneth_, Mar 30 2021