Author 
Message 
Panphobia

Posted: Wed Dec 26, 2012 5:38 pm Post subject: Project Euler Question 104 


For question 104 in project euler they are asking to see when a fibonacci number starts and ends in a pandigital sequence, so the beginning is 19 and the end is 19, what i thought of doing what using the fibonacci sequence Fk = Fk1+Fk2 % (anything past the last nine digits) to see if the last nine digits are pandigital, and using binets formula to generate the first 9 numbers by doing Math.floor(Fk/(what ever is past the 9th number)) and then seeing if they are both pandigital and then moving on to the next until you find it, my trouble is with finding what to mod and divide by, could I calculate the numbers in a biginteger and then make it a string and substring the first nine and last nine, or is there a way to calculate what you need to divide and mod it by? 





Sponsor Sponsor



A.J

Posted: Wed Dec 26, 2012 5:42 pm Post subject: RE:Project Euler Question 104 


Notice that the last k digits of a number is the remainder you get when you divide that number by 10^k. Something similar could be applied for getting the first 9 digits. 





Panphobia

Posted: Wed Dec 26, 2012 5:43 pm Post subject: RE:Project Euler Question 104 


ahhh thanks AJ 





QuantumPhysics

Posted: Wed Dec 26, 2012 11:06 pm Post subject: RE:Project Euler Question 104 


Did you solve it or do you still need help? 





Panphobia

Posted: Thu Dec 27, 2012 12:50 am Post subject: RE:Project Euler Question 104 


Solved but thanks 





