← RoseCode

ROSECODE 246

Friend Exponent

Min_25 · Math ·

For given two real numbers α and β, a positive integer n is called k-friend exponent of α for β if αn and β shares the first k-significant digits.

For example, n=9 is a 1-friend exponent of π for e because π9=29809.099333446... and e=2.71828... shares "2".

Let E(α,β,k) denote the minimum k-friend exponent of α for β. It can be verified that E(π,e,1)=9, E(π,e,2)=19, E(π,e,5)=430881 and E(π,e,10)=2448322414.

Find E(π,e,50).

[My timing: 0.5 sec. (PyPy)]