Euler Problem 124
Euler Problem 124:Determining the kth element of the sorted radical function.
Implementacija u Mathematica:Obzirom da Mathematica posjedije fukciju za faktorizaciju, iskoristićemo je te formirati listu u kojoj svki element liste sadrži dva broja, n i proizvod njegovih različitih faktora (kako je zadatkom definisano). Listu sortiramo i prikažemo 10000 element liste.
n = 100000; nth = 10000;
Sort[Table[{n, Product[n, {n, FactorInteger[n][[All, 1]]}]},
{n, 1, n}], #1[[2]] <= #2[[2]] &][[nth, 1]]
Posted on 07/03/2010, in Project Euler and tagged Project Euler. Bookmark the permalink. Leave a Comment.









Leave a Comment
Comments (0)