## Problem 581

A place to air possible concerns or difficulties in understanding ProjectEuler problems. This forum is not meant to publish solutions. This forum is NOT meant to discuss solution methods or giving hints how a problem can be solved.
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.

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 post any spoilers
Oliver1978
Posts: 166
Joined: Sat Nov 22, 2014 9:13 pm
Location: Erfurt, Germany

### Problem 581

The problem and its description are pretty much straight forward. A brute-force algorithm may work for p-smooth numbers with small p. I've tried something different and tried several sets of primes [2, 3...]. Following the description of this problem, might I ask if I'm right with the following: the sum of Hamming numbers being 3 digits long ending with ..1; also for 7-smooth numbers the result is 4 digits long ending with ..3; and furthermore for 11-smooth numbers the result is 5 digits long and ending with ..91.

Is this correct so far?
49.157.5694.1125

v6ph1
Posts: 120
Joined: Mon Aug 25, 2014 6:14 pm

### Re: Problem 581

Yes - it is.

mdean
Posts: 156
Joined: Tue Aug 02, 2011 1:05 am

### Re: Problem 581

Does this solution really fit into a 64-bit integer? Because I foresee having to test some huge numbers for this problem. For now, I'll start small and work my way up.

v6ph1
Posts: 120
Joined: Mon Aug 25, 2014 6:14 pm

### Re: Problem 581

Yes - The total fits into 42 bit.
The intermediates of your algorithm should also fit. - If not, think of it.

Posts: 2
Joined: Mon May 08, 2017 5:23 pm

### Re: Problem 581

Hello,

I was hoping someone could help me out by giving me some more test cases to help me see where I am going wrong.

From another site, I was able to get the solutions for 2,3,5,7,11,13 and 17 smooth numbers (snipped by moderator) and my code works fine for all them. However, somewhere between the 17-smooth solution and the 47-smooth solution there is a problem in my code that I can't seem to figure out. Based on the previous posts I don't believe it is a memory issue, but I could be wrong.

Thanks!

hk
Posts: 10697
Joined: Sun Mar 26, 2006 9:34 am
Location: Haren, Netherlands

### Re: Problem 581

This forum isn't meant to provide (partial) answers to problems.

v6ph1
Posts: 120
Joined: Mon Aug 25, 2014 6:14 pm

### Re: Problem 581

The solutions, you provided works all with 32Bit Integers.
But numbers which are smooth to a higher prime need 64Bit.

Posts: 2
Joined: Mon May 08, 2017 5:23 pm

### Re: Problem 581

I apologize for asking for information that wasn't allowed. I had seen in other parts of the forum people asking/receiving test values, so I thought I was OK.

As for my error, it turned out to be a basic misunderstanding of how to use a theorem. Since my limit was so high, it didn't cause an issue for lower p-smooth numbers, but became apparent higher up.

hk