Problem 2674. Generalised Hamming Number
Inspired by Project Euler n°204 and Problem 1308 by James
A generalised Hamming number of type n, has no prime factor larger than n.
For example a generalised Hamming number of type 5 has no prime factor larger than 5.
Given a number X, determine how many generalised Hamming numbers n are less than or equal to that number. Please note that 1 counts as a Hamming number.
Solution Stats
Problem Comments
-
5 Comments
I like your test suite. Using large X forces a better solution.
Thank you Jonathan. I have discovered this philosophy thanks to James and @bmtran problems.
is there any mathematical algorithm that i dont know about to calculate such big range(10^13)?
i minimized my code as best as i can.still fails for such large number.
why i can't submit my solutions
thuật toán sinh số nhé các em yêu khóa sau nếu chẳng may gặp thầy Hiệp
Solution Comments
Show commentsProblem Recent Solvers351
Suggested Problems
-
2471 Solvers
-
Renaming a field in a structure array
1564 Solvers
-
given 3 sides, find area of this triangle
811 Solvers
-
868 Solvers
-
Remove element(s) from cell array
1880 Solvers
More from this Author43
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!