Page 4 of 6
Re: Problem 012
Posted: Sat May 14, 2011 3:26 pm
by akshayms
Where can i find that PDF
Re: Problem 012
Posted: Sat May 14, 2011 3:42 pm
by Lord_Farin
akshayms wrote:Where can i find that PDF
After you solve the problem, there will be a PDF icon besides the forum icon. This links to the PDF file.
Problem 012
Posted: Sun May 22, 2011 8:06 pm
by m34tcode
my program(in java) is too slow to find the first factor with over 500 divisors. right now i have two functions, one that finds the triangle number, and one that finds every factor of a number, then returns how many were found.
my triangle function is nearly instant, since it just uses an equation. my factoring function, tests every number less than or equal to the number being factored, and counts how many were perfectly divisible.
does anyone know a quicker way to find how many factors a number has? the current way ios far too slow for large numbers and i cant find the answer in under a minute, as i should be able to.
Re: Problem 012
Posted: Sun May 22, 2011 9:27 pm
by hk
Please don't start a new topic for a problems if such a topic already exists.
Re: Problem 012
Posted: Sun May 22, 2011 10:12 pm
by davidFashion
m34tcode wrote:my program(in java) is too slow to find the first factor with over 500 divisors.
... Other comments removed ...
does anyone know a quicker way to find how many factors a number has?
A factor is not a divisor. I would suggest reviewing your program to ensure that you are solving the requested problem. A brute force program can solve the problem in a very short time.
My solution is in Java and completes in .031 sec.

Re: Problem 012
Posted: Mon May 23, 2011 12:31 am
by TripleM
davidFashion wrote:A factor is not a divisor.
Factor and divisor are synonyms and mean exactly the same thing.
To m34tcode - I'm afraid this forum isn't for giving away hints; you'll need to come up with the idea for something faster yourself.
Re: Problem 012
Posted: Mon May 23, 2011 3:39 pm
by davidFashion
TripleM wrote:davidFashion wrote:A factor is not a divisor.
Factor and divisor are synonyms and mean exactly the same thing.
Yes, you are correct. When I wrote "factor", I was thinking "prime factor". Thanks for the clarification.

Re: Problem 012
Posted: Mon May 23, 2011 7:30 pm
by thundre
m34tcode wrote:my triangle function is nearly instant, since it just uses an equation. my factoring function, tests every number less than or equal to the number being factored, and counts how many were perfectly divisible.
does anyone know a quicker way to find how many factors a number has?
Yes, there is a faster way, and most of the successful problem 12 solvers probably used it (I know I did).
Your challenge is to find it.
Re: Problem 012
Posted: Thu Jun 09, 2011 7:25 pm
by akv1kor
Hi, I tried the problem 12,
i got one answer, which seems to be incorrect according to the website.
the number has 24 and 23 divisors each. can anyone give any further hint.
Re: Problem 012
Posted: Thu Jun 09, 2011 11:22 pm
by thundre
akv1kor wrote:Hi, I tried the problem 12,
i got one answer, which seems to be incorrect according to the website.
the number has 24 and 23 divisors each. can anyone give any further hint.
4 has 3 divisors.
6 has 4 divisors.
But...
4*6 = 24 does not have 12 divisors, only 8.
Re: Problem 012
Posted: Fri Jun 10, 2011 9:42 am
by akv1kor
thundre wrote:
4 has 3 divisors.
6 has 4 divisors.
But...
4*6 = 24 does not have 12 divisors, only 8.
Here we have N&N+1 so above logic does not fit i suppose.
apart from 1,other divisors are mutually exclusive.
my number has 577 divisors,Is this any way near.
Re: Problem 012
Posted: Fri Jun 10, 2011 10:39 am
by hk
Unless I'm mistaken the smallest number having 577 divisors is 2576 (577 is prime).
However, if you multiply two coprime numbers with 23 and 24 divisors the number of divisors would be 23*24=552.
The number you are looking for has 576 divisors.
Do you handle the division by two correctly?
Re: Problem 012
Posted: Wed Jun 29, 2011 2:47 am
by akv1kor
its my mistake actually i did a mistake in adding 1 as a divisor for the first number.
now the number has 24 and 24 divisors each and i give (n*(n+1))/2 as solution but still i have wrong answer.
***0*1*0 is my value for ****th triangle number. pls match asterik with answers and advice
Re: Problem 012
Posted: Wed Jun 29, 2011 8:08 am
by hk
I'm not sure what your problem is, but let me give two examples:
suppose n=3, then n+1=4, so n(n+1)/2=6.
6 has 4 divisors: 1,2,3, and 6.
How can I calculate this from 3 and 4?
The numers to multiply are 3 and 4/2=2.
3 has two divisors: 1 and 3, and 2 has two divisors: 1 and 2.
So the number if divisors of 6 is 2*2=4.
If we take n=8 then n+1=9
So we have to multiply 8/2=4 and 9, makes 36.
36 has 9 divisors 1,2,3,4,6,9,12,18 and 36.
4 and 9 have both 3 divisors and 3*3=9.
Re: Problem 012
Posted: Wed Jun 29, 2011 11:23 am
by Francky
2 and 3 are coprime.
4 and 9 are coprime.
It's important !
Re: Problem 012
Posted: Wed Jun 29, 2011 11:49 am
by hk
Of course, but akv1kor knows that already.
Re: Problem 012
Posted: Wed Jun 29, 2011 12:48 pm
by Francky
Sorry, it was written just before.

Re: Problem 012
Posted: Wed Jun 29, 2011 7:57 pm
by akv1kor
thanks HK for your kind advice, you got it correct, i never thought to find factors of n/2
now i got it
Re: Problem 012
Posted: Wed Jun 29, 2011 8:57 pm
by hk
akv1kor wrote:thanks HK for your kind advice, you got it correct, i never thought to find factors of n/2
now i got it
You're welcome.
Re: Problem 012
Posted: Sat Jul 02, 2011 6:17 pm
by jkplusplus
Oh man, what a horrible time to forget to write in a pause function at the end of the program!!!!