Learning F#

Project Euler — Problem 89 Solution

Prob­lem The rules for writ­ing Roman numer­als allow for many ways of writ­ing each num­ber (see FAQ:Roman Numer­als). How­ev­er, there is always a “best” way of writ­ing a par­tic­u­lar num­ber. For exam­ple, the fol­low­ing rep­re­sent all of the legit­i­mate ways of writ­ing the num­ber six­teen: IIIIIIIIIIIIIIII VIIIIIIIIIII VVIIIIII XIIIIII VVVI XVI The last exam­ple being …

Project Euler — Prob­lem 89 Solu­tionRead More »

Project Euler — Problem 66 Solution

Prob­lem Con­sid­er qua­drat­ic Dio­phan­tine equa­tions of the form: x2 – Dy2 = 1 For exam­ple, when D=13, the min­i­mal solu­tion in x is 6492 – 13x1802 = 1. It can be assumed that there are no solu­tions in pos­i­tive inte­gers when D is square. By find­ing min­i­mal solu­tions in x for D = {2, 3, …

Project Euler — Prob­lem 66 Solu­tionRead More »

Project Euler — Problem 78 Solution

Prob­lem Let p(n) rep­re­sent the num­ber of dif­fer­ent ways in which n coins can be sep­a­rat­ed into piles. For exam­ple, five coins can sep­a­rat­ed into piles in exact­ly sev­en dif­fer­ent ways, so p(5)=7. OOOOO OOOO   O OOO   OO OOO   O   O OO   OO   O OO   O   O   O O   O   O   O   O Find the …

Project Euler — Prob­lem 78 Solu­tionRead More »

Project Euler — Problem 62 Solution

Prob­lem The cube, 41063625 (3453), can be per­mut­ed to pro­duce two oth­er cubes: 56623104 (3843) and 66430125 (4053). In fact, 41063625 is the small­est cube which has exact­ly three per­mu­ta­tions of its dig­its which are also cube. Find the small­est cube for which exact­ly five per­mu­ta­tions of its dig­its are cube. Solu­tion

Project Euler — Problem 112 Solution

Prob­lem Work­ing from left-to-right if no dig­it is exceed­ed by the dig­it to its left it is called an increas­ing num­ber; for exam­ple, 134468. Sim­i­lar­ly if no dig­it is exceed­ed by the dig­it to its right it is called a decreas­ing num­ber; for exam­ple, 66420. We shall call a pos­i­tive inte­ger that is nei­ther increas­ing …

Project Euler — Prob­lem 112 Solu­tionRead More »

Project Euler — Problem 51 Solution

Prob­lem By replac­ing the 1st dig­it of *3, it turns out that six of the nine pos­si­ble val­ues: 13, 23, 43, 53, 73, and 83, are all prime. By replac­ing the 3rd and 4th dig­its of 56**3 with the same dig­it, this 5-dig­it num­ber is the first exam­ple hav­ing sev­en primes among the ten gen­er­at­ed …

Project Euler — Prob­lem 51 Solu­tionRead More »

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.