Risolto


Project Euler: Problem 3, Largest prime factor
The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number being input, input might be ui...

quasi 8 anni fa

Risolto


Sum of Two Numbers
Given two integer numbers x and y, calculate their sum and put it in z. Examples: Inputs x = 2, y = 4 Output z is 6 ...

quasi 8 anni fa

Risolto


How many solutions has this problem?
Guess, predict or calculate :-) (You will be scored by the accuracy). Update: <http://www.mathworks.co.uk/matlabcent...

quasi 8 anni fa

Risolto


Calculate the number of elements in a matrix.
Calculate the number of elements in a matrix.

quasi 8 anni fa

Risolto


Separate even from odd numbers in a vector - without loops
*Without using loops*, rearrange a vector of integers such that the odd numbers appear at the beginning, and even numbers at the...

quasi 8 anni fa

Risolto


Integer Sequence - 1
Check the test suite to determine the relationship between input integer scalar and output integer scalar.

quasi 8 anni fa

Risolto


Write c^3 as sum of two squares a^2+b^2
write c^3 as sum of two squares a^2+b^2. a and b must be integer and greater than zero. For example 5^3 = 2^2 + 11^2 5...

quasi 8 anni fa

Risolto


Pattern Sum
Write a function which receives two single digit positive integers, (k and m) as parameters and calculates the total sum as: k...

quasi 8 anni fa

Risolto


The great 82-year-old
Let's answer the question below; 'I am *x* years old and I have never written programs. If I study from now, will I be able ...

quasi 8 anni fa

Risolto


Octoberfest festival
A group of students decided to visit Octoberfest festival. First they ordered one beer, then after half-hour they taken one more...

quasi 8 anni fa

Risolto


A Simple Tide Gauge with MATLAB
*&#8767 &#8767 &#8767 &#8767 &#8767 &#8767 &#8767 &#8767* You are standing in a few inches of sea water on a beach. You a...

quasi 8 anni fa

Risolto


Polygonal numbers
The task of <http://www.mathworks.co.uk/matlabcentral/cody/problems/5 Problem 5> is to calculate triangular numbers. By playing ...

quasi 8 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 8 anni fa

Risolto


Basic electricity in a dry situation
&#9889 &#9889 &#9889 &#9889 &#9889 &#9889 &#9889 &#9889 &#9889 &#9889 &#9889 &#9889 &#9889 &#9889 &#9889 &#9889 &#9889 &#9889 &#...

quasi 8 anni fa

Risolto


Energy of a photon
*&#9883 &#9762 &#9883 &#9762 &#9883 &#9762 &#9883* Given the frequency F of a photon in giga hertz. Find energy E of this...

quasi 8 anni fa

Risolto


Find the nearest prime number
Happy 5th birthday, Cody! Since 5 is a prime number, let's have some fun looking for other prime numbers. Given a positive in...

quasi 8 anni fa

Risolto


5 Prime Numbers
Your function will be given lower and upper integer bounds. Your task is to return a vector containing the first five prime numb...

quasi 8 anni fa

Risolto


Extra safe primes
Did you know that the number 5 is the first safe prime? A safe prime is a prime number that can be expressed as 2p+1, where p is...

quasi 8 anni fa

Risolto


Funny problems
Generate the following vector: if n=1 then q=1; elseif n=2 then q=[2 2 1]; elseif n=3 then q=[3 3 3 2 2 1]; ... end

quasi 8 anni fa

Risolto


Polite numbers. Politeness.
A polite number is an integer that sums of two or more consecutive positive integers. Politeness of a positive integer is a num...

quasi 8 anni fa

Risolto


nth Rational Number
Return the nth rational number. This is the inverse to Problem <http://www.mathworks.com/matlabcentral/cody/problems/1471 1...

quasi 8 anni fa

Risolto


Index of a Rational number
The set of real numbers are infinite. They are so many that real numbers can't even be enumerated. However, unlike real numbers ...

quasi 8 anni fa

Risolto


Decimation - Optimized for speed
This problem is similar to http://www.mathworks.com/matlabcentral/cody/problems/1092-decimation, only this time the score will b...

quasi 8 anni fa

Risolto


Decimation
When dealing to the Roman Army, the term decimate meant that the entire unit would be broken up into groups of ten soldiers, and...

quasi 8 anni fa

Risolto


The 5th Root
Write a function to find the 5th root of a number. It sounds easy, but the typical functions are not allowed (see the test su...

circa 8 anni fa

Risolto


Pentagonal Numbers
Your function will receive a lower and upper bound. It should return all pentagonal numbers within that inclusive range in ascen...

oltre 8 anni fa

Risolto


Pernicious Anniversary Problem
Since Cody is 5 years old, it's pernicious. <http://rosettacode.org/wiki/Pernicious_numbers Pernicious number> is an integer whi...

oltre 8 anni fa

Risolto


How to subtract?
* Imagine you need to subtract a few numbers using MATLAB. * You will not be using eval for this task. * Given two ASCII strin...

oltre 8 anni fa

Risolto


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

oltre 8 anni fa

Risolto


sum all digits
input = 123456789, output = 1+2+3+4+5+6+7+8+9 = 45

oltre 8 anni fa

Carica altro