Last active
September 13, 2016 01:48
-
-
Save timhuff/57309ab3d24a468a05eac65824c2b8d5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
y = function(b){ | |
nums = [] | |
for(i=0; i<=Math.floor(Math.log(b)/Math.log(2)); i++) | |
nums.push(i); | |
d = nums.reduce(function(n, a){1<<n&b?3+a:4+a},0) | |
if(b == d) | |
return b | |
else | |
return y(b) | |
} | |
H = {} | |
series = [] | |
for(i=0; i<100; i++){ | |
f = y(i) | |
if(!H[f]) | |
H[f] = 0 | |
H[f]++ | |
} | |
console.log(H) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment