Numbers divisible by their individual digits, but not by the product of their digits.: Difference between revisions
Numbers divisible by their individual digits, but not by the product of their digits. (view source)
Revision as of 11:34, 6 January 2024
, 4 months ago→{{header|Wren}}: Minor tidy
(add RPL) |
m (→{{header|Wren}}: Minor tidy) |
||
(One intermediate revision by one other user not shown) | |||
Line 1,819:
≪ n j DUP SUB STR→ ≫ 'j' 1 n SIZE 1 SEQ <span style="color:grey">@ make list of digits</span>
DUP2 MOD ∑LIST '''THEN''' DROP2 0 '''END'''
ΠLIST MOD SIGN
'''END'''
≫ '<span style="color:blue">GOOD?</span>' STO
≪ 1
{{out}}
<pre>
Line 1,961:
=={{header|Wren}}==
{{libheader|Wren-math}}
{{libheader|Wren-fmt}}
<syntaxhighlight lang="
import "./
var res = []
Line 1,976 ⟶ 1,974:
}
System.print("Numbers < 1000 divisible by their digits, but not by the product thereof:")
System.print("\n%(res.count) such numbers found")</syntaxhighlight>
|