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

etwa ein Monat vor

Gelöst


Column norms of a matrix
Given a matrix M, return a vector y such that for each k y(k)=norm(M(:,k)) (y(k) is the Euclidean norm of the k-th col...

etwa ein Monat vor

Gelöst


Subtract integers and add doubles
Create a function that subtracts a from b if a and b are integers and adds them if they are floats.

etwa ein Monat vor

Gelöst


Nearest Numbers
Given a row vector of numbers, find the indices of the two nearest numbers. Examples: [index1 index2] = nearestNumbers([2 5 3...

etwa ein Monat vor

Gelöst


Find the first occurence of a given gap between two consecutive prime numbers
Problem statement Given a gap = p' - p between the two consecutive prime numbers p and p', find its first occurence, f. E...

etwa ein Monat vor

Gelöst


Check the integers additive decomposition conjecture
Problem statement A conjecture (I rediscovered ?) related to Goldbach's one states that every integer above 2 can be written ...

etwa ein Monat vor

Gelöst


Check p² = 24k + 1, p > 3, the 'golden prime squares' equation
Historical context In december 2023, I / Nicolas Douillet was working on prime squares properties and I found* the formula : ...

etwa ein Monat vor

Gelöst


Euclid primes
Historical context Euclid, the greek mathematician proved at his time that the prime numbers set is an infinite. By the way he ...

etwa ein Monat vor

Gelöst


Fermat primes
Historical context The french mathematician Pierre de Fermat found the formula to find some prime numbers. He thought / co...

etwa ein Monat vor

Gelöst


Ulam primes first formula
Historical context The polish-american mathematician Stanislaw Ulam found the formula to give the first 760 prime numbers ...

etwa ein Monat vor

Gelöst


Ulam primes second formula
Historical context The polish-american mathematician Stanislaw Ulam found the formula to give some prime numbers not given...

etwa ein Monat vor

Gelöst


Euler primes
Historical context The great swiss mathematician Leonhard Euler found the formula to give some prime numbers. Problem...

etwa ein Monat vor

Gelöst


Frequencies of prime gaps
Problem statement Given two positive integers n and , write a function which computes the frequency of the gap between two ...

etwa ein Monat vor

Gelöst


Prime numbers which are the difference of two consecutive cubes
Problem statement Given a positive integer n greater than 2, find the prime numbers less or equal to n and which are the diff...

etwa ein Monat vor

Gelöst


expand intervals vol.2
Similar to problem <http://www.mathworks.co.uk/matlabcentral/cody/problems/2528 2528>. This is a more general case, when bounds ...

etwa ein Monat vor

Gelöst


remove single elements
Given a vector of integers, remove the elements that have appeared only once. The output elements should be in exact order as th...

etwa ein Monat vor

Gelöst


expand intervals vol.3
This is the next problem after <http://www.mathworks.co.uk/matlabcentral/cody/problems/2528 2528> and <http://www.mathworks.co.u...

etwa ein Monat vor

Gelöst


Make a rainbow matrix (follow-up to checkerboard matrix)
Given an integer n, make an n-by-n matrix as shown below. The a(1,1) should be 0. As we move away from the top-left, the number ...

etwa ein Monat vor

Gelöst


Linear primes p' = mp + n
Problem statement List the prime numbers of the form p' = mp + n for a given (m,n) couple and such that p' < k, k positive in...

etwa ein Monat vor

Gelöst


Check Legendre's conjecture
Context and problem statement Legendre's conjecture states for a given positive integer n, there always exists at least one pri...

etwa ein Monat vor

Gelöst


Check Bertrand-Chebyshev's theorem about prime numbers
Historical context Bertrand's postulate, also later known as Chebyshev's theorem, is a very important theorem in number theory ...

etwa ein Monat vor

Gelöst


Chek the Delta = p' - p = 6k gap theorem about arithmetic progressions in the prime number set
Context In the prime numbers set there are some arithmetic progressions (sequences of three or more consecutive prime number...

etwa ein Monat vor

Gelöst


List the complementary / symetric prime couples
Problem statement For a given positive integer n, provide the prime couples (p,p') such that p + p' = 10^n. NB : a number li...

etwa ein Monat vor

Gelöst


Sum the 'edge' values of a matrix
Sum the 'edge' values of an input matrix (the values along the perimeter). Example [1 2 3 4 5 6 7 8 9] Output = ...

etwa ein Monat vor

Gelöst


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

etwa ein Monat vor

Gelöst


Flipping
Write code that can reverse the vector without using any sort of loop. Example Given the input vector A = [ 1 2 3 4 5...

etwa ein Monat vor

Gelöst


Flip the diagonal values
Write a program that flip the elements of main diagonal , upper and lower diagonal values of a sqare matrix. For example if a ...

etwa ein Monat vor

Gelöst


Flip the bit
Given an input character string (e.g. '1001'), return a character string with the bits flipped ('0110').

etwa ein Monat vor

Gelöst


Flipping a Matrix
Flipping matrix up and down. If a central row is exists, leave it, and flip remaining rows. Example Mat = magic(3) ...

etwa ein Monat vor

Gelöst


Swap two numbers
Example Input: a = 10 b = 20 Output a = 20 b = 10

etwa ein Monat vor

Mehr laden