Skip to content

Instantly share code, notes, and snippets.

@timhuff
Last active September 13, 2016 01:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timhuff/57309ab3d24a468a05eac65824c2b8d5 to your computer and use it in GitHub Desktop.
Save timhuff/57309ab3d24a468a05eac65824c2b8d5 to your computer and use it in GitHub Desktop.
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