WEEKEND PROGRAMMING CHALLENGE ISSUE-10


Image

Problem:

Let 0 < (a/b) < 1 where a and b are positive integers.
Make program which enters the numbers a and b then represent a/b with as sum of numbers 1/n + 1/n2 + 1/n3… and prints the n numbers.

For instance:

input:
a = 6
b = 7
output:
2, 3, 42

i.e. 6/7 = 1/2 + 1/3 + 1/42

input:
a = 3
b = 4
output:
2, 4

as 3/4 = 1/2 + 1/4

The rules:

You can code the solution in any programming language during the weekend and have to submit it to info@olimex.com latest on Sunday May 26th.

On Monday we will upload the solutions on GitHub and review https://github.com/OLIMEX/WPC .

You can play with your real name or with nick if you want to be anonymous, we will not disclosure your personal info if you do not want to.

Good Luck and Have fun!

1 Comment (+add yours?)

  1. Dylan
    May 26, 2013 @ 02:15:41

    I had not come across the Eye of Horus before.

    I shall sleep on Egyptian fractions for a=2 and b<100. Sunday challenge!

    Reply

Leave a comment