Problem 193
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.
-
Dennen
- Posts: 4
- Joined: Tue May 13, 2008 2:00 am
P193 Hint on squarefree numbers
Could I get a hint on problem 193 (find all square free numbers below 2^50). I've tried to come up with lots of solutions (combinatorics / dynamic programming / recurrenses) but nothing seems to be fast enough.
- rayfil
- Administrator
- Posts: 1412
- Joined: Sun Mar 26, 2006 5:30 am
- Location: Quebec, Canada
- Contact:
Re: Hint on squarefree numbers
Just do it as fast as you possibly can and then learn from the forum how you could do it faster.
When you assume something, you risk being wrong half the time.
-
Dennen
- Posts: 4
- Joined: Tue May 13, 2008 2:00 am
Re: Hint on squarefree numbers
Well it's probably too slow to do within any reasonable time (about a day or so). Just wondered if anyone had any small hint.
- daniel.is.fischer
- Posts: 2400
- Joined: Sun Sep 02, 2007 11:15 pm
- Location: Bremen, Germany
Re: Hint on squarefree numbers
I'm afraid any hint would be too big.
Il faut respecter la montagne -- c'est pourquoi les gypaètes sont là.
-
Dennen
- Posts: 4
- Joined: Tue May 13, 2008 2:00 am
Re: Hint on squarefree numbers
Well, at least, should I continue on the same way as before? Or try to come up with something new? I've thinking about doing something with the primes below 2^25 but it stills gets too slow. I suppose I need to use some combinatorics, since the number of squarefree integers is pretty large (I cant "create" them)
- daniel.is.fischer
- Posts: 2400
- Joined: Sun Sep 02, 2007 11:15 pm
- Location: Bremen, Germany
Re: Hint on squarefree numbers
You could PM me an outline of your ideas and I'd look which are useful.
Il faut respecter la montagne -- c'est pourquoi les gypaètes sont là.
-
Dennen
- Posts: 4
- Joined: Tue May 13, 2008 2:00 am
-
sedefcho
- Posts: 4
- Joined: Fri Mar 14, 2008 6:08 pm
- Location: Sofia, Bulgaria
Problem 193
I am still far from solving problem 193
But I hope it is OK to ask the following.
Can someone confirm that the count
of the squarefree numbers below
k = 40000000 (below 40 million) is 24317053.
And is the count of squarefree numbers
below k = 15000000 (below 15 million) 9118889 ?
Thanks in advance.
But I hope it is OK to ask the following.
Can someone confirm that the count
of the squarefree numbers below
k = 40000000 (below 40 million) is 24317053.
And is the count of squarefree numbers
below k = 15000000 (below 15 million) 9118889 ?
Thanks in advance.
- stijn263
- Posts: 1505
- Joined: Sat Sep 15, 2007 11:57 pm
- Location: Netherlands
-
sedefcho
- Posts: 4
- Joined: Fri Mar 14, 2008 6:08 pm
- Location: Sofia, Bulgaria
- Assato
- Posts: 13
- Joined: Sun Apr 19, 2009 4:21 pm
Re: Problem 193
My program gives the right answer for 4e7 and 15e6 (as posted above), as well as for some other small numbers I tested (and counted the number of squarefrees manually), but it doesn't work for 2^50...
can anyone confirm these?
652756723 for 2^30
668422917419 for 2^40
Thanks...
can anyone confirm these?
652756723 for 2^30
668422917419 for 2^40
Thanks...
- Assato
- Posts: 13
- Joined: Sun Apr 19, 2009 4:21 pm
Re: Problem 193
Nevermind, it worked... turns out result was off by 1.
Can anyone still confirm the numbers above? Not sure what caused them to be off by 1 sometimes and sometimes not...
EDIT: I think I found it... The 2^30 was also off by 1 (652756722) right?
Can anyone still confirm the numbers above? Not sure what caused them to be off by 1 sometimes and sometimes not...
EDIT: I think I found it... The 2^30 was also off by 1 (652756722) right?
- Tommy137
- Posts: 238
- Joined: Sun Feb 24, 2008 6:02 pm
- Location: Cologne, Germany
- Contact:
-
axelbrz
- Posts: 51
- Joined: Mon Sep 08, 2008 5:34 am
Re: Problem 193
Hi, I got 652756722 for 230 and 668422917419 for 240 too, but I'm getting a wrong answer for 250.
Can anybody tell me if is 21389533354941 correct for 245?
Thanks!
Can anybody tell me if is 21389533354941 correct for 245?
Thanks!
"think(O(n))+O(n) sometimes is better than think(O(1))+O(1)"


- stijn263
- Posts: 1505
- Joined: Sat Sep 15, 2007 11:57 pm
- Location: Netherlands
Re: Problem 193
That's not what I get. Think about what could go wrong with your method for higher limits. Overflow? Or something else? Good luck!
-
axelbrz
- Posts: 51
- Joined: Mon Sep 08, 2008 5:34 am
Re: Problem 193
Yes! It was overflow! 
Thank you!
Thank you!
"think(O(n))+O(n) sometimes is better than think(O(1))+O(1)"


