KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums kdb+ Fastest Fibonacci sequence generator Re: Fastest Fibonacci sequence generator

  • jfealy

    Member
    February 13, 2024 at 12:00 am

    Arthur’s K solution for first n+1 numbers

    k)n(|+) 1 fib:{x,sum -2#x}/[;0 1] // first n+2 aq:{first flip x(reverse sums::) 1} 
    // first n+1 
    q)ts fib 100000 1359 2097392 
    q) 
    q) 
    q)ts aq 100000 14 6345952