Consider a function which, for a given whole number n, returns the number of ones required when writing out all numbers between 0 and n.
For example, f(13)=6. Notice that f(1)=1. What is the next largest n such that f(n)=n?
已知最大的解是1111111110
in Python’s way
n = 1
count = 0while n<= 1111111110: temp = str(n).count(”1″) count += temp if (count […]