Solved


(Linear) Recurrence Equations - Generalised Fibonacci-like sequences
This problem is inspired by problems <http://uk.mathworks.com/matlabcentral/cody/problems/2187-generalized-fibonacci 2187>, <htt...

8 months ago

Solved


Fibonacci Decomposition
Every positive integer has a unique decomposition into nonconsecutive Fibonacci numbers f1+f2+ ... Given a positive integer n, r...

8 months ago

Solved


How many Fibonacci numbers?
Find the number of unique Fibonacci numbers (don't count repeats) in a vector of positive integers. Example: x = [1 2 3 4...

8 months ago

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...

8 months ago

Solved


Number of Even Elements in Fibonacci Sequence
Find how many even Fibonacci numbers are available in the first d numbers. Consider the following first 14 numbers 1 1 2...

8 months ago

Solved


Fibonacci-Sum of Squares
Given the Fibonacci sequence defined by the following recursive relation, * F(n) = F(n-1) + F(n-2) * where F(1) = 1 and F(1)...

8 months ago

Solved


Angle Between Analog Clock Hands
Given a datetime variable t, return the angle (in degrees) between the hour and minute hands of an analog clock at the time repr...

8 months ago

Solved


Possible Rugby Scores
Given a natural number s (> 4), representing a rugby team's score, return an n-by-3 matrix representing all n possible combinati...

8 months ago

Solved


Create block matrix of integers (j+k-1) - Part II
Given m, n, p, and q, create an m-by-n matrix made up of submatrices, each sized p-by-q (if possible - the last row and column o...

8 months ago

Solved


Dartboard Average II
A dartboard arranges the numbers 1 to 20 such that each value is typically flanked by quite different values - for example, 20 i...

8 months ago

Solved


Create block matrix of integers (j+k-1) - Part I
Given m, n, p, and q, create a matrix of m-by-n blocks (submatrices), each sized p-by-q. The elements of the (j,k)th block all h...

8 months ago

Solved


Split Even Number Into Two Primes
Given an even whole number n (> 2), return a 2-element vector of primes, p, such that p(1) + p(2) = n. The elements of p should ...

8 months ago

Solved


Determine if Input is Oddish or Evenish (Odd/Even Sum of Digits)
Given a positive integer n, determine whether n is "oddish" or "evenish" - that is, whether the sum of the digits of n is odd or...

8 months ago

Solved


Triangle Coordinates
Given a natural number n, return two -element vectors, x and y, containing the coordinates of a triangular arrangement of points...

8 months ago

Solved


Boustrophedon
Given a vector v and a positive integer n, return an m-by-n matrix containing the elements of v row-wise, alternating left-to-ri...

8 months ago

Solved


Extract the Acrostic Message
An acrostic cipher is a way of embedding one message within another by taking the first (or last) word of each line. Given a str...

8 months ago

Solved


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

8 months ago

Solved


Dartboard Average I
A dartboard arranges the numbers 1 to 20 such that each value is typically flanked by quite different values - for example, 20 i...

8 months 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...

8 months 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 ...

8 months ago

Solved


How long is the longest prime diagonal?
Stanislaw Ulam once observed that if the counting numbers are arranged in a spiral, the prime numbers contained in it form a sur...

8 months 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...

8 months 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 through thi...

8 months 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...

8 months 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 ...

8 months 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 ...

8 months 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 ...

8 months ago

Solved


How lucky r u ?
Find the nth number in the following sequence <https://oeis.org/A264940>

8 months ago

Solved


Cut the rod
A rod of length n can be cut in different sizes. Different price is associated with different length of cuts. length, len= [1,...

8 months ago

Solved


Exponentiation
Given 3 integers b,e,k; find -- mod(b^e,k)

8 months ago

Load more