Solved

Frugal number

check whether n is a frugal number * a frugal number is a natural number in a given number base that has more digits than the...

etwa 2 Monate 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 =...

etwa 2 Monate ago

Solved

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

etwa 2 Monate ago

Solved

Dots in a Circle

Return how many integer grid points there are inside a circle of radius _r_ centred at (0,0) (including points on the edge). ...

etwa 2 Monate ago

Solved

Dots in a Sphere

Return how many integer grid points there are inside a 3D sphere of radius _r_ centred at (0,0,0) (including points on the edge)...

etwa 2 Monate ago

Solved

Volume of a Simplex

Return the volume of a <http://en.wikipedia.org/wiki/Simplex regular _n_-simplex> with a unit side length. Results are up to...

etwa 2 Monate ago

Solved

Remove all the consonants

Remove all the consonants in the given phrase. Example: Input s1 = 'Jack and Jill went up the hill'; Output s2 is 'a ...

2 Monate ago

Solved

Natural numbers in string form

Create a cell array of strings containing the first n natural numbers. _Slightly_ harder than it seems like it should be. Ex...

2 Monate ago

Solved

Pi Digit Probability

Assume that the next digit of pi constant is determined by the historical digit distribution. What is the probability of next di...

2 Monate ago

Solved

How many Fibonacci numbers?

Find the number of unique Fibonacci numbers (don't count repeats) in a vector of positive integers. Example: x = [1 2 3 4...

2 Monate ago

Solved

Fibonacci-Sum of Squares

Given the Fibonacci sequence defined by the following recursive relation, * F(n) = F(n-1) + F(n-2) * where F(1) = 1 and F(1)...

2 Monate ago

Solved

Nth roots of unity

First, find the n nth roots of unity. eg if n = 6, find the n distinct (complex) numbers such that n^6 = 1. <https://en.wiki...

2 Monate ago

Solved

Pseudo Square Root (Inspired by Project Euler 266)

Shamelessly copied from the Project Euler page for Problem 266: ------------- The divisors of 12 are: 1,2,3,4,6 and 12. T...

2 Monate ago

Solved

Rosenbrock's Banana Function and its derivatives

Write a function to return the value of <http://en.wikipedia.org/wiki/Rosenbrock_function Rosenbrock's two-dimensional banana fu...

2 Monate ago

Solved

Kepler's Equation

Solve <http://en.wikipedia.org/wiki/Kepler's_equation Kepler's Equation>. Note that the solution is rounded down to 5 decima...

2 Monate ago

Solved

Approximate e

Given a and n, compute and approximation to f = a * e ^ n, without the use of exp, string operations, or floating point numbers....

2 Monate ago

Solved

Mechanical Advantage of a Gear Train

Calculate the mechanical advantage of a gear train. The mechanical advantage of a gear couple is given by MA = T_o/T_i where ...

2 Monate ago

Solved

Consecutive Powers

Return 2 numbers and 2 powers such that their difference is 1 A 4 element row vector is expected: x where x(1)^x(2) - x(...

2 Monate ago

Solved

Convert a temperature reading from Celsius to an unknown scale

Two of the most famous temperature scales are the Celsius and the Fahrenheit scale. In reality, however, there are so many other...

2 Monate ago

Solved

Factorize THIS, buddy

List the prime factors for the input number, in decreasing order. List each factor only once, even if the factorization includes...

2 Monate ago

Solved

Characterize fluid flow in a pipe as to laminar or turbulent

In fluid mechanics, characterizing the flow in a pipe is essential to predicting its behavior. The flow pattern can either be la...

2 Monate ago

Solved

Find the alphabetic word product

If the input string s is a word like 'hello', then the output word product p is a number based on the correspondence a=1, b=2, ....

2 Monate ago

Solved

Which doors are open?

There are n doors in an alley. Initially they are all shut. You have been tasked to go down the alley n times, and open/shut the...

2 Monate ago

Solved

Find elements of set A those are not in set B

Given two sets of data A and B. Find elements of A those are not in set B. ...

2 Monate ago

Solved

Neither minima nor maxima

Input v is a vector. Return all the elements of v which are not a local minimum or maximum. Example: v = [1 2 3 4 5] Ou...

2 Monate ago

Solved

Integer Sequence - II : New Fibonacci

Crack the following Integer Sequence. (Hints : It has been obtained from original Fibonacci Sequence and all the terms are also ...

2 Monate ago

Solved

Replace x value into y value in string text.

Replace x value into y value in string text. Example text='Hello World' x='World', y='Universe' result='Hello Universe'.

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

2 Monate ago

Solved

Return the Fibonacci Sequence

Write a code which returns the Fibonacci Sequence such that the largest value in the sequence is less than the input integer N. ...

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

3 Monate ago