Skip to content

Instantly share code, notes, and snippets.

@brito
Created June 20, 2016 00:51
Show Gist options
  • Save brito/b90b45c083f66217b271727c2f5b8ceb to your computer and use it in GitHub Desktop.
Save brito/b90b45c083f66217b271727c2f5b8ceb to your computer and use it in GitHub Desktop.
The powers of Phi conjugated into whole numbers also converge to Phi
// For any even integer n:
// Phi^n + 1/Phi^n = a whole number
// For any odd integer n:
// Phi n – 1 / Phi n = a whole number
// goldennumber.net/powers-of-phi
function Rephiprocal(x,n){
var P = .5+Math.sqrt(5)/2,
R=Math.pow(P,n);
return R + Math.pow(-1,n)/R;
}
// Array.reduce functor
function Raphio(array, next){
var last = array[array.length-1];
console.info(next +'/'+ last, next/last);
return [last/next, next]
}
//@return an array with digits from 0 to n
function Gen(n){
return (new Array(n)).join().split(',');
}
if ('run')
Gen(511)
.map(Rephiprocal)
.reduce(Raphio, [1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment