A résolu


Mongean Shuffle
A Mongean shuffle of an n card deck starts with putting the initial deck on the left hand side. * The top card of the deck is...

plus de 4 ans il y a

A résolu


Card Game
This is an overly simplified and highly modified version of card game Twenty-Nine. A deck of 100 unique cards (hypothetical) ...

plus de 4 ans il y a

A résolu


Return fibonacci sequence do not use loop and condition
Calculate the nth Fibonacci number. Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ... Examples: ...

plus de 4 ans il y a

A résolu


Find the next Fibonacci number
In the sequence of Fibonacci numbers, every number is the sum of the two preceding ones: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55...

plus de 4 ans il y a

A résolu


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

plus de 4 ans il y a

A résolu


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

plus de 4 ans il y a

A résolu


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

plus de 4 ans il y a

A résolu


Triangle sequence
A sequence of triangles is constructed in the following way: 1) the first triangle is Pythagoras' 3-4-5 triangle 2) the s...

plus de 4 ans il y a

A résolu


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

plus de 4 ans il y a

A résolu


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

plus de 4 ans il y a

A résolu


Spell the number
Using the British short scale notation, write a function to return the correct spelling of a number passed as a numeric string i...

plus de 4 ans il y a

A résolu


Integer Sequence - II : New Fibonacci
Crack the following Integer Sequence. (Hints : It has been obtained from original Fibonacci Sequence and all the terms are also ...

plus de 4 ans il y a

A résolu


Integer sequence - 2 : Kolakoski sequence
Get the n-th term of <https://oeis.org/A000002 Kolakoski Sequence>.

plus de 4 ans il y a

A résolu


Alternating sum
Given vector x, calculate the alternating sum y = x(1) - x(2) + x(3) - x(4) + ...

plus de 4 ans il y a

A résolu


Golomb's self-describing sequence (based on Euler 341)
The Golomb's self-describing sequence {G(n)} is the only nondecreasing sequence of natural numbers such that n appears exactly G...

plus de 4 ans il y a

A résolu


Square Digits Number Chain Terminal Value (Inspired by Project Euler Problem 92)
Given a number _n_, return the terminal value of the number chain formed by summing the square of the digits. According to the P...

plus de 4 ans il y a

A résolu


Is X a Fibonacci Matrix?
In honor of Cleve's new blog and post: <http://blogs.mathworks.com/cleve/2012/06/03/fibonacci-matrices/> Is X a Fibonacci ...

plus de 4 ans il y a

A résolu


"Look and say" sequence
What's the next number in this sequence? * [0] * [1 0] * [1 1 1 0] * [3 1 1 0] * [1 3 2 1 1 0] This a variant on the w...

plus de 4 ans il y a

A résolu


Sum of first n terms of a harmonic progression
Given inputs a, d and n, return the sum of the first n terms of the harmonic progression a, a/(1+d), a/(1+2d), a/(1+3d),....

plus de 4 ans il y a

A résolu


Return the Fibonacci Sequence
Write a code which returns the Fibonacci Sequence such that the largest value in the sequence is less than the input integer N. ...

plus de 4 ans il y a

A résolu


Sum the Infinite Series
Given that 0 < x and x < 2*pi where x is in radians, write a function [c,s] = infinite_series(x); that returns with the...

plus de 4 ans il y a

A résolu


Find the stride of the longest skip sequence
We define a _skip sequence_ as a regularly-spaced list of integers such as might be generated by MATLAB's <http://www.mathworks....

plus de 4 ans il y a

A résolu


Find matching parenthesis
One of the most indispensable things about a great text editor for programming is the ability to quickly jump between matching p...

plus de 4 ans il y a

A résolu


Space Saver
Remove all characters that are below a space in ASCII value.

plus de 4 ans il y a

A résolu


Reverse the Words (not letters) of a String
*Description* Change the words of a string such that the words appear in reverse order. You may assume that the string is a n...

plus de 4 ans il y a

A résolu


Find Rotated Substring
Given a string s1, find if a rotated version of s1 is present in a second string s2. For example, rotated version of some str...

plus de 4 ans il y a

A résolu


Find matching string from a list of strings
Write a function that returns a string that is a unique match (if it exists) of the string |inStr| from a list of strings |strLi...

plus de 4 ans il y a

A résolu


Decimal Comparison
*Background* A utility of particular interest to Cody and other MATLAB ventures is comparing the equality of two numbers. In ...

plus de 4 ans il y a

A résolu


Convert String to Morse Code
Convert a given string to international <http://en.wikipedia.org/wiki/Morse_code Morse Code> * Strings will only have [A-z], ...

plus de 4 ans il y a

A résolu


letter yes yes & letter no no
Split a string into two strings, wherein the first string has all alphabetic letters and the second string has all the remaining...

plus de 4 ans il y a

Charger plus