Project Euler #303

For a positive integer n, define f(n) as the least positive multiple of n that, written in base 10, uses only digits <=2.

Thus f(2)=2, f(3)=12, f(7)=21, f(42)=210, f(89)=1121222.

Also sum_n=1^100 {f(n)/n} = 11363107

Find sum_n=1^10000 {f(n)/n}.

Phew… this was an easy one 😉 I made it to the top 30. I hope I will be number one eventually ;]

2 Comments

  • Hi der !
    I am stuck on problem number 303 on Project Euler 🙁
    I just can’t get the answer for a particular number which I think is there purposefully, i.e. for 9999.
    Please help me to figure out how to get it for 9999. Or what approach have you tried
    Thanx 🙂

  • Worst case scenario – you can figure it out by hand (or should I say “by head” 😉 ) from analogy to 999 and 99.


Leave a Reply

Your email address will not be published. Required fields are marked *