Solved


First Duplicate
Given an array of integers, return the first duplicate — i.e., the element that appears more than once and whose second appearan...

3 months ago

Solved


Last Duplicate
Given an array of integers, find the last duplicate element — that is, the element whose second occurrence appears latest in the...

3 months ago

Solved


Compute the antisigma function
The sum of divisors function, or , is the sum of the numbers that divide . The antisigma function is the sum of numbers less tha...

3 months ago

Solved


Classify triangles as acute, obtuse, or right
In an acute triangle, the three interior angles are acute, or smaller than 90 degrees. In an obtuse triangle, one angle is obtus...

3 months ago

Solved


Compile evidence for the Carmichael totient conjecture
The totient function counts the positive integers up to that are relatively prime to . The Carmichael totient conjecture state...

3 months ago

Solved


Find the longest runs of primes generated by polynomials
Cody Problems 60942, 60943, and 60944 involve polynomials that generate primes. No polynomial can generate only prime numbers, b...

3 months ago

Solved


List even numbers whose Goldbach partition does not use the largest prime
The strong Goldbach conjecture says that every even number greater than 2 can be expressed as a sum of two prime numbers—that is...

3 months ago

Solved


List mean-of-2 primes
The prime number 53 is the average of the first prime before it (47) and the first prime after it (59), and the prime number 11 ...

3 months ago

Solved


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

3 months ago

Solved


Evaluate Deterministic Finite Automata on String
Given a Deterministic Finite Automata (DFA) and a string, determine whether or not the DFA will accept when ran on the string. A...

3 months ago

Solved


List the near-square primes, p = n² + 1 (Landau's 4th problem)
Historical context At the 1912 International Congress of Mathematicians, Edmund Landau listed four basic problems about prime...

3 months ago

Solved


List primes which are the sum of two consecutive lower primes plus minus one
Problem statement Some prime numbers can be written as the sum of two consecutive lower primes plus / minus one : Like t...

3 months ago

Solved


Monkey and the Peaches
A monkey picked a certain number of peaches on the first day. Each day, the monkey eats half of the remaining peaches plus one ...

3 months ago

Solved


Check p = 4n +/- 1, the generic formula for odd prime numbers
Problem statement For all odd prime number p, there exists a positive integer n, such that p = 4n +/- 1 : Check this f...

3 months ago

Solved


Check p = 6n +/- 1, the generic formula for odd prime numbers greater than 3
Problem statement For all odd prime number p greater than 3, there exists a positive integer n, such that p = 6n +/- 1 : ...

3 months ago

Solved


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

3 months ago

Solved


List the twin prime couples
Problem statement The twin prime couples (p,p') are the ones such that p' = p + 2. For a given integer n > 1, list the twin p...

3 months ago

Solved


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

3 months ago

Solved


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

3 months ago

Solved


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

3 months ago

Solved


find powers of two
find the unique, non-repeating, powers of 2 that sum to a given non-zero integer, n example: n = 23 result = [1 2 4 16] ...

3 months ago

Solved


q-dimensional Cartesian product
Your mission, should you choose to accept it, is to compute a q-dimensional Cartesian product, as follows. Let the input G be an...

3 months ago

Solved


Compute the tersum
The tersum, which appears in certain mathematical games, involves adding two numbers in base 3 without carry and converting back...

3 months ago

Solved


Moving Movsum
Given a vector (x) and a window (y), calculate the sum s(k) corresponding to k-y(k)+1:k values of x %%Example 1 x = [1 2 3 4...

3 months ago

Solved


Enclosure Matrix
The problem gives you a positive integer n. You need to create a matrix consisting of n layers of natural numbers; the outermost...

3 months ago

Solved


The Classic 8-5-3 Sharing ( Medium )
You have 3 jugs with capacities [8,5,3]. The 8L jug, the others are empty: [8,0,0]. There is no tap and no drain. You can only p...

3 months ago

Solved


Mirror Pair Mean
Given a row or column vector v, create a vector y of the same size where each element is replaced by the average of itself and i...

3 months ago

Solved


Odd Run Sums
Given a row vector x of integers, find every maximal run of consecutive odd numbers and return a row vector containing the sum o...

3 months ago

Solved


Center-of-Mass Index of a Vector
Given a numeric vector x, treat each element x(i) as a mass located at index i. Compute the center-of-mass index idx = sum(i *...

3 months ago

Solved


First Unique Character
Given a character vector s, return the first character that appears exactly once in s. If every character repeats at least once...

3 months ago

Load more