Solved


Count the ways to write 1/n as the sum of two unit fractions
The number 1/2 can be written as 1/3+1/6 and 1/4+1/4, and the number 1/9 can be written as 1/18+1/18, 1/12+1/36, and 1/10+1/90. ...

3 months ago

Solved


Classify numbers as abundant, deficient, or perfect
A number is perfect if the sum of its proper divisors (i.e., divisors excluding the number itself) is equal to itself. For examp...

3 months ago

Solved


Calculating the Union Area of Overlapping Rectangles
Calculate the area covered by a union of multiple rectangles. Each rectangle is represented by 4 integers: the first two integer...

3 months ago

Solved


List primes of the form xy+z
Consider three consecutive integers , , and . When is the number prime? For example, if or , then the results are 17 and 37, ...

3 months ago

Solved


Extend the digamma function to negative arguments
While solving one of Ramon Villamangca’s problems, I needed the value of , where is the digamma function. However, MATLAB’s fun...

3 months ago

Solved


Identify winnable games of Take a Square
A game has a pile of tokens, and two players alternate in taking a certain number of tokens from the pile, with the constraint t...

3 months ago

Solved


Conditional transpose
You're given two vectors of the same length, x and y, which might be row or a column vectors. Your task is to ensure that y has ...

3 months ago

Solved


Find the closest geyser prime
My wife and I celebrated our honeymoon and our recent anniversary in Yellowstone and Grand Teton National Parks. After returning...

3 months ago

Solved


Delete some elements in the natural set and find the sum of the first n terms
Delete the number (except 0,1) with a complete square number from the natural set of numbers, form a new set of numbers, find th...

3 months ago

Solved


List the partitions of an integer
Several Cody problems deal with partitions of an integer, or the ways an integer can be written as the sum of positive numbers—...

3 months ago

Solved


Find the Nth number in the 8-sequence
Find the Nth number in the 8-sequence. 8, 16, 24, 32, 48, 56, 64, 72, 88, ... Hint: Refer test suites

3 months ago

Solved


Find the Nth number in the 7-sequence
Find the Nth number in the 7-sequence. 7, 14, 21, 28, 35, 42, 49, 56, 63, 77, 84, ... Hint: Refer test suites

3 months ago

Solved


Find the Nth number in the 6-sequence
Find the Nth number in the 6-sequence. 6, 12, 18, 24, 36, 42, 48, 54, 66, ... Hint: Refer test suites

3 months ago

Solved


Find the Nth number in the 5-sequence
Find the Nth number in the 5-sequence. 5, 15, 25, 35, 45, 55, ... Hint: Refer test suites

3 months ago

Solved


Find the Nth number in the 4-sequence
Find the Nth number in the 4-sequence. 4, 8, 12, 16, 24, 28, 32, 36, 44 ... Hint: Refer test suites

3 months ago

Solved


Find the Nth number in the 3-sequence
Find the Nth number in the 3-sequence. 3, 6, 9, 12, 15, 18, 21, 24, 27, 33 ... Hint: Refer test suites

3 months ago

Solved


Find the Nth number in the 2-sequence.
Find the Nth number in the sequence. 2, 4, 6, 8, 12, 14, 16, 18, 22, ... Hint: Refer test suites

3 months ago

Solved


2x2 binning of a large sparse matrix
Consider the 20000 x 20000 sparse matrix, A=round(sprand(2e4,2e4,1/1e4*100)*1000); The task is to divide this matrix into 2x...

3 months ago

Solved


Build a block Toeplitz matrix
A symmetric block Toeplitz matrix has the form, where the are compatibly-sized matrices. Write a routi...

3 months ago

Solved


Identify points inside a Reuleaux triangle
Write a function to identify points that lie in or on a Realeaux triangle, which is a curve of constant width. The input to the ...

3 months ago

Solved


Express integers in negabinary
Negabinary numbers are written in base -2. For example, the negabinary number 11010 is , or 6 in base 10. In a similar way, -3 i...

3 months ago

Solved


Count the primes resulting from changing one digit of a number
If you start with the number 24 and seek primes by changing a single digit, you can find two: 23 and 29. If you start with 130, ...

3 months ago

Solved


Sum of Even Fibonacci Numbers
Description: The Fibonacci sequence is defined as follows:F(1)=1,F(2)=1,F(n)=F(n−1)+F(n−2) for n>2 Write a function that compu...

3 months ago

Solved


Remove Duplicate Words from a Sentence
Given a sentence as a string, remove all duplicate words while keeping their first occurrence and maintaining the original word ...

3 months ago

Solved


Remove Duplicate Words from a Sentence.
Given a sentence, remove any duplicate words, leaving only the first occurrence of each word. The output sentence should have wo...

3 months ago

Solved


Project Euler Problem 48: Self Powers
The series,. Return a string of the last ten digits of the series:. Hint: Use modular arithmetic! Spoiler: The solution is...

3 months ago

Solved


Check if a Number is a Palindrome Without Converting to String
Write a function that checks if a given positive integer is a palindrome without converting the number to a string or using stri...

3 months ago

Solved


Greater than before
Given an array of integers, write a function that returns elements that are greater than the one before them. For instance, ...

3 months ago

Solved


Symmetric Pair
Given an (n, 2) matrix, remove any symmetric pairs from the matrix. Keep the first occurrence. (2, 3) and (3, 2) are considere...

3 months ago

Solved


Most Frequent Characters
Given a document file or a character array, identify the 'n' most frequently occurring characters and the number of times each a...

3 months ago

Load more