Run Code
|
API
|
Code Wall
|
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
Никита
PyPoly
PyLSV
Python | Random elements with atleast K occurrences
fb_series
Factorial number using recursion
V
MBTI
Rextester
PyGuessTheNum