Sum the First n Even Fibonacci Numbers There seems not to be a contest for this one yet.

The task is simple. Add the first n numbers of the Fibonacci sequence that are even and output the result.

This is given by OEIS A099919, except that sequence is shifted by one, starting with fib(1) = 0 instead of fib(1) = 1.

This is code golf. Lowest byte count wins.

Examples

n sum
1 0
2 2
3 10
4 44
5 188
6 798
7 3382
8 14328
9 60696




Related
Python, 33 bytes



c=2+5**.5
lambda n:(7-c)*c**n//20


Try it online

Magic formula!