Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
BMO1 Q1 1994
""" Starting with any three digit number n (such as n = 625), we can obtain a new number f(n), which is equal to the sum of the three digits of n, their three three products in pairs, and the product of all three digits. Find all three digit numbers such that the ratio n/f(n)=1. """ A = 100 def get_digit(number, n): return number // 10**n % 10 while A<1000: a = get_digit(A, 2) b = get_digit(A, 1) c = get_digit(A, 0) d = a + b + c + a*b + a*c + b*c + a*b*c if d == A: print(A) A = A + 1
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
"Hello,world!"
shuru5
Reading XML file to modify
pythonic way (V2)
mansur
StringManipulation
HW Descending order
Lab_III_3_01_12_2020
PyEnDecode
🙆👌
Please log in to post a comment.