Computer Science Canada

Project Euler Question 104

Author:  Panphobia [ 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 1-9 and the end is 1-9, what i thought of doing what using the fibonacci sequence Fk = Fk-1+Fk-2 % (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?

Author:  A.J [ 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.

Author:  Panphobia [ Wed Dec 26, 2012 5:43 pm ]
Post subject:  RE:Project Euler Question 104

ahhh thanks AJ Smile

Author:  QuantumPhysics [ Wed Dec 26, 2012 11:06 pm ]
Post subject:  RE:Project Euler Question 104

Did you solve it or do you still need help?

Author:  Panphobia [ Thu Dec 27, 2012 12:50 am ]
Post subject:  RE:Project Euler Question 104

Solved but thanks


: