Write a PHP program to get the Hamming numbers upto a given numbers also check whether a given number is a Hamming number.
Input : 1
Hamming numbers are numbers of the form
H = 2i × 3j × 5k
Where i, j, k ≥ 0
The sequence of Hamming numbers 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, 24, 25, 27 ... consists of all numbers of the form 2i•3j•5k where i, j and k are non-negative integers.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer