Enigmas

Aew galera… Peço a ajuda de quem conseguir quebrar isto:

28657-28657-28657-.-2584-21-5-21-377-233-2584-377-89-6765-4181-21-377-233-.-1-377-144-/-1-377-2-3-46368

:slight_smile:

[quote=d34d_d3v1l]Aew galera… Peço a ajuda de quem conseguir quebrar isto:

28657-28657-28657-.-2584-21-5-21-377-233-2584-377-89-6765-4181-21-377-233-.-1-377-144-/-1-377-2-3-46368

:)[/quote]

vi logo no “com = 1-377-144” que estes valores são os mesmo de phi (aureo).
só que acho que não deveria começar com xxx, mas sim com www


<script>


	function replaceAll(str, de, para) 
	{
		var pos = str.indexOf(de);
		while (pos > -1)
		{
			str = str.replace(de, para);
			pos = str.indexOf(de);
		}
		return (str);
	}

	// Phi and phi conjugate  
	// Phi * phi = 1  
	var Phi= (1+Math.sqrt(5))/2;  
	var phi= (1-Math.sqrt(5))/2;   
  
	// Find the n number Fibonacci where sequence starting with 0  
	function Fib(n)  
	{  
	    return Math.round(( Math.pow(Phi, n) - Math.pow(phi, n) ) / Math.sqrt(5));  
	}  

	//http://www.guj.com.br/java/136868-project-euler
	// Find position n of the value where Fib(n)=value  
	function FindPosition(value)  
	{  
	    return Math.floor(Math.log(value*Math.sqrt(5))/Math.log(Phi));  
	} 

	var txt = "-28657-28657-28657-.-2584-21-5-21-377-233-2584-377-89-6765-4181-21-377-233-.-1-377-144-/-1-377-2-3-46368-";
	



	for(i=0; i<26; i++)
	{
		var x = "-"+Fib(i)+"-";
		var y = "-"+String.fromCharCode(97 + i)+"-";
		txt = replaceAll(txt, x, y ); 
		
	}

		txt = replaceAll(txt, "-", "" ); 

	document.write( txt ); 

</script>