Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Nayuki Minase
file 15 lines (11 sloc) 0.326 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14
(*
 * Solution to Project Euler problem 2
 * By Nayuki Minase
 *
 * http://nayuki.eigenstate.org/page/project-euler-solutions
 * https://github.com/nayuki/Project-Euler-solutions
 *)


(* Use this in Wolfram Mathematica *)

sum = 0;
For[i = 0, Fibonacci[i] <= 4000000, i++, If[EvenQ[Fibonacci[i]], sum += Fibonacci[i]]]
sum
Something went wrong with that request. Please try again.