Problem 379
Forum rules
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.
This forum is NOT meant to discuss solution methods for a problem.
See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.
This forum is NOT meant to discuss solution methods for a problem.
In particular don't post any code fragments or results.
Don't start begging others to give partial answers to problems
Don't ask for hints how to solve a problem
Don't start a new topic for a problem if there already exists one
Don't start begging others to give partial answers to problems
Don't ask for hints how to solve a problem
Don't start a new topic for a problem if there already exists one
See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
-
dranzer
- Posts: 1
- Joined: Sat Apr 07, 2012 4:44 pm
Problem 379
Hello,
I had a question about this. If I got it right, to find
f(n)
I would have to find the number of pairs (x,y), such that x&Y are positive integers, x<=y and LCM(x,y) == n.
But doesn't this give an infinite number of ways ?
For example, if I am trying to find f(2), can't x&y be any pair of even numbers ( with x<=y ) ?
(2,2) (2,4) (4,8) ...... ( 2x, 4x ) .... etc.
Or maybe I misunderstood some part of the question ?
I had a question about this. If I got it right, to find
f(n)
I would have to find the number of pairs (x,y), such that x&Y are positive integers, x<=y and LCM(x,y) == n.
But doesn't this give an infinite number of ways ?
For example, if I am trying to find f(2), can't x&y be any pair of even numbers ( with x<=y ) ?
(2,2) (2,4) (4,8) ...... ( 2x, 4x ) .... etc.
Or maybe I misunderstood some part of the question ?
- hk
- Administrator
- Posts: 12832
- Joined: Sun Mar 26, 2006 10:34 am
- Location: Haren, Netherlands
Re: Problem 379
LCM(2,4)=4 and LCM(4,8)=8.

War ruins the life and health of untold numbers of innocent children.
-
thundre
- Posts: 356
- Joined: Sun Mar 27, 2011 10:01 am
Re: Problem 379
Don't confuse LCM with GCF.
If LCM(x,y) = n, y must be a factor of n, making n a multiple of y.
If LCM(x,y) = n, y must be a factor of n, making n a multiple of y.

- hk
- Administrator
- Posts: 12832
- Joined: Sun Mar 26, 2006 10:34 am
- Location: Haren, Netherlands
Re: Problem 379
Yes that's true.
But also GCD(4,8)=4 and not 2 and GCD(2x,4x)=2x.
As LCM(a,b)=a*b/(GCD(a,b), it follows that LCM(2x,4x)=2x*4x/2x=4x.
But also GCD(4,8)=4 and not 2 and GCD(2x,4x)=2x.
As LCM(a,b)=a*b/(GCD(a,b), it follows that LCM(2x,4x)=2x*4x/2x=4x.

War ruins the life and health of untold numbers of innocent children.
-
stevcis
- Posts: 3
- Joined: Fri Apr 13, 2012 6:41 am
Re: Problem 379
sorry... it is deleted.
Last edited by stevcis on Fri Apr 13, 2012 1:59 pm, edited 3 times in total.
- hk
- Administrator
- Posts: 12832
- Joined: Sun Mar 26, 2006 10:34 am
- Location: Haren, Netherlands
Re: Problem 379
@ stevcis:
this forum isn't a place to discuss solution methods.
Could you be so kind to remove your post?
this forum isn't a place to discuss solution methods.
Could you be so kind to remove your post?

War ruins the life and health of untold numbers of innocent children.
-
william2a
- Posts: 5
- Joined: Sun Oct 19, 2008 11:00 am
Problem 379
"Somewhere things get wrong"
For g(104 I get 363,982 that's right.
For g(106) I get 73,858,790 which is equal to (2*37,429,395)-106.
I am unable to see where is my mistake.
For g(104 I get 363,982 that's right.
For g(106) I get 73,858,790 which is equal to (2*37,429,395)-106.
I am unable to see where is my mistake.
- hk
- Administrator
- Posts: 12832
- Joined: Sun Mar 26, 2006 10:34 am
- Location: Haren, Netherlands
Re: Problem 379
Please don't start a new topic if there already exists one for that problem.

War ruins the life and health of untold numbers of innocent children.
-
stevcis
- Posts: 3
- Joined: Fri Apr 13, 2012 6:41 am
Re: Problem 379
@william 2a
how do you know g(10^4) is 363982 if g(10^6) is wrong and the only hint we're given from PE is for 10^6???
how do you know g(10^4) is 363982 if g(10^6) is wrong and the only hint we're given from PE is for 10^6???
-
william2a
- Posts: 5
- Joined: Sun Oct 19, 2008 11:00 am
Re: Problem 379
@hk: Sorry.
I found the first ten values (1, 3, 3, 5, 3, 9, 3, 7, 5, 9) by brute forcing.
These values gave me the A048691 sequence in OEIS where I found a link to the first 104 values.
A little program in PARI gave me the sum of these values.
I found the first ten values (1, 3, 3, 5, 3, 9, 3, 7, 5, 9) by brute forcing.
These values gave me the A048691 sequence in OEIS where I found a link to the first 104 values.
A little program in PARI gave me the sum of these values.
-
stevcis
- Posts: 3
- Joined: Fri Apr 13, 2012 6:41 am
Re: Problem 379
@ WILLIAM 2a
i'd look carefully at those first 10 values... if your sequence means that 1 is the LCM for 1 pair, 2 is the LCM for 3 pairs, 3 is the LCM for 3 pairs, 4 is the LCM for 5 pairs, then i think careful examination of just the number 2 would suggest there is something wrong with the brute force algorithm.
i get 1,2,2,3,2,5,2,4,3,5 which is the same as yours except your 3s are 2s, your 5s are 3s, your 9s are 5s and your 7s are 4s.
f(10,000) should be 186993 according to my algorithm which correctly gets g(10^6).
btw i have no idea how to solve the actual question but i do get g(10^6). 10^12 is just a darn big number
i'd look carefully at those first 10 values... if your sequence means that 1 is the LCM for 1 pair, 2 is the LCM for 3 pairs, 3 is the LCM for 3 pairs, 4 is the LCM for 5 pairs, then i think careful examination of just the number 2 would suggest there is something wrong with the brute force algorithm.
i get 1,2,2,3,2,5,2,4,3,5 which is the same as yours except your 3s are 2s, your 5s are 3s, your 9s are 5s and your 7s are 4s.
f(10,000) should be 186993 according to my algorithm which correctly gets g(10^6).
btw i have no idea how to solve the actual question but i do get g(10^6). 10^12 is just a darn big number
-
thundre
- Posts: 356
- Joined: Sun Mar 27, 2011 10:01 am
Re: Problem 379
Did you notice the constraint "x ≤ y"? I think your numbers are "right" if you ignore that.william2a wrote:"Somewhere things get wrong"
For g(104 I get 363,982 that's right.
For g(106) I get 73,858,790 which is equal to (2*37,429,395)-106.
I am unable to see where is my mistake.

-
william2a
- Posts: 5
- Joined: Sun Oct 19, 2008 11:00 am
-
Perlkonig
- Posts: 5
- Joined: Tue Aug 21, 2012 3:31 pm
Re: Problem 379
Ack! I get 186991! No idea how I'm going to debug that!stevcis wrote: f(10,000) should be 186993 according to my algorithm which correctly gets g(10^6).
*sighs*
Perlkönig