T
T
TheSnegok2021-08-26 14:36:16
Algorithms
TheSnegok, 2021-08-26 14:36:16

How to understand hamming numbers on fingers?

I can’t understand this, please describe the algorithm in js or explain?
The Hamming number is a natural number of the form 2i3j5k for some non-negative integers i, j and k.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2021-08-26
@TheSnegok

Not 2i3j5k, but 2 i ×3 j ×5 k
This means that when factoring a number into prime factors, we get only 2, 3 and 5.
1 = 2 0 ×3 0 ×5 0
3 = 2 0 ×3 1 ×5 0
15 = 2 0 ×3 1 ×5 1
30 = 2 1 ×3 1 ×5 1
60 = 2 2 ×3 1 ×5 1
90 = 2 1 ×3 2 ×5 1
etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question