Solved

Project Euler: Problem 16, Sums of Digits of Powers of Two

2^15 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26. What is the sum of the digits of the number 2^N? Thanks ...

6 maanden ago

Solved

Infinite precision division

Develop a function that will divide a very very large integer numerator, supplied to function as a string (e.g., '12233344445555...

6 maanden ago

Solved

How to add?

* Imagine you are in 2222 Anno Domini, when everyone must learn how to add, * and competing for the highly prestigious post of,...

6 maanden ago

Solved

Factorial: Unlimited Size : java.math

This challenge is an application of java.math that allows unlimited precision calculations. The primary reference sites are <ht...

6 maanden ago

Solved

Highest powers in factorials

This is the inverse of the problem <https://www.mathworks.com/matlabcentral/cody/problems/44747 Exponents in Factorials>. Inste...

6 maanden ago

Solved

Create all combinations of vectors

This function exists in the Neural Network Toolbox but is not available in Cody. Can you write such a function? See <http://...

6 maanden ago

Solved

Exponents in Factorials

It's time to get excited about numbers!!! Well, we're just dealing with factorials here, but it's still a good reason to get ex...

6 maanden ago

Solved

So many choices

For inputs _n_ and _k_ (in that order), output the number of ways that k objects can be chosen from amongst n distinct objects. ...

6 maanden ago

Solved

Full combinations

Given n input vectors x1, x2, …, xn, generate a p*n matrix y whose rows contain all element-wise combinations of the vectors x1,...

6 maanden ago

Solved

Find the inverse permutation

Given a permutation vector perm (a vector of n elements containing all the elements from 1 to n in some order), return the permu...

6 maanden ago

Solved

Rewrite setdiff to account for non-unique values

Setdiff(a,b) is a function that will remove all values of b from a. Sometimes, you need this function to do a little bit extra,...

6 maanden ago

Solved

Plot Damped Sinusoid

Given two vectors |t| and |y|, make a plot containing a blue ( |b| ) dashed ( |--| ) line of |y| versus |t|. Mark the minimum...

6 maanden ago

Solved

Calculate a Damped Sinusoid

The equation of a damped sinusoid can be written as |y = A.ⅇ^(-λt)*cos(2πft)| where |A|, |λ|, and |f| ...

6 maanden ago

Solved

Solve a System of Linear Equations

Example: If a system of linear equations in x₁ and x₂ is: 2x₁ + x₂ = 2 x₁ - 4 x₂ = 3 Then the coefficient matrix (A) is: 2 ...

6 maanden ago

Solved

Verify Law of Large Numbers

If a large number of fair N-sided dice are rolled, the average of the simulated rolls is likely to be close to the mean of 1,2,....

6 maanden ago

Solved

Find the Oldest Person in a Room

Given two input vectors: * |name| - user last names * |age| - corresponding age of the person Return the name of the ol...

6 maanden ago

Solved

Convert from Fahrenheit to Celsius

Given an input vector |F| containing temperature values in Fahrenheit, return an output vector |C| that contains the values in C...

6 maanden ago

Solved

Calculate Amount of Cake Frosting

Given two input variables |r| and |h|, which stand for the radius and height of a cake, calculate the surface area of the cake y...

6 maanden ago

Solved

Sum of series II

What is the sum of the following sequence: Σ(2k-1)^2 for k=1...n for different n?

6 maanden ago

Solved

Sum of series I

What is the sum of the following sequence: Σ(2k-1) for k=1...n for different n?

6 maanden ago

Solved

Project Euler: Problem 8, Find largest product in a large string of numbers

Find the greatest product of five consecutive digits in an n-digit number. 73167176531330624919225119674426574742355349194934...

6 maanden ago

Solved

Project Euler: Problem 5, Smallest multiple

2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. What is the smalle...

6 maanden ago

Solved

Magic is simple (for beginners)

Determine for a magic square of order n, the magic sum m. For example m=15 for a magic square of order 3.

6 maanden ago

Solved

Sum all integers from 1 to 2^n

Given the number x, y must be the summation of all integers from 1 to 2^x. For instance if x=2 then y must be 1+2+3+4=10.

6 maanden ago

Solved

Make a random, non-repeating vector.

This is a basic MATLAB operation. It is for instructional purposes. --- If you want to get a random permutation of integer...

6 maanden ago

Solved

Roll the Dice!

*Description* Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice. *Example* [x1,x2] =...

6 maanden ago

Solved

Number of 1s in a binary string

Find the number of 1s in the given binary string. Example. If the input string is '1100101', the output is 4. If the input stri...

6 maanden ago

Solved

Return the first and last characters of a character array

Return the first and last character of a string, concatenated together. If there is only one character in the string, the functi...

6 maanden ago

Solved

Create times-tables

At one time or another, we all had to memorize boring times tables. 5 times 5 is 25. 5 times 6 is 30. 12 times 12 is way more th...

6 maanden ago

Solved

Getting the indices from a vector

This is a basic MATLAB operation. It is for instructional purposes. --- You may already know how to <http://www.mathworks....

6 maanden ago