Magic is simple (for beginners)
Determine for a magic square of order n, the magic sum m. For example m=15 for a magic square of order 3.
15일 전
문제를 풀었습니다
Triangular matrices in 3D array
Given a 3D numeric array _x_, return an array _y_ of the same size in which all entries to the right of the main diagonal are ze...
15일 전
문제를 풀었습니다
Numbers spiral diagonals (Part 1)
Inspired by Project Euler n°28 et 58.
A n x n spiral matrix is obtained by starting with the number 1 and moving to the right...
15일 전
문제를 풀었습니다
Matrix Construction I
Given n, construct a matrix as shown in the example below.
Example
For n=8, the output should look like this:
1 2 3 4 ...
15일 전
문제를 풀었습니다
Rainbow matrix
Create a "rainbow matrix" as described in the following examples
Input = 3
Output = [ 1 2 3
2 3 2
...
Pi Digit Probability
Assume that the next digit of pi constant is determined by the historical digit distribution. What is the probability of next di...
16일 전
문제를 풀었습니다
Approximation of Pi
Pi (divided by 4) can be approximated by the following infinite series:
pi/4 = 1 - 1/3 + 1/5 - 1/7 + ...
For a given number of...
16일 전
문제를 풀었습니다
Diagonal Pattern
For a positive integer |n|, return an |nXn| matrix |mat| such that the value of each element in row |i| and column |j| is given ...