Skip to main content
2 of 4
deleted 19 characters in body
Business Cat
  • 9.2k
  • 1
  • 17
  • 37

CJam, 22 bytes

ri2,{(_(jAb:+\jAb:++}j

Straightforward recursive algorithm, nothing fancy. 0-indexed.

Try it online! or test for 0-50 (actually runs pretty fast).

Explanation

ri                      Read an integer from input
  2,                    Push the array [0 1]
    {               }j  Recursive block, let's call it j(n), using the input as n and [0 1] as base cases
     (                   Decrement (n-1)
      _(                 Duplicate and decrement again (n-2)
        jAb              Get the list digits of j(n-2)
           :+            Sum them
             \           Swap the top two elements
              jAb        Get the list of digits of j(n-1)
                 :+      Sum them
                   +     Add the two sums
Business Cat
  • 9.2k
  • 1
  • 17
  • 37