Articles by Peter Prevos

The Ulam Spiral (Euler Problem 28)

June 28, 2017 | Peter Prevos

Proposed solution to Euler Problem 28 in the R language for statistical computing. What is the sum of the numbers on the diagonals in a 1001 by 1001 spiral? Continue reading → The post The Ulam Spiral (Euler Problem 28) appeared first on The Devil is in the Data.
[Read more...]

Lexicographic Permutations: Euler Problem 24

June 14, 2017 | Peter Prevos

Euler Problem 24 asks to develop lexicographic permutations which are ordered arrangements of objects in lexicographic order. Tushar Roy of Coding Made Simple has shared a great introduction on how to generate lexicographic permutations. Euler Problem 24 Definition A permutation is … Continue reading → The post Lexicographic Permutations: Euler Problem 24 appeared first on ... [Read more...]

Tic Tac Toe Part 3: The Minimax Algorithm

June 7, 2017 | Peter Prevos

In two previous posts, I presented code to teach R to play the trivial game of Tic Tac Toe. I thought this was an unbeatable algorithm. Alas, a comment from Alberto shattered my pride as he was able to beat … Continue reading → The post Tic Tac Toe Part 3: The Minimax ... [Read more...]

Euler Problem 23: Non-Abundant Sums

May 31, 2017 | Peter Prevos

A solution in the R language to Euler Problem 23. Find the sum of all the positive integers which cannot be written as the sum of two abundant numbers. Continue reading → The post Euler Problem 23: Non-Abundant Sums appeared first on The Devil is in the Data.
[Read more...]

Euler Problem 22 : Names Scores

May 24, 2017 | Peter Prevos

A proposed solution in the R language to Euler Problem 22. What is the total of all the name scores in the file of 5163 first names? Continue reading → The post Euler Problem 22 : Names Scores appeared first on The Devil is in the Data. [Read more...]

Euler Problem 21: Amicable Numbers

May 17, 2017 | Peter Prevos

A solution in the R language to Euler Problem 21 which asks to evaluate the sum of all the amicable, or friendly, numbers under 10000. Continue reading → The post Euler Problem 21: Amicable Numbers appeared first on The Devil is in the Data.
[Read more...]

Euler Problem 20: Large Integer Factorials

May 10, 2017 | Peter Prevos

A proposed solution in the R language to Euler Problem 20: Find the sum of the digits in the faculty of 100: 100 × 99 × ... × 3 × 2 × 1 Continue reading → The post Euler Problem 20: Large Integer Factorials appeared first on The Devil is in the Data. [Read more...]

Euler Problem 18 & 67: Maximum Path Sums

April 26, 2017 | Peter Prevos

Proposed solution to Euler Problem 18 in the R language. Find the maximum total from top to bottom of a triangle consisting of numbers. Continue reading → The post Euler Problem 18 & 67: Maximum Path Sums appeared first on The Devil is in the Data.
[Read more...]

Euler Problem 17: Number Letter Counts

March 22, 2017 | Peter Prevos

A solution in the R language to Euler Problem 17: If all the numbers from 1 to 1000 inclusive were written out in words, how many letters would be used? Continue reading → The post Euler Problem 17: Number Letter Counts appeared first on The Devil is in the Data.
[Read more...]

Euler Problem 16: Power Digit Sum

March 15, 2017 | Peter Prevos

A solution in the R language to Euler Problem 16. What is the sum of the digits of the number 2^1000? This post provides a solution using basic r code. Continue reading → The post Euler Problem 16: Power Digit Sum appeared first on The Devil is in the Data.
[Read more...]

Tic Tac Toe Simulation — Random Moves

March 12, 2017 | Peter Prevos

Tic Tac Toe might be a futile children’s game but it can also teach us about artificial intelligence. Tic Tac Toe, or Naughts and Crosses, is a zero-sum game with perfect information. Both players know exactly what the other did and when nobody … Continue reading → The post Tic Tac ... [Read more...]
1 2 3 4 5

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)