Self-hatred

Project Euler Problem #15 (in progress)

Solving this problem requires an understanding of Pascal’s Triangle, “…triangular array of the binomial coefficients in a triangle.”

TL;DR: The integers in each row is equal to the sum of the two above it.

While I still do not have a fully working solution for problem 15, I have written a heavy-handed Pascal’s Triangle generator. It will generate a triangle of up to n rows in size, and write it to a file. Word of warning: If you choose to output more than a handful of rows, you might want to add a sieve to find the highest number, and maybe pick a data container larger than 264 in size if you want more than 67 rows. Just putting that out there.

I know for a fact that far more efficient algorithm’s exist for this: I am working at my own pace, and from my own angle. Give me another day with this.


Categorised as: programming


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>