Solved


Compute the Lagarias Riemann Hypothesis sequence
Write a function that takes an input number and produces a sequence (i.e., all values up to and including the th value) compute...

2 years ago

Solved


Compute the unitary totient of a number
The totient function , the subject of Cody Problems 656 and 50182, gives the number of integers smaller than that are relativel...

2 years ago

Solved


List the nth term of Rozhenko’s inventory sequence
Consider a sequence constructed by repeated inventories. A new inventory begins each time a zero is encountered. The first few i...

2 years ago

Solved


Count estrangements
Recently I made a puzzle for my wife that included a cryptogram, which involves an arrangement of the letters A through Z. I use...

2 years ago

Solved


Trap a knight
Consider a knight on an infinite chessboard labeled with numbers spiraling outward. A knight starting on the square labeled 1 ca...

2 years ago

Solved


Compute the Tetris sequence
In the Tetris sequence, which starts with a 1, the next term is the smallest positive integer not already in the sequence that h...

2 years ago

Solved


Flip the parity of digits in a decimal expansion
The number 349 has the decimal expansion . If we change the even digits from positive to negative, then the number becomes 269 (...

2 years ago

Solved


Compute the largest number with a given integer complexity
Cody Problems 42831 and 42834 ask us to compute integer complexity, the smallest number of 1s needed to construct a number with ...

2 years ago

Solved


Sum the unitary divisors of a number
Cody Problems 1933 and 46898 deal with , the sum of divisors function. This problem deals with , the sum of unitary divisors fun...

2 years ago

Solved


Count the unitary divisors of a number
Cody Problem 56738 asks for a list of the unitary divisors of a number. For this problem, write a function to count the unitary ...

2 years ago

Solved


List numbers that are not squares
The numbers 2, 3, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 17, etc. are not perfect squares. Write a function to list the th term in ...

2 years ago

Solved


Count the peaceful queens
In a 5x5 chessboard with a queen of one color (white, say) on the perimeter, one can place 12 black queens on the board such tha...

2 years ago

Solved


Generate the Figure-Figure sequence
After discussing Scott Kim’s FIGURE-FIGURE Figure (below) in Gödel, Escher, Bach, Douglas Hofstadter introduced an integer seque...

2 years ago

Solved


Determine whether the input is an anagram number
In Cody Problem 44293, Mehmet OZC asks us to spell numbers as words. For example, 67 would be “sixty-seven” and 76 would be “sev...

2 years ago

Solved


Compute a determinant
Write a function to compute the determinant of an x matrix with diagonal entries equal to an integer and other entries equal ...

2 years ago

Solved


The sliding puzzle: 3D
This is an extension of problem 42842. In this case, the puzzle is three-dimensional and is of size 3x3x3. Of the 27 positions i...

2 years ago

Solved


Tautology
Check if the given expression is always true. For example, the sentence '~(A & B) == (~A | ~B)' is always true. Chara...

2 years ago

Solved


Is this a valid Tic Tac Toe State?
For the game of <https://en.wikipedia.org/wiki/Tic-tac-toe Tic Tac Toe> we will be storing the state of the game in a matrix M. ...

2 years ago

Solved


Hexagonal numbers on a spiral matrix
Put hexagonal numbers in a ( m x m ) spiral matrix and return the sum of its diagonal elements. Formula of hexagonal numbers ...

2 years ago

Solved


Digit concentration in Champernowne's constant
Consider the first 50 digits of Champernowne's constant 0.12345678910111213141516171819202122232425262728293... The...

2 years ago

Solved


Ned's queens
A tribute to Cody's five-year anniversary should also celebrate the people behind Cody, and in this particular case, our illustr...

2 years ago

Solved


Acid and water
&#9878; &#9878; &#9878; &#9878; &#9878; &#9878; &#9878; &#9878; Assume that there is a 100 liter tank. It is initially fi...

2 years ago

Solved


The 5th Root
Write a function to find the 5th root of a number. It sounds easy, but the typical functions are not allowed (see the test su...

2 years ago

Solved


An asteroid and a spacecraft
&#128640 Imagine a non-relativistic simple situation. Assume positions p0, p1, p2, and p3 are three dimensional Cartesian ...

2 years ago

Solved


Sums of Distinct Powers
You will be given three numbers: base, nstart, and nend. Write a MATLAB script that will compute the sum of a sequence of both ...

2 years ago

Solved


5th Time's a Charm
Write a function that will return the input value. However, your function must fail the first four times, only functioning prope...

2 years ago

Solved


Inscribed Pentagon? 2
Your function will be provided with the five vertices of a pentagon (p) as well as the center point (cp) and radius (r) of a cir...

2 years ago

Solved


Cache me Outside
The test suite includes a simple recursive Fibonacci sequence generator, but it's terribly inefficient. One simple method for im...

2 years ago

Solved


Pernicious Anniversary Problem
Since Cody is 5 years old, it's pernicious. A <http://rosettacode.org/wiki/Pernicious_numbers Pernicious number> is an integer w...

2 years ago

Solved


Twins in a Window
<http://en.wikipedia.org/wiki/Twin_primes Twin primes> are prime numbers that differ by 2, such as [11,13] or [41,43]. Write a f...

2 years ago

Load more