Resuelto


Draw '5' in Chinese.
Draw a x-by-x matrix '五' using 1s and 0s. Example: x=5 ans= [1 1 1 1 1 0 1 0 0 0 1 1 1 1 0 0 1 0 1 0 1 1 1 1 1] x=7...

10 meses hace

Resuelto


Create an empty array
Suppose you need an empty array. e = [] will give you one, but it's a double array, which may not help if you need a differen...

10 meses hace

Resuelto


Integrate a product of gamma functions
Write a function to compute the following integral: where and is the gamma function, the subject of Cody Problem 46025.

10 meses hace

Resuelto


Determine whether a number is prome
In discussing the unique factorization of numbers in Elementary Number Theory, Underwood Dudley devised a new number system: “C...

10 meses hace

Resuelto


Remove runs of at least n consecutive NaNs
This problem is inspired by Dyuman Joshi's problem 58329. Given a row vector x and a natural number n, remove all runs of at lea...

10 meses hace

Resuelto


List numbers that cannot be expressed as the sum of fewer than four squares
Lagrange proved that all positive integers can be expressed as the sum of four squares. For example, 27 = 16 + 9 + 1 + 1. Howeve...

10 meses hace

Resuelto


Find the circle inscribed in a triangle
Write a function that takes the x- and y-coordinates of three points describing the vertices of a triangle and returns the cente...

10 meses hace

Resuelto


Sequence Vectorization - I
Given a Natural number N, return the sequence - [1 1 2 1 2 3 1 2 3 4 ... 1 2 3 ... N-3 N-2 N-1 N] i.e. the horizontal concatenat...

12 meses hace

Resuelto


List numbers such that every sum of consecutive positive integers ending in those numbers is composite
The sequence in question in this problem involves numbers such that all sums of consecutive positive integers ending with are ...

alrededor de 1 año hace

Resuelto


List the two-bit primes
Each year at Christmas, my father-in-law and his partner send me the Puzzle Mania section from the New York Times. This year’s e...

alrededor de 1 año hace

Resuelto


Inscribe a circle in a triangle with a side of length equal to the circle’s circumference
A circle of radius is inscribed in a triangle with a side that has a length equal to the circle’s circumference. The center of ...

alrededor de 1 año hace

Resuelto


Easy Sequences 94: GCD Sums
Given positive integer , write the function gSum(x), that sums all the GCD's of the integer pairs . For example in the Excel scr...

alrededor de 1 año hace

Resuelto


The Yellowstone Permutation
The Yellowstone Permutation is a sequence of positive integers, defined by the following rules: No term is repeated. Given n t...

alrededor de 1 año hace

Resuelto


Solve an equation involving primes and fractions
Write a function to find pairs of primes and satisfying the equation where is an integer. The function should take a numbe...

alrededor de 1 año hace

Resuelto


Compute frequency factors for the normal distribution
In frequency analysis in hydrology, the streamflow corresponding to a specified exceedance probability (or return period ) can...

alrededor de 1 año hace

Resuelto


Determine flows of given probability using empirical frequency analysis
Write a function that takes as input observations of peak streamflow and exceedance probabilities expressed as percentages an...

alrededor de 1 año hace

Resuelto


Find patterns in subprime Fibonacci sequences
Lots of Cody problems involve Fibonacci and Collatz sequences. Fibonacci sequences start with two numbers, and later terms are c...

alrededor de 1 año hace

Resuelto


Is this triangle right-angled (mixed sides)?
Implement function returning if triangle is right angled or not? Input argument is vector row with not ordered triangle sides. ...

alrededor de 1 año hace

Resuelto


Hermite Polynomials
Problem 1304 deals with Hermite polynomial of the physicist's type. In this problem, Return the n-th Hermite polynomial of the ...

alrededor de 1 año hace

Resuelto


About jokes (and compression)
An argument can be made about jokes. The shorter they are, the funnier. Further explained here: https://en.wikipedia.org/wiki/Hu...

alrededor de 1 año hace

Resuelto


Counting Permutations
In the permutations of the numbers 1 to n, count the number of permutations in which exactly m elements are greater than the pre...

alrededor de 1 año hace

Resuelto


Compute the area of the shoemaker’s knife
A shape resembling a shoemaker’s knife is constructed from a semicircle with diameter with two semicircular “bites” of diameter...

alrededor de 1 año hace

Resuelto


Locate image wells
A mathematical model of wells pumping groundwater near a boundary can be constructed using the method of images, which is also u...

alrededor de 1 año hace

Resuelto


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

alrededor de 1 año hace

Resuelto


Compute a nested cube root
Consider the quantity . Write a function to compute without using loops or recursion.

más de 1 año hace

Resuelto


Exact Cover
An efficient solution to the exact cover problem can be useful in many situations. In this problem, you are welcome to use Knuth...

más de 1 año hace

Resuelto


Intersection points of a polynomial
Find the intersection points of a polynomial, given by its vector of coefficients with the X-axis and the Y-axis. Input: a poly...

más de 1 año hace

Resuelto


Harmonic series counting
The function takes a positive limit as input, And counts how many terms must be summed in the harmonic series: 1/1, 1/2, 1/3, ...

más de 1 año hace

Resuelto


Easy Sequences 86: The "real" Hyperprimorials
In Easy Sequences 85, we define the hyperprimorial of , as a exponent ladder of primes numbers from the -th prime down to first ...

más de 1 año hace

Resuelto


Dyck words
A Dyck word can be considered as a string of n X's and n Y's arranged to have at least as many X's in an initial segment of the ...

más de 1 año hace

Cargar más