Solved


Recurring Cycle Length (Inspired by Project Euler Problem 26)
Preface: This problem is inspired by Project Euler Problem 26 and uses text from that question to explain what a recurring cycle...

10 months ago

Solved


Project Euler: Problem 18, Maximum path sum I
By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bott...

10 months ago

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

10 months ago

Solved


Longest Collatz Sequence
Inspired by Projet Euler n°14. The Collatz iterative sequence (See Cody problem n° 2103 and 211) is defined for the set of po...

10 months ago

Solved


Large Sum (inspired by Project Euler 13)
Your function will be provided an arbitrary number of numbers of arbitrary sizes as a cell array of strings. Some numbers will b...

10 months ago

Solved


Divisors for big integer
Inspired by Problem 1025 and Project Euler 12. Given n, return the number y of integers that divide N. For example, with ...

10 months ago

Solved


Highly divisible triangular number (inspired by Project Euler 12)
Triangular numbers can be calculated by the sum from 1 to n. For example, the first 10 triangular numbers are: 1, 3, 6, 10, ...

10 months ago

Solved


Project Euler: Problem 11, Largest product in a grid
What is the greatest product of k adjacent numbers in the same direction (up, down, left, right, or diagonally) in a n×n grid ? ...

10 months ago

Solved


Sum of big primes without primes
Inspired by Project Euler n°10 (I am quite obviously a fan). With problem n°250 by Doug, you can find some global methods to co...

10 months ago

Solved


Is the Point in a Circle?
Check whether a point or multiple points is/are in a circle centered at point (x0, y0) with radius r. Points = [x, y]; c...

10 months ago

Solved


Sums of cubes and squares of sums
Given the positive integers 1:n, can you: 1. Compute twice the sum of the cubes of those numbers. 2. Subtract the square...

10 months ago

Solved


Project Euler: Problem 6, Natural numbers, squares and sums.
The sum of the squares of the first ten natural numbers is, 1^2 + 2^2 + ... + 10^2 = 385 The square of the sum of the first ...

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

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

10 months ago

Solved


Project Euler: Problem 2, Sum of even Fibonacci
Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 te...

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

10 months ago

Solved


Array GCD
* Find Greatest Common Divisor in a given array * Function Template: function ans = arraygcd(a) % a=[45 15 200 ...

10 months ago

Solved


Implement a counter
Write a function that returns a function that counts the number of times it is invoked. Example: >> h = counter; >> h() ...

10 months ago

Solved


Function composition - harder
Write a function that accepts an arbitrary number of function handles f_1, f_2, ..., f_n and returns the composition h. That is,...

10 months ago

Solved


Function composition
Write a function that accepts two function handles f and g and returns the composition h. That is, h = (f o g)(x) = f(g(x)) ...

10 months ago

Solved


With apologies to William Blake
Coder Coder, typing fast Sitting at your desk, aghast. What immortal MATLAB script will solve this problem, nice and qu...

10 months ago

Solved


Evened up (or not)
You will be provided with an array or matrix that contains various numbers, in addition to an evening variable, e, set to 1 or 0...

10 months ago

Solved


De-primed
Write a function that will multiply every prime number in the array or matrix by two, leaving all other numbers the same, and re...

10 months ago

Solved


Big numbers, least significant digits
Given two numbers, x and n, return the last d digits of the number that is calculated by x^n. In all cases, d will be the number...

10 months ago

Solved


Digital Neighbourhood
Given a natural number reorder its digits to create another number, closest to the given one. Examples: * 123 gives 132, ...

10 months ago

Solved


Binary Neighbourhood
Given a natural number reorder its binary form to create another number, closest to the given one. Examples: * 1 gives 2, ...

10 months ago

Solved


Find out the Gray Code for a Given Binary Number
Find out <http://en.wikipedia.org/wiki/Gray_code Gray Code> for a given binary number Example Binary input 1000 Gray ...

10 months ago

Solved


Consecutive Equation Times (of the day)
Many times throughout the day can represent mathematical equations. In this problem, we focus on the largest consecutive run of ...

10 months ago

Solved


Equation Times (of the day)
Many times throughout the day can represent mathematical equations. In this problem, we focus on times that include the four bas...

10 months ago

Solved


Power Times (of the day)
Many times throughout the day can represent mathematical equations. In this problem, we focus on times that represent powers. Fo...

10 months ago

Load more