1 min read

APL Hacking: Project Euler (#25)

Problem #25:

⍝ What is the first fibonnacci term to contain 1,000 digits?
D←1000000000 ⍝ Use nine-digit numbers.
A←B←X←¯112↑1 ⍝ Need 112 9-digit numbers to get 1,000 digits.
LP:A←B ⋄ B←X ⋄ I←I+1 ⋄ X←⊃(D CARRY)/A+B ⋄ →(0=↑X)/LP

This one is just brute force using my existing CARRY algorithm that you can see in my previous posts.