Resuelto


Return a list sorted by number of consecutive occurrences
Inspired by Problem 38 by Cody Team. Given a vector x, return a vector y of the values in x sorted by the number of CONSECUTIVE...

más de 3 años hace

Resuelto


Create logical matrix with a specific row and column sums
Given two numbers *|n|* and *|s|*, build an |n-by-n| logical matrix (of only zeros and ones), such that both the row sums and th...

más de 3 años hace

Resuelto


Generate N equally spaced intervals between -L and L
Given N and L, return a list of numbers (in ascending order) that divides the interval [-L L] into N equal-length segments. F...

más de 3 años hace

Resuelto


Piecewise linear interpolation
Given an Mx2 vector and a row of M-1 integers, output a two column vector that linearly interpolates Y times between each succes...

más de 3 años hace

Resuelto


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

más de 3 años hace

Resuelto


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

más de 3 años hace

Resuelto


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

más de 3 años hace

Resuelto


Volume Pillar
Calculate the volume of a pillar with radius l and heigth ar.

más de 3 años hace

Resuelto


Convert radians to degrees
Given input in radians, output to degrees

más de 3 años hace

Resuelto


Perimeter of a semicircle
Given the diameter d, find the perimeter of a semicircle

más de 3 años hace

Resuelto


Given a square and a circle, please decide whether the square covers more area.
You know the side of a square and the diameter of a circle, please decide whether the square covers more area.

más de 3 años hace

Resuelto


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

más de 3 años hace

Resuelto


radius of a spherical planet
You just measured its surface area, that is the input.

más de 3 años hace

Resuelto


Calculate area of sector
A=function(r,seta) r is radius of sector, seta is angle of sector, and A is its area. Area of sector A is defined as 0.5*(r^2...

más de 3 años hace

Resuelto


Pizza!
Given a circular pizza with radius _z_ and thickness _a_, return the pizza's volume. [ _z_ is first input argument.] Non-scor...

más de 3 años hace

Resuelto


Circular Primes (based on Project Euler, problem 35)
The number, 197, is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime. The...

más de 3 años hace

Resuelto


Find the next prime number
Find the next prime number or numbers for given n. For example: n = 1; out = 2; or n = [5 7]; out = [7 11]; ...

más de 3 años hace

Resuelto


Make a vector of prime numbers
Input(n) - length of vector with prime numbers Output(v) - vector of prime numbers Example: * n=1; v=2 * n=3; v=[2 3 5...

más de 3 años hace

Resuelto


Largest Twin Primes
<http://en.wikipedia.org/wiki/Twin_prime Twin primes> are primes p1, p2 = p1 + 2 such that both p1 and p2 are prime numbers. Giv...

más de 3 años hace

Resuelto


Mersenne Primes
A Mersenne prime is a prime number of the form M = 2^p - 1, where p is another prime number. For example, 31 is a Mersenne prim...

más de 3 años hace

Resuelto


Find nearest prime number less than input number
Find nearest prime number less than input number. For example: if the input number is 125, then the nearest prime number whi...

más de 3 años hace

Resuelto


Sophie Germain prime
In number theory, a prime number p is a *Sophie Germain prime* if 2p + 1 is also prime. For example, 23 is a Sophie Germain prim...

más de 3 años hace

Resuelto


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

más de 3 años hace

Resuelto


Proper Factors
Generate the proper factors of input integer _x_ and return them in ascending order. For more information on proper factors, ref...

más de 3 años hace

Resuelto


Quote Doubler
Given a string s1, find all occurrences of the single quote character and replace them with two occurrences of the single quote ...

más de 3 años hace

Resuelto


Return a list sorted by number of occurrences
Given a vector x, return a vector y of the unique values in x sorted by the number of occurrences in x. Ties are resolved by a ...

más de 3 años hace

Resuelto


Making change
Given an amount of currency, return a vector of this form: [100 50 20 10 5 2 1 0.5 0.25 0.1 0.05 0.01] Example: Input a = ...

más de 3 años hace

Resuelto


Mandelbrot Numbers
The <http://en.wikipedia.org/wiki/Mandelbrot_set Mandelbrot Set> is built around a simple iterative equation. z(1) = c z...

más de 3 años hace

Resuelto


Factorize THIS, buddy
List the prime factors for the input number, in decreasing order. List each factor only once, even if the factorization includes...

más de 3 años hace

Resuelto


Get all prime factors
List the prime factors for the input number, in decreasing order. List each factor. If the prime factor occurs twice, list it as...

más de 3 años hace

Cargar más