Problem 643
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.
-
vapor
Problem 643
What does g(100)=1031 mean in this problem?
Update: It seems that setting p<q gives the correct result.
Update: It seems that setting p<q gives the correct result.
Last edited by vapor on Sat Nov 17, 2018 7:27 pm, edited 1 time in total.
- mscha
- Posts: 6
- Joined: Sat Jan 21, 2017 9:55 pm
Re: Problem 643
I get f(10²) = 1037, not 1031, given the definition in the problem.
If I change the definition to require 1 ≤ p < q ≤ n instead of 1 ≤ p ≤ q ≤ n, then I get 1031. (That excludes (2,2), (4,4), (8,8) ... (64,64).)
So which is wrong, the definition or the example?
If I change the definition to require 1 ≤ p < q ≤ n instead of 1 ≤ p ≤ q ≤ n, then I get 1031. (That excludes (2,2), (4,4), (8,8) ... (64,64).)
So which is wrong, the definition or the example?

-
MHealy
- Posts: 40
- Joined: Sat Nov 17, 2012 11:32 pm
Re: Problem 643
The definition is wrong; the example values are correct. (Based on the expected answer.)
Last edited by MHealy on Sat Nov 17, 2018 7:48 pm, edited 1 time in total.

- hk
- Administrator
- Posts: 12832
- Joined: Sun Mar 26, 2006 10:34 am
- Location: Haren, Netherlands
Re: Problem 643
It should read $1\le p\lt q\le n$. Problem edited.

War ruins the life and health of untold numbers of innocent children.
-
vamsikal3
- Posts: 89
- Joined: Sat Oct 01, 2016 9:25 am
Re: Problem 643
<deleted post>
Last edited by vamsikal3 on Wed Nov 25, 2020 4:15 pm, edited 1 time in total.
my friend key --> 990813_OZPwQtCjkD6KlvxirOoTSZxccMFsuw1L


- RobertStanforth
- Administrator
- Posts: 2666
- Joined: Mon Dec 30, 2013 11:25 pm
Re: Problem 643
Thanks, Vamsi. This is fixed now.vamsikal3 wrote: Sun Nov 18, 2018 9:35 am The correct text is: For example, 24 and 40 are 2-friendly because ....
-
Cot-O-Bus
- Posts: 7
- Joined: Thu Sep 27, 2018 10:18 am
-
HashFunction
- Posts: 1
- Joined: Mon Dec 31, 2018 3:01 pm
Re: Problem 643
How come $$gcd(a,b)=2^t,t>0$$ , but with brute force I get f(100) = 1031 when t = 0 , that is $$gcd(a,b) = 2^0 = 1$$ , should t be >= 0 or am I wrong ?
- hk
- Administrator
- Posts: 12832
- Joined: Sun Mar 26, 2006 10:34 am
- Location: Haren, Netherlands
Re: Problem 643
Could it be that your bruteforcer is wrong?

War ruins the life and health of untold numbers of innocent children.
-
Derfellios
- Posts: 3
- Joined: Wed Aug 06, 2025 9:03 pm
Re: Problem 643
This part of the second sentence seems grammatically incorrect to me (a non-native English speaker). I would write... because $\gcd(24,36) = 12 = 2^2\cdot 3$ not a power of $2$.
... because $\gcd(24,36) = 12 = 2^2\cdot 3$ is not a power of $2$.
- RobertStanforth
- Administrator
- Posts: 2666
- Joined: Mon Dec 30, 2013 11:25 pm
Re: Problem 643
Thank you for pointing this out. I have corrected it, inserting the word "is" as you suggested.Derfellios wrote: Sat Oct 04, 2025 2:43 pmThis part of the second sentence seems grammatically incorrect to me (a non-native English speaker). I would write... because $\gcd(24,36) = 12 = 2^2\cdot 3$ not a power of $2$.... because $\gcd(24,36) = 12 = 2^2\cdot 3$ is not a power of $2$.