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?

## Problem 581

**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 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.

- Oliver1978
**Posts:**166**Joined:**Sat Nov 22, 2014 9:13 pm**Location:**Erfurt, Germany

### Problem 581

49.157.5694.1125

### 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.

### Re: Problem 581

Yes - The total fits into 42 bit.

The intermediates of your algorithm should also fit. - If not, think of it.

The intermediates of your algorithm should also fit. - If not, think of it.

### 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!

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!

### Re: Problem 581

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

### Re: Problem 581

@AdamCapo:

The solutions, you provided works all with 32Bit Integers.

But numbers which are smooth to a higher prime need 64Bit.

The solutions, you provided works all with 32Bit Integers.

But numbers which are smooth to a higher prime need 64Bit.

### 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.

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.