The second Project Euler problem - Even Fibonacci Numbers - is stated as follows - By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.

```
function isEven(n:number): boolean {
return n % 2 === 0;
}
function *fibonacci(target:number) {
let current = 1;
let next = 2;
while (current < target) {
yield current;
[current, next] = [next, current + next];
}
}
function sum(previous:number, current:number):number {
return previous + current;
}
function solve(target:number):number {
// Generate a fibonacci sequence with all
// numbers below 4 000 000.
return [...fibonacci(target)]
// Keep all even numbers.
.filter(isEven)
// Sum the remaining numbers.
.reduce(sum);
}
solve(4000000)
```

The first Project Euler problem - Multiples of 3 and 5 - is stated as follows. Find the sum of all the multiples of 3 or 5 below 1000.

```
function isMultiple(n:number): boolean {
return n % 3 === 0 || n % 5 === 0;
}
function sum(previous: number, current: number): number {
return previous + current;
}
function range(size:number):number[] {
return [...Array.from({length: size})]
.map((_:any, index:number):number => index + 1);
}
function solve(target: number): number {
// Create a range between 1 and 999.
return range(target)
// Keep all multiples of 3 or 5.
.filter(isMultiple)
// Sum the remaining numbers.
.reduce(sum);
}
solve(999);
```

Inspired by Mathologer’s video Times Tables, Mandelbrot and the Heart of Mathematics I have done a lot of mandala-like drawings on my Axidraw A3/V3 plotter.

Almost all my pieces are generated using the Javascript tool below I created. The source code is on Github.

Play around with the sliders or try these configurations Wave, Lighthouse, Sunrise, Lotus Flower, Ring, Overlapping Cardioids, Flower, Flower II. Reset.

The fire effect in the Doom intro recently got renewed attention due to Fabien Sanglard’s excellent book Game Engine Black Book: DOOM and blog post How Doom Fire was Done.

After looking through a couple of implementations, and realizing that the effect is achieved using very little code I decided create my own.

The original algorithm can be used to create a lot of things if you feed it with different variables and have a bit of imagination.

Play around with the sliders or try these configurations Umbrella, Rain, Fire, Mona Lisa, Fireball, Beam me up, Matrix

The mask is a 256x256 gif image where bright pixels marks the source(s) of the effect. The fire, has just a line in the bottom and the rain is just a line in the top.

The source code is on Github.

The FiveThirtyEight riddle Tyler Barron’s Seven Segment Display is stated as follows.

Given a two-character, seven-segment display, like you might find on a microwave clock, how many numbers can you make that are not ambiguous if the display happens to be upside down?

For example, the number 81 on that display would not fit this criterion — if the display were upside down it’d appear like 18. The number 71, however, would be OK. It’d appear something like 1L — not a number.

```
// Rotates a single seven-segment display digit 180 degrees.
// Non number results are converted to NaN.. eg. 2 --> 2, 6 --> 9, 3 --> NaN
const rotateDigit = n => [0, 1, 2, NaN, NaN, 5, 9, NaN, 8, 6][n];
// Rotates a seven-segment display number 180 degrees.
// eg. 10 --> 01, 81 --> 18, 71 --> 1NaN.
const rotateNumber = n =>
// Convert the number to a string.
n.toString()
// Split the string on every character.
.split('')
// Reverse the order of the characters
.reverse()
// Rotate the digits.
.map(rotateDigit)
// Convert the array back to a string.
.join('');
const numbers =
// Generate a range from 0 to 99.
[...Array(100).keys()]
// Rotate every number.
.map(rotateNumber)
// Filter every number that is not a number. :)
.filter(isNaN)
const result = numbers.length;
```

- New Year's Resolution 2019
- Project Euler 22 - Names Scores - Solved with JavaScript
- Project Euler 21 - Amicable Numbers - Solved with JavaScript
- Project Euler 20 - Factorial Digit Sum - Solved with JavaScript
- Project Euler 19 - Counting Sundays - Solved with JavaScript
- Project Euler 18 & 67 - Maximum Path Sum - Solved with JavaScript
- Project Euler 1 - Multiples of 3 or 5 - Solved with Matlab
- Project Euler 3 - Largest Prime Factor - Solved with C#
- Project Euler 2 - Even Fibonacci Numbers - Solved with C#
- Project Euler 1 - Multiples of 3 or 5 - Solved with C#
- Project Euler 2 - Even Fibonacci Numbers - Solved with F#
- Project Euler 1 - Multiples of 3 or 5 - Solved with F#
- RoboRackers™ - Riddle by FiveThirtyEight - Solved with JavaScript
- Project Euler Problem 17 - Number Letter Counts - solved with R
- Project Euler Problem 16 - Power Digit Sum - solved with Javascript
- Project Euler Problem 15 - Lattice Paths - solved with R
- Finding the 10001st prime with R
- Find longest Collatz sequence using Javascript
- Sum large numbers with Kotlin versus Javascript
- What is a binary tree and how to invert it using Kotlin
- Find Highly Divisible Triangular Numbers with Kotlin
- Find the Largest Product in a Grid with Rust
- Summation of the First Two Million Primes with Rust
- Finding the largest product in a series with Rust
- Finding the 10001st prime with Rust
- The complete list of rational numbers with Stern-Brocot and Javascript
- Smallest positive number that is evenly divisible by all of the numbers from 1 to 20 with Rust
- Find the difference between the square of the sum and the sum of the squares for the first hundred numbers
- Finding the largest palindrome product with Rust
- Project Euler 3 - Largest Prime Factor - Solved with Reason
- Project Euler 2 - Even Fibonacci Numbers - Solved with Ocaml
- Project Euler 1 - Multiples of 3 or 5 - Solved with Ocaml
- Special Pythagorean Triplet solved with Reason
- New Year's Resolution 2018