Solved


List unitary divisors of a number
A unitary divisor of a number divides and satisfies gcd(,) = 1. For example, 9 is a unitary divisor of 18 because gcd(9,2) = ...

4 months ago

Solved


List numbers that are not in the Fibonacci sequence
In the list of 4797 Cody problems, 53 deal with or refer to the Fibonacci sequence.* What about the other numbers? Write a funct...

4 months ago

Solved


Determine whether one vector is a subset of another
While bumbling through a pair of problems in the Number Theory group, I wrote code to determine whether a vector is a subset of ...

4 months ago

Solved


Find the length of stream affected by a spill
When a contaminant is spilled into a stream, one might want to know how much of the stream is affected—e.g., the length over whi...

4 months ago

Solved


Count the ways to make Scorigami
Regarding the sport known as American football, some people are such rabid fans that they can tell you the statistics of every p...

4 months ago

Solved


Solve an ODE: concentrations predicted by the cells-in-series model
One approach for predicting mixing and transport of contaminants in a river is the cells-in-series model. The model divides a ri...

4 months ago

Solved


Spell musical triads
Chords form the basis of harmony in music. The most basic chords are triads, or groups of three notes. They are specified by thr...

4 months ago

Solved


Solve an ODE: precocious pair’s porcine pursuit
In our previous encounters with Matilda and Labrun, the scintillating siblings collected candy wrappers, amused others with card...

4 months ago

Solved


Solve an ODE: first-order linear equation
In the fall semester of [redacted], my professor for a course on ordinary differential equations said, “There are two groups of ...

4 months ago

Solved


Solve an ODE: nonlinear third-order equation
Write a function to solve the ordinary differential equation on the domain with , , and either or . The input variable ord ...

4 months ago

Solved


Check whether a Wordle guess is consistent with previous feedback
The game Wordle resembles the classic game Mastermind. Players try to guess a five-letter word, and after each guess they are to...

4 months ago

Solved


Determine whether a player solved a Cody problem
Write a function to determine whether a player has solved the specified Cody problems. The problem numbers are specified as a ve...

4 months ago

Solved


Collect a set of candy wrappers
This past Halloween, the siblings Matilda and Labrun amused (and sometimes confused) their many neighbors with their costumes in...

4 months ago

Solved


Sum of Elements Above the Main Diagonal of a Square Matrix
Given a square matrix as input, write a function that returns the sum of all elements above the main diagonal. If the input mat...

4 months ago

Solved


Multiply binary numbers
Write a function to multiply two binary numbers input as strings. For example, input values of ‘1011’ and ‘101’ should give ’110...

4 months ago

Solved


Pick the die most likely to win
After discussing Rock, Paper, Scissors, Lizard, Spock in The Simpsons and their Mathematical Secrets, Simon Singh writes that in...

4 months ago

Solved


Compute a sum involving the totient over divisors of a number
Write a function to compute the following sum: where is the totient function. The sum is computed over the divisors of (inc...

4 months ago

Solved


Solve an ODE: equation C
Write a function to solve the following ordinary differential equation: with and . The parameter is a constant. The functi...

4 months ago

Solved


Eliminate redundant numbers in text
Occasionally someone might write text such as Briefly explain one (1) common problem that can result from the constant use of ...

4 months ago

Solved


List the titles of Cody problems
Cody has several ways to list problems, but I have not yet found an easy way to list them by their numbers. Listing by date crea...

4 months ago

Solved


Solve an ODE: equation B

4 months ago

Solved


Solve an ODE: equation A
Write a function to solve the following ordinary differential equation: with and . The function should return the values of...

4 months ago

Solved


Add 100

4 months ago

Load more