The Artima Developer Community
Sponsored Link

Java Answers Forum
Number of ways to factorize an integer

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
John

Posts: 1
Nickname: hhh13
Registered: Feb, 2003

Number of ways to factorize an integer Posted: Feb 13, 2003 10:31 PM
Reply to this message Reply
Advertisement
I've a difficulty in solving this question. Can someone please help me? Thanks.

********
Problem Description:
Any positive integer n (n>1) can be expressed as a product of a set of positive integers that are greater than 1, e.g., 24 = 3 * 8. Usually there is more than just one set, e.g., 24 = 4 * 6 = 2 * 12 = 2 * 2 * 6. So {4, 6}, {2, 12}, and {2, 2, 6} are another three sets. The order of elements in the set does not matter, so {2, 2, 6} is considered the same as {2, 6, 2}. (Note set is different from mathematical definition of set, as we can have duplicated items). Of course {24} is another set whose product equals to 24. Let's define a function f over all positive integer as:

f(n) = the number of different ways to factorize a integer n , if n>1
f(1) = 1

f(24) will yield 7 as there are 7 such sets: {2, 2, 2, 3}, {2, 2, 6}, {2, 4, 3}, {2, 12}, {3, 8}, {4, 6}, and {24}

Given an interval [i...j], try to find an integer n with the biggest f(n).

**********
For this problem, we are suppose to output the integer n that has the biggest f(n).

Topic: Sorting a linked list Previous Topic   Next Topic Topic: kmeans algorithm help

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use