553 total contributions since 2015

Solved

Numbers spiral diagonals (Part 1)

Inspired by Project Euler n°28 et 58. A n x n spiral matrix is obtained by starting with the number 1 and moving to the right...

13 hours ago

Solved

Project Euler: Problem 9, Pythagorean numbers

A Pythagorean triplet is a set of three natural numbers, a b c, for which, a^2 + b^2 = c^2 For example, 3^2 + 4^2 =...

2 days ago

Solved

Project Euler: Problem 4, Palindromic numbers

A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 ...

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

3 days ago

Solved

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

3 days ago

Solved

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

3 days ago

Solved

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

4 days ago

Solved

Mersenne Primes vs. All Primes

A Mersenne prime (M) is a prime number of the form M = 2^p - 1, where p is another prime number. <https://www.mathworks.com/matl...

4 days ago

Solved

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

4 days ago

Solved

The Top 5 Primes

This problem series invites you to solve two simple problems related to the integer NUMBER FIVE, in order to celebrate <https://...

6 days ago

Solved

Inscribed Pentagon?

Your function will be provided with the five vertices of a pentagon (p) as well as the center point (cp) and radius (r) of a cir...

8 days ago

Solved

Circle/Pentagon Overlap

Your function will be provided with the five vertices of a pentagon (p) as well as the center point (cp) and radius (r) of a cir...

9 days ago

Solved

I Plead the Fifth

Write a function to provide a yes or no answer to the input string. However, it must plead the 5th amendment (return an empty st...

9 days ago

Solved

Octoberfest festival

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

10 days ago

Solved

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

10 days ago

Solved

Numbers with prime factors 2, 3 and 5.

Make a function which takes one positive integer n and returns a matrix with the numbers of the form (2^i)*(3^j)*(5^k) which are...

12 days ago

Solved

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

12 days ago

Solved

Proper Factors

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

12 days ago

Solved

Multiples of a Number in a Given Range

Given an integer factor _f_ and a range defined by _xlow_ and _xhigh_ inclusive, return a vector of the multiples of _f_ that fa...

12 days ago

Solved

Prime factor digits

Consider the following number system. Calculate the prime factorization for each number n, then represent the prime factors in a...

14 days ago

Solved

Height of a right-angled triangle

Given numbers a, b and c, find the height of the right angled triangle with sides a and b and hypotenuse c, for the base c. If a...

14 days ago

Solved

Find the sides of an isosceles triangle when given its area and height from its base to apex

Find the sides of an isosceles triangle when given its area and the height from its base to apex. For example, with A=12 and ...

14 days ago

Solved

Is the Point in a Triangle?

Check whether a point or multiple points is/are in a triangle with three corners Points = [x, y]; Triangle = [x1, y1; x...

14 days ago

Solved

Calculate the centroid of a triangle

Info: https://en.wikipedia.org/wiki/Centroid Example Input: x = [0 0 1]; % x-coordinate y = [0 1 0]; % y-coordinat...

14 days ago

Solved

Right Triangle Side Lengths (Inspired by Project Euler Problem 39)

If _p_ is the perimeter of a right angle triangle with integral length sides, { _a_, _b_, _c_ }, there are exactly three solutio...

14 days ago

Solved

Find my daddy long leg (No 's')

Given the ratio of the two legs (longer / shorter), and the hypotenuse length, find the value of the bigger leg.

14 days ago

Solved

Can we make a triangle?

Given three positive number, check whether a triangle can be made with these sides length or not. remember that in a triangle su...

14 days ago

Solved

Find the maximum number of decimal places in a set of numbers

Given a vector or matrix of values, calculate the maximum number of decimal places within the input. Trailing zeros do not coun...

14 days ago

Solved

Make roundn function

Make roundn function using round. x=0.55555 y=function(x,1) y=1 y=function(x,2) y=0.6 y=function(x,3) ...

14 days ago

Solved

Rounding off numbers to n decimals

Inspired by a mistake in one of the problems I created, I created this problem where you have to round off a floating point numb...

14 days ago