Skip to content

jhinrichsen/euler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Euler Solutions

NPM
Standard

Travis build status bithound ES2015 semantic-release

Yet another Euler - this time in Javascript

Features all 2016 Javascript/ Node.js buzzwords:

  • ES2015 (formerly ES6)

  • functional

  • immutable data

  • lazy sequences

Solved so far:

  • #1 (3 lines)

  • #16 (5 lines)

  • #19 (5 lines)

  • #20 (3 + 5 lines)

  • #48 (8 lines)

  • #92 (4 + 7 lines)

Alternative implementations

Euler #92

// :: Number -> Number
// Slow: takes about 90 seconds on a 2013 MacBook Pro
const euler92_ = (n) => I.Range(1, n)
  .map((n) => I.Seq(squareDigitChain(n)).last())
  // 10 % faster, but mutation going on:
  // .map((n) => [...squareDigitChain(n)].pop())
  .filter((n) => n === 89)
  .count()

About

Yet another Euler - this time in ES2015

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published