Solved

Project Euler: Problem 2, Sum of even Fibonacci

Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 te...

4 years ago

Solved

Project Euler: Problem 6, Natural numbers, squares and sums.

The sum of the squares of the first ten natural numbers is, 1^2 + 2^2 + ... + 10^2 = 385 The square of the sum of the first ...

4 years ago

Solved

Solitaire Cipher

Implement the <http://en.wikipedia.org/wiki/Solitaire_(cipher) solitaire cipher>. Since this is from Wikipedia, I am capturin...

4 years ago

Solved

How long is the longest prime diagonal?

Stanislaw Ulam once observed that if the counting numbers are <http://en.wikipedia.org/wiki/Ulam_spiral arranged in a spiral>, t...

4 years ago

Solved

Find a subset that divides the vector into equal halves

Given a vector x, return the indices to elements that will sum to exactly half of the sum of all elements. Example: Inpu...

4 years ago

Solved

Find the biggest empty box

You are given a matrix that contains only ones and zeros. Think of the ones as columns in an otherwise empty floor plan. You wan...

4 years ago

Solved

Spot the outlier

All points except for one lie on a line. Which one is the outlier? Example: You are given a list of x-y pairs in a column ...

4 years ago

Solved

Make a run-length companion vector

Given a vector x, return a vector r that indicates the run length of any value in x. Each element in r shows how many times the ...

4 years ago

Solved

How many trades represent all the profit?

Given a list of results from trades made: [1 3 -4 2 -1 2 3] We can add them up to see this series of trades made a profit ...

4 years ago

Solved

Flag largest magnitude swings as they occur

You have a phenomenon that produces strictly positive or negative results. delta = [1 -3 4 2 -1 6 -2 -7]; Marching thr...

4 years ago

Solved

Given a window, how many subsets of a vector sum positive

Given a vector: [1 0 -1 3 2 -3 1] and a window of 2, A sliding window would find: 1 + 0 = 1 0 - 1 = -1 ...

4 years ago

Solved

Implement simple rotation cypher

If given a letter from the set: [abc...xyz] and a shift, implement a shift cypher. Example: 'abc' with a shi...

4 years ago

Solved

Diophantine Equations (Inspired by Project Euler, problem 66)

Consider the quadratic Diophantine equation of the form: x^2 – Dy^2 = 1 When D=13, the minimal solution in x is 649^2 – 13...

4 years ago

Solved

Sum all integers from 1 to 2^n

Given the number x, y must be the summation of all integers from 1 to 2^x. For instance if x=2 then y must be 1+2+3+4=10.

4 years ago

Solved

Finite Continued Fraction

Given an input real number x and a natural number n, output the row vector with the n first terms of the continued fraction. F...

4 years ago

Solved

Radial Zernike polynomials

Given an integer _n_ ≥ 0 and an integer _m_ ≥ 0, generate the <http://en.wikipedia.org/wiki/Zernike_polynomials radial Zer...

4 years ago

Solved

Generalized Laguerre polynomials

Given an integer _n_ ≥ 0 and a scalar _a_, generate the _n_-th <http://en.wikipedia.org/wiki/Laguerre_polynomials#Generalized...

4 years ago

Solved

Ackermann's Function

Ackermann's Function is a recursive function that is not 'primitive recursive.' <http://en.wikipedia.org/wiki/Ackermann_fun...

4 years ago

Solved

Chebyshev polynomials of the 2nd Kind

Given an integer _n_ ≥ 0, generate the _n_-th <http://en.wikipedia.org/wiki/Chebyshev_polynomials Chebyshev polynomial of the...

4 years ago

Solved

Chebyshev polynomials of the 1st Kind

Given an integer _n_ ≥ 0, generate the _n_-th <http://en.wikipedia.org/wiki/Chebyshev_polynomials Chebyshev polynomial of the...

4 years ago

Solved

Laguerre polynomials

Given an integer _n_ ≥ 0, generate the _n_-th <http://en.wikipedia.org/wiki/Laguerre_polynomials Laguerre polynomial>. *Ex...

4 years ago

Solved

Hermite Polynomials

Return the _n_-th <http://en.wikipedia.org/wiki/Hermite_polynomials Hermite polynomial> of the physicists' type. Assume that ...

4 years ago

Solved

Kepler's Equation

Solve <http://en.wikipedia.org/wiki/Kepler's_equation Kepler's Equation>. Note that the solution is rounded down to 5 decima...

4 years ago

Solved

Calculate Euler's phi function

Compute the Euler's phi function of a large integer. For more information about this topic please visit: <https://en.wikiped...

4 years ago

Solved

Rosenbrock's Banana Function and its derivatives

Write a function to return the value of <http://en.wikipedia.org/wiki/Rosenbrock_function Rosenbrock's two-dimensional banana fu...

4 years ago

Solved

Determine if a Given Number is a Triangle Number

*Description:* Determine if the elements of an input array are triangle numbers and return the result as an array with the sa...

4 years ago

Solved

Stop a ZigZag scanning N*N Matrix at any diag you want

Suppose that we have a 2-D matrix and we try to obtain a 1-D array in zig-zag order, but not all values of our 2-D matrix e...

4 years ago

Solved

Choose the best fitting dominoes

You will be given a cell array of nx2 matrices. Choose one row from each matrix. These are the ordered pairs that will be plac...

4 years ago

Solved

Find best domino orientation

Given a list of pairs, find the orientation they should be placed in a line, such that the sum of the absolute values of the dif...

4 years ago