Solved

Easy Sequences 13: Average Speed of Spaceship

A certain alien spaceship is capable of traveling at extremely high velocities and is able to change speed instantaneously. The ...

1 month ago

Solved

Number of bytes required to store a sparse matrix

The input is always a sparse matrix : x = sparse(100,1000,0.01); >>whos x shows that 8024 bytes ares required . The a...

1 month ago

Solved

Count the primes in Collatz sequences

Several Cody problems (21, 69, 42937, 44448, 44784, 52422) involve Collatz sequences. These start with a seed . If is odd, the ...

1 month ago

Solved

List the Moran numbers

The quotient of a Moran number and its digit sum is prime. For example, 117 and 481 are Moran numbers because 117/(1+1+7) is 13 ...

1 month ago

Solved

Convert a cell-array of values to MATLAB source code

The MATLAB interpreter loads your code and executes it using the Read-Evaluate-Print-Loop (see REPL). In this problem you will ...

2 months ago

Solved

Modify subscripts

MATLAB supports object-oriented programming. Let's take an advantage of it in cody. This problem starts <http://uk.mathworks....

2 months ago

Solved

List modest numbers up to n

After determining the nude numbers, or the numbers that openly display some of their divisors as their digits, one would think t...

2 months ago

Solved

Count the ways to draw non-intersecting chords between points on a circle

There are 9 ways to draw non-intersecting chords between four points on the perimeter of a circle (including no chords at all). ...

2 months ago

Solved

Determine whether a number is unprimeable

The number 204 is unprimeable because no single digit can be changed to make it prime. In contrast, the number 207 is not unprim...

2 months ago

Solved

Determine whether a number is a fibodiv number

The number 14 is a fibodiv number because you can divide it into 1 and 4, use those numbers as the seeds for a Fibonacci sequenc...

2 months ago

Solved

Borderline Connectivity

Compute the connected components of pixel borders. Suppose that h and v together describe a logical labeling of the borders b...

2 months ago

Solved

Find the nth nude number

The number 672 is a nude number because it openly displays three of its divisors: 6, 7, and 2. In other words, a nude number is ...

2 months ago

Solved

Metamorphosis

Inspired by problem <http://www.mathworks.com/matlabcentral/cody/problems/866-community-problem-500 866>. Can you make your c...

2 months ago

Solved

Easy Sequences 11: Factorial Digits without Trailing Zeros

Here is an easy one... It is not difficult to count the number of digits of the factorial of a given number. For example for 'n...

2 months ago

Solved

Easy Sequences 10: Sum of Cumsums of Fibonacci Sequence

The function F(n) is defined as the set of Fibonacci numbers from the first up to the n-th. S(n) is the result of applying to F,...

2 months ago

Solved

Easy Sequences 9: Faithful Pairs

A "faithful number" is a non-prime number that is one less or one more than some prime number but not both. For example, for num...

2 months ago

Solved

Circular Segment Area

Let us consider a circle with radius . If we draw an angle (in radians) from the center of the circle, the two radii forming th...

2 months ago

Solved

Easy Sequences 8: Triangles with integer sides and prime perimeters

The triangle below is special. It has integer sides and a prime perimeter. Given an integer "n" we want to know how many t...

2 months ago

Solved

Easy Sequences 6: Coefficient sums of derivatives

Consider the polynomial function and its first-order derivative . The sums of the coefficients of P and P', are and , respecti...

2 months ago

Solved

Easy Sequences 5: Project Euler Problem 1 - Again!

We are all familiar with Project Euler Problem 1. This time let's try it on bigger multiples and larger range. Find the sum of ...

2 months ago

Solved

Project Euler: Problem 1, Multiples of 3 and 5

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23...

2 months ago

Solved

Easy Sequences 4: Eliminate the Days of Confusion

If a date is written in purely numeric format some dates can be confusing, if we don't know the date format used. For example, "...

2 months ago

Solved

Easy Sequences 3: Prime 44-number Squares

The positive integers 62 and 238 are related. Their squares (3844 and 56,644) both end in '44'. In fact, 62 and 238 are the 3rd ...

2 months ago

Solved

Easy Sequences 2: Trigonometric function with integral input and output

The function 'F', defined as: , will always return an integer if the input is a natural number (in radian...

2 months ago

Solved

choose the even number

find all even number in vector x Example: x = [1 2 3 4 5 6 7 8 9 10] y = [2 4 6 8 10]

2 months ago

Solved

Cell Operator *

Please implement operator * for cell: >> {2,3} * 2 ans = 1×4 cell array [2] [3] [2] [3] >> {2,3} * [2 3]...

2 months ago

Solved

Apply Function to Each Field of a Structure Array: Part 2

The builtin <http://www.mathworks.com/help/matlab/ref/structfun.html?=structfun structfun> applies a function handle to each fie...

2 months ago

Solved

Draw the flag of United Kingdom from 0 and 1.

Draw the flag of United Kingdom using 0 and 1. Exam: output n = 5 input y = [ 0 0 1 0 0 0 0 ...

2 months ago

Solved

Easy Sequences 1: Find the index of an element

The nth element of a series A is defined by: . Obviously, the first element A(1) = 1. Given the nth element 'A(n)', find the val...

2 months ago