We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.

# Project Euler #204: Generalised Hamming Numbers

# Project Euler #204: Generalised Hamming Numbers

+ 0 comments def is_hamming_numbers(x):`

`if x == 1: return 1 if x % 2 == 0: return is_hamming_numbers(x / 2) if x % 3 == 0: return is_hamming_numbers(x / 3) if x % 5 == 0: return is_hamming_numbers(x / 5) return 0`

c = 1

for i in range(1, 100000000): if is_hamming_numbers(i) == True:

I am getting timeout errors here

`c += 1`

print(c) `

[deleted] + 0 comments can anyone tell me language with low compilation time

+ 0 comments I cannot get my output printed. It says terminated due to timeout but i dont understand why thats happening? Can any1 help me out? What could be the reason?

+ 1 comment can someone paste code here my code is passing only 1 test case other test cases are terminated due to time out

+ 0 comments I get timeout exception in my code. Im using java 8 and I only can get 44.0 scores. Can somebody help me to understand better the behavior of this problem? I cant see any other patterns.

Load more conversations

Sort 12 Discussions, By:

Please Login in order to post a comment