Risolto


Add two numbers
Given a and b, return the sum a+b in c.

quasi 4 anni fa

Risolto


Least common multiple of many numbers
1:6 -> 60

quasi 4 anni fa

Risolto


Find max prime number
Given integer number n. Find the max prime number (mpn) that smaller than or equal to n. Example: n = 10 --> mpn = 7

quasi 4 anni fa

Risolto


Find the nearest prime
Given a positive integer 'n', the task is to find a prime number greater than or equal to 'n'. Example 1 If given 'n' is ...

quasi 4 anni fa

Risolto


Find out sum of prime number till given number
Find out sum of prime number till given number Example, if number is 10, then answer must be 17.

quasi 4 anni fa

Risolto


Convert binary numbers array into array of decimal numbers.
Convert binary numbers array into array of decimal numbers. Example x=[ 11001000 ; 11001001 ; 11001010 ; 11001011 ; 11001100 ;...

quasi 4 anni fa

Risolto


Binary Coder
Take an input number and print the binary value of this number.

quasi 4 anni fa

Risolto


Flip the bit
Given an input character string (e.g. '1001'), return a character string with the bits flipped ('0110').

quasi 4 anni fa

Risolto


Create the following sequence : 0 1 1 4 9 25 64 169 ...
The sequence 0, 1, 1, 4, 9, 25, 64, 169, ... represents the square of the sequence of Fibonacci numbers. Let n repres...

quasi 4 anni fa

Risolto


Kaprekar Steps
6174 is the <http://en.wikipedia.org/wiki/6174_%28number%29 Kaprekar constant>. All natural numbers less than 10,000 (except som...

quasi 4 anni fa

Risolto


Fibonacci sequence
Calculate the nth Fibonacci number. Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ... Examples: Inpu...

quasi 4 anni fa

Risolto


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

quasi 4 anni fa

Risolto


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

quasi 4 anni fa

Risolto


factorial
There are really some cody problems related to factorial of n, e.g., 42667, 45184, 46054, and etc. It is interesting to ask why ...

quasi 4 anni fa

Risolto


Missing five
Convert decimal numbers to a base-9 notation missing the digit *5* <<http://www.alfnie.com/software/missing5.jpg>> Too man...

quasi 4 anni fa

Risolto


Sum My Indices
Given inputs M and N (in that order), output an MxN matrix whose entries are equal to the sum of their indices. Example input...

quasi 4 anni fa

Risolto


Square
square root of x

quasi 4 anni fa

Risolto


square root
Find square root of given number

quasi 4 anni fa

Risolto


Perfect Square
Determine if the input is a perfect square (square of an integer) or not. Example - If input is 25(==5^2), return 1. If input...

quasi 4 anni fa

Risolto


Square root of number
Square root of given number.

quasi 4 anni fa

Risolto


Find the particular dividend
It is known that once you write the sequence 10101...101 long enough, the number will be finally divisible by any odd number if ...

quasi 4 anni fa

Risolto


Concatenate input positive integers to obtain a maximum.
Input some integers, you need to concatenate them to obtain a maximum integer. Neither use library function "perms" to list all ...

quasi 4 anni fa

Risolto


three digits
Input three digits no larger than 4,say 1,2 and 3, write the possible largest number composed(concatenation and power) only by t...

quasi 4 anni fa

Risolto


minimum numbers of 1 to build n
The (Mahler-Popken) complexity of n: minimal number of 1's required to build n using + and *. see A005245. In this problem, yo...

quasi 4 anni fa

Risolto


Hankelize a matrix
Similar to <http://www.mathworks.com/matlabcentral/cody/problems/42501-toeplitize-a-matrix Problem 42501. Toeplitize a matrix>, ...

quasi 4 anni fa

Risolto


Convert array of decimal numbers into binary numbers array.
Convert an array of decimal numbers into binary numbers array. For example: x = [1 2 3 4 5 6 7 8]; result = [1; 10; 11;...

quasi 4 anni fa

Risolto


Counting Sequence
Given a vector x, find the "counting sequence" y. A counting sequence is formed by "counting" the entries in a given sequence...

quasi 4 anni fa

Risolto


Smith numbers
Return true if the input is a Smith number in base ten. Otherwise, return false. Read about Smith numbers at http://en.wikipedia...

quasi 4 anni fa

Risolto


Return the largest number that is adjacent to a zero
This example comes from Steve Eddins' blog: <http://blogs.mathworks.com/steve/2009/05/27/learning-lessons-from-a-one-liner/ Lear...

quasi 4 anni fa

Risolto


Find common elements in matrix rows
Given a matrix, find all elements that exist in every row. For example, given A = 1 2 3 5 9 2 5 9 3 2 5 9 ...

quasi 4 anni fa

Carica altro