## Project Euler 37: Find the sum of all eleven primes that are both truncatable from left to right and right to left

A new type of prime numbers are the focus of Problem 37 of Project Euler. This time the type of prime numbers is truncatable primes. I have never heard of this type of primes before, but the problem description gives a good explanation.

The number 3797 has an interesting property. Being prime itself, it is possible to continuously remove digits from left to right, and remain prime at each stage: 3797, 797, 97, and 7. Similarly we can work from right to left: 3797, 379, 37, and 3.

Find the sum of the only eleven primes that are both truncatable from left to right and right to left.

NOTE: 2, 3, 5, and 7 are not considered to be truncatable primes.

Posted by Kristian in Project Euler, 18 comments

## Tricks for multiplying large numbers

Recently I saw a video with a small trick for easily squaring a 2-3 digit number. Unfortunately I haven’t been able to find it again, but if you have seen the video with the trick somewhere feel free to link it in the comments or tell me about it if you just know the trick. It was really neat.

What I did find when I searched for it was another small trick for graphically multiplying large numbers, so this is what you get for now.

If you know some good tricks for making calculations easier when you are standing with a pen and a piece of paper, or just mental calculation. Please share them with me, it is so much easier than having to find a calculator for everything.

Posted by Kristian in Math, 3 comments

## Project Euler 36: Find the sum of all numbers less than one million, which are palindromic in base 10 and base 2

In Problem 36 of Project Euler we are revisiting palindromic numbers. This time with we need to find numbers which are not only palindromic in base 10 but also in base two, meaning in a binary representation. The problem description reads

The decimal number, 585 = 10010010012 (binary), is palindromic in both bases.

Find the sum of all numbers, less than one million, which are palindromic in base 10 and base 2.

(Please note that the palindromic number, in either base, may not include leading zeros.)

Posted by Kristian in Project Euler, 14 comments

## Project Euler 35: How many circular primes are there below one million?

In problem 35 of Project Euler we are back to primes., this time it is circular primes that we are focusing on. Before looking more at circular primes lets look at the problem description which reads:

The number, 197, is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime.

There are thirteen such primes below 100: 2, 3, 5, 7, 11, 13, 17, 31, 37, 71, 73, 79, and 97.

How many circular primes are there below one million?

Posted by Kristian in Project Euler, 9 comments

## Project Euler 34: Find the sum of all numbers which are equal to the sum of the factorial of their digits

The headline of Problem 34 of Project Euler triggered something in me and I found it oddly familiar. I didn’t quite know what it was until a few minutes later where it dawned on me that it was very similar to Problem 30. The problem description is short and reads:

145 is a curious number, as 1! + 4! + 5! = 1 + 24 + 120 = 145.

Find the sum of all numbers which are equal to the sum of the factorial of their digits.

Note: as 1! = 1 and 2! = 2 are not sums they are not included.

Where the solution to Problem 30 is about the sum of the fifth power of the digits, this is about the sum of factorials of the digits.

I could copy paste the text from the solution to problem 30, but let me change the focus a bit. We can establish an upper bound of the problem by figuring out that 9!7 = 2540160 which is the upper limit. There is no possible higher value since 9!8 also results in a 7 digit number. First I will make a solution almost similar to the aforementioned solution, and later on I will speed it up, by pre-calculating the factorial. Continue reading →

Posted by Kristian in Project Euler, 28 comments

## Math Jokes

There are jokes about everything out there and science is no exceptions. Often it is fairly easy to make jokes about mathematicians. I got a few sent from a friend, and decided to compile a few of my favourites in a post for you.

#### A few qoutes

Mathematics is the art of giving the same name to different things. — J. H. Poincare

Mathematicians are like Frenchmen: whatever you say to them, they translate it into their own language, and forthwith it means something entirely different. — Goethe

Medicine makes people ill, mathematics make them sad and theology makes them sinful. — Martin Luther Continue reading →

Posted by Kristian in Other, 0 comments

## Project Euler 33: Discover all the fractions with an unorthodox cancelling method

Problem 33 of Project Euler is a really fun little problem.  At least I think so. It reads

The fraction 49/98 is a curious fraction, as an inexperienced mathematician in attempting to simplify it may incorrectly believe that 49/98 = 4/8, which is correct, is obtained by cancelling the 9s.

We shall consider fractions like, 30/50 = 3/5, to be trivial examples.

There are exactly four non-trivial examples of this type of fraction, less than one in value, and containing two digits in the numerator and denominator.

If the product of these four fractions is given in its lowest common terms, find the value of the denominator.

The problem itself is rather easy to solve using brute force since there are less than 90*90 = 8100 possible solutions we would have to check. Each check is fairly easy to perform and thus we would be able to brute force comfortably within the 1 minute range. Continue reading →

Posted by Kristian in Project Euler, 10 comments

## Project Euler 32: Find the sum of all numbers that can be written as pandigital products

Problem 32 of Project Euler is about a special kind of number – Pandigital numbers. Something I haven’t heard about before, but they are very much used in commercials as phone and credit card numbers. The problem reads

We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once; for example, the 5-digit number, 15234, is 1 through 5 pandigital.

The product 7254 is unusual, as the identity, 39 x 186 = 7254, containing multiplicand, multiplier, and product is 1 through 9 pandigital.

Find the sum of all products whose multiplicand/multiplier/product identity can be written as a 1 through 9 pandigital.
HINT: Some products can be obtained in more than one way so be sure to only include it once in your sum.

Posted by Kristian in Project Euler, 14 comments

## Video on Difference Quotient

A few weeks ago I stumbled on a few videos on YouTube showing me something valuable. It is three videos telling about derivatives, one of the fundamentals of calculus.

The videos come from Mathtv.com which is a website with a ton of good explanatory videos on different math topics. I have only watched a few of them, but I am really impressed at the way they explain it. They have a channel on YouTube where there are a lot of videos, some which I haven’t found on the website, so check out both places. I think you will share my enthusiasm about the site once you see these videos. They also have a YouTube channel which seems to have a slightly different set of videos in them. Continue reading →

Posted by Kristian in Math, 0 comments

## Project Euler 31: Investigating combinations of English currency denominations

Problem 31 of Project Euler honestly baffled me for a while. That lasted until I realised that there is a simple brute force solution. But enough blabbering, the problem reads

In England the currency is made up of pound, £, and pence, p, and there are eight coins in general circulation:

1p, 2p, 5p, 10p, 20p, 50p, £1 (100p) and £2 (200p).It is possible to make £2 in the following way:

1x£1 + 1x50p + 2x20p + 1x5p + 1x2p + 3x1p

How many different ways can £2 be made using any number of coins?

Posted by Kristian in Project Euler, 31 comments