Questions tagged [hamming-numbers]

Hamming Numbers are numbers whose only prime factors are 2, 3 and 5. They are named after Richard Hamming but became famous (or notorious) after Edsger Dijkstra posed the question of how to efficiently enumerate them in numeric order.

Hamming Numbers (a.k.a. regular numbers) are numbers whose only prime factors are 2, 3 and 5. They are named after Richard Hamming but became famous (or notorious) after Edsger Dijkstra posed the question, and proposed a solution, of how to efficiently enumerate them in increasing numeric order:

  • 1 is a Hamming number.
  • If n is a Hamming number, then so are 2*n, 3*n, and 5*n.

They are a particular case of more general smooth numbers.

See also .

34 questions
-1
votes
1 answer

How to determine if given number is Hamming number by combining two functions in JavaScript?

The goal is to determine if a number is Hamming number?! As we know Hamming number is a number that contains only 2, 3 and 5 as factors. That means that a number must not contain any prime number greater than 5! So I created a function isPrimeNumber…
Ivan Vrzogic
  • 157
  • 1
  • 8
-1
votes
3 answers

How can I convert hamming number code in a while or for loop python

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 …
-4
votes
2 answers

1 billionth ugly or hamming number?

Is this the 1 billionth ugly/hamming…
mincedmeat
  • 15
  • 1
-6
votes
1 answer

Need help finding nth regular number

Problem: "Babylonians use regular numbers to keep time. A "regular number" in math is defined to be a number that is a factor of some power of 60 (60, 3600, etc). Equivalently we can say that a regular number is one whose ONLY prime divisors are 2,…
jahnpahl
  • 19
  • 1
1 2
3