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]]
About these ads

About Bahrudin Hrnjica

Senior Software Developer at daenet, Microsoft MVP for C#, C , WPF, Silverlight, WP7, Math, Mechanical Engineering, Evolutionary Algorithms, Blogger.

Posted on 07/03/2010, in Project Euler and tagged . Bookmark the permalink. Leave a Comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 412 other followers

%d bloggers like this: