Project Euler — problem 24

It’s a lovely day. I took a walk around the campus after lunch. The scene was enjoyable in one deep autumn day. Before the afternoon work, I’d like to spend a few moments on the 24th Euler Problem. A permutation is an ordered arrangement of objects. For example, 3124 is one … Continue reading

Project Euler — problem 23

Officially, it’s weekend. I’m solving this 23rd Euler problem just before my supper. A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. For example, the sum of the proper divisors of 28 would be 1 + 2 + 4 + 7 + 14 = 28, which means … Continue reading

Project Euler — problem 22

Just had my supper. Stomach is full of stewed beef and potato.  I’d like to solve the 22nd Euler problem before tonight work (right, I’ll work late in my office). Using names.txt (right click and ‘Save Link/Target As…’), a 46K text file containing over … Continue reading

Project Euler — problem 21

It’s been over one month since my last post on Euler problem 20, when  I was planning to post at least one on either Euler project or visualization. So I am four posts behind; I’ll try to catch up. Tonight, I’ll solve the 21st Euler problem. Let’s take a look. Let d(n) … Continue reading

Project Euler — problem 20

It’s been quite a while since my last post on Euler problems. Today a visitor post his solution to the second problem nicely, which encouraged me to keep solving these problems. Just for fun! 10! = 10 * 9 * … * 3 * 2 * 1 = 3628800, and the sum of the digits in the number 10! is 3 … Continue reading

Project Euler — problem 19

I’ve been working overtime last weekend. Although I suffered little from the Monday syndrome, I still need a break. So, I’m back to the Project Euler after days of Olympic data digging. Today, I’m gonna to solve the 19th problem. You are given the following information, but … Continue reading

Project Euler — problem 18

The 18th Euler problem is sorta a route finding problem. It has occupied my mind for two days. Finally I came up to a clever solution. Find the maximum total from top to bottom of the triangle below: 75 95 64 17 47 82 18 35 87 10 20 04 82 47 65 19 01 23 75 03 34 88 02 77 73 07 63 67 99 65 04 28 … Continue reading

Project Euler — problem 17

It has been two weeks since my last post on the 16th Euler problem. Now, since I just need a break after supper, I’m coming the 17th problem. 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 … Continue reading

Project Euler — problem 16

The 16th problem is another big-number problem: 215 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26. What is the sum of the digits of the number 21000? This is related to the precision of calculation. Although 2^1000 is within the numeric limit of R, the precision is limited with the … Continue reading

Project Euler — problem 15

The 15th problem in Project Euler. Starting in the top left corner of a 22 grid, there are 6 routes (without backtracking) to the bottom right corner. How many routes are there through a 2020 grid? Mmm… walk in the grid; it sounds like a problem of graph theory. I’m sure there must be … Continue reading

Project Euler — problem 14

It’s Monday today! It’s work day! And I’ve already worked on computer for two hours. Time for a break, which is the 14th problem of Project Euler. The following iterative sequence is defined for the set of positive integers: n n/2 (n is even); n 3n + 1 (n is odd) Although it … Continue reading

Project Euler — problem 13

The 13th in Project Euler is one big number problem: Work out the first ten digits of the sum of the following one-hundred 50-digit numbers. Obviously, there are some limits in machine representation of numbers. In R, 2^(-1074) is the smallest non-zero positive number, and 2^1023 is the largest. … Continue reading

Project Euler — problem 12

Going to supper in 20 minutes. I’d like to type down my solution to the 12th Euler problem, just make my time count. The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be: … Continue reading

Project Euler — problem 11

It’s been a while since I solved one Euler problem last time. Has been busy. Now I’m back and continue to solve the next problem, which is to find the maximum. Let’s take a look at the 11th problem: What is the greatest product of four adjacent numbers in any direction (up, down, … Continue reading

Project Euler — problem 10

Just finish my last assignment for this week. IT’S WEEKEND, officially. Let me take a break to have a look at the tenth problem, another prime problem. It’s no doubt that prime is the center of the number theory and fundamental to arithmetic. No wonder there are so many prime … Continue reading