Factorial function is simple enough. But there is still some fun about it. In Stirling’s Approximation article we’ve seen how to calculate good factorial approximation faster than exact value. By the way, there is an algorithm to calculate exact value of factorial faster than “by definition”.
Clojure Euler: Problem 018
By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23.
1 2 3 4 | |
That is, 3 + 7 + 4 + 9 = 23.
Find the maximum total from top to bottom of the triangle below:
[Check out big triangle in original link]
NOTE: As there are only 16384 routes, it is possible to solve this problem by trying every route. However, Problem 67, is the same challenge with a triangle containing one-hundred rows; it cannot be solved by brute force, and requires a clever method! ;o)
Permalink: http://projecteuler.net/problem=18
Programming Digest 2
Why math is needed for developers, what is REST, how to become experienced developer…in 10 years, “coding it’s just writing” and some practice: Naive Bayes Classifier, functional programming and Java 8.
Clojure Euler: Problem 017
If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total.
If all the numbers from 1 to 1000 (one thousand) inclusive were written out in words, how many letters would be used?
Permalink: http://projecteuler.net/problem=17
Code Golf: Game of Life
Conway’s Game of Life in a tweet.
Clojure Euler: Problem 016
2^15 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.
What is the sum of the digits of the number 2^1000 ?
Permalink: http://projecteuler.net/problem=16
Java Magic. Part 4: sun.misc.Unsafe
Java is a safe programming language and prevents programmer
from doing a lot of stupid mistakes, most of which based on memory management.
But, there is a way to do such mistakes intentionally, using Unsafe class.
This article is a quick overview of sun.misc.Unsafe public API and few
interesting cases of its usage.
Elephant-Oriented Programming
Have you heard about Elephant-Oriented Programming?
Stirling’s Approximation
Do you like factorials?
Probably, you do. If no, whatever, read this post to know how get rid of factorials.
Heisenberg Principle
It is so obvious, so I decided to write about it.