Cody

# Problem 2674. Generalised Hamming Number

Solution 1884584

Submitted on 26 Jul 2019 by Brian
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
X = 5; n=5; y_correct = 5; assert(isequal(hamming2(X,n),y_correct))

2   Pass
X = 10; n=5; y_correct = 9; assert(isequal(hamming2(X,n),y_correct))

3   Pass
X = 100; n=5; y_correct = 34; assert(isequal(hamming2(X,n),y_correct))

4   Pass
X = 100; n=7; y_correct = 46; assert(isequal(hamming2(X,n),y_correct))

5   Pass
X = 100; n=100; y_correct = 100; assert(isequal(hamming2(X,n),y_correct))

6   Pass
X = 100; n=13; y_correct = 62; assert(isequal(hamming2(X,n),y_correct))

7   Pass
X = 10^13; n=7; y_correct = 19674; assert(isequal(hamming2(X,n),y_correct))

8   Pass
X = 10^5; n=13; y_correct = 1848; assert(isequal(hamming2(X,n),y_correct))

9   Pass
X = 10^5; n=5; y_correct = 313; assert(isequal(hamming2(X,n),y_correct))

10   Pass
X = 123456; n=5; y_correct = 327; assert(isequal(hamming2(X,n),y_correct))

11   Pass
X = 10^13; n=3; y_correct = 624; assert(isequal(hamming2(X,n),y_correct))

12   Pass
X = 123456; n=2; y_correct = 17; assert(isequal(hamming2(X,n),y_correct))
{"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "https://ch.mathworks.com/matlabcentral/cody/problems/2674-generalised-hamming-number/solutions/1884584", "fetch_time": 1591353776000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2020-24/segments/1590348496026.74/warc/CC-MAIN-20200605080742-20200605110742-00208.warc.gz", "warc_record_offset": 284664367, "warc_record_length": 15822, "token_count": 475, "char_count": 1254, "score": 3.515625, "int_score": 4, "crawl": "CC-MAIN-2020-24", "snapshot_type": "latest", "language": "en", "language_score": 0.5315296649932861, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00056-of-00064.parquet"}