Skip to content

Instantly share code, notes, and snippets.

@jsomers
Created February 26, 2011 19:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsomers/845502 to your computer and use it in GitHub Desktop.
Save jsomers/845502 to your computer and use it in GitHub Desktop.
A solution to Project Euler problem #191
# [n, tot, -AA, 0Ls, -A, 1L-AA, 1L-A, 1LnotA]
lst = [1, 3, 0, 2, 1, 0, 0, 1]
while lst[0] < 30
n, t, a, b, c, d, e, f = lst
lst = [n + 1, 2 * t + b - a, c, 2 * b - a + d, t - (a + c), e, f, t]
end
p lst[1] # => 1918080160
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment