Gelöst


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

3 Monate vor

Gelöst


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

3 Monate vor

Gelöst


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

3 Monate vor

Gelöst


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

3 Monate vor

Gelöst


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

3 Monate vor

Gelöst


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

3 Monate vor

Gelöst


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

3 Monate vor

Gelöst


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

3 Monate vor

Gelöst


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

3 Monate vor

Gelöst


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

3 Monate vor

Gelöst


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

3 Monate vor

Gelöst


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 Monate vor

Gelöst


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

3 Monate vor

Gelöst


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

3 Monate vor

Gelöst


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

3 Monate vor

Gelöst


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

3 Monate vor

Gelöst


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

3 Monate vor

Gelöst


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

3 Monate vor

Gelöst


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

3 Monate vor

Gelöst


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

3 Monate vor

Gelöst


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

3 Monate vor

Gelöst


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

3 Monate vor

Gelöst


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

3 Monate vor

Gelöst


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

3 Monate vor

Gelöst


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

3 Monate vor

Gelöst


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

3 Monate vor

Gelöst


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

3 Monate vor

Gelöst


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

3 Monate vor

Gelöst


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

3 Monate vor

Gelöst


Bit calculation
Give me the count of numbers from 1 to n having their last two bits as 0. For example function y = ret_count(4) y = x...

3 Monate vor

Mehr laden