解決済み


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

3年以上 前

解決済み


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

3年以上 前

解決済み


Hyperperfect Numbers
A k-hyperperfect number is a natural number n for which the equality n = 1 + k(σ(n) − n − 1) holds, where σ(n) is the divisor ...

3年以上 前

解決済み


Determine whether a number is practical
A number is practical if all smaller numbers can be written as a sum of the proper divisors of . The number 24 is practical bec...

3年以上 前

解決済み


List odd twin composites
Twin primes, or prime numbers that differ by 2 (e.g., 17 and 19, 59 and 61, or 191 and 193), are the subject of several Cody pro...

3年以上 前

解決済み


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

3年以上 前

解決済み


Find the particular dividend
It is known that once you write the sequence 10101...101 long enough, the number will be finally divisible by any odd number if ...

3年以上 前

解決済み


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

3年以上 前

解決済み


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

3年以上 前

解決済み


Local Extrema
Given a 2D (m,n>1) matrix, replace an element if it is not a local extrema (minima/maxima), with 0 (zero). The comparison crite...

3年以上 前

解決済み


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

3年以上 前

解決済み


Leyland Primes
A Leyland Number is defined as a number of the form - x^y + y^x, or, x^y - y^x (x,y)>1 Given an array of numbers(>1), check...

3年以上 前

解決済み


Compute the period of a pendulum started from a finite initial angle
Cody Problem 49830 asks for the period of a pendulum swinging through a small angle. Here the pendulum started at rest from an ...

3年以上 前

解決済み


Weird Diagonal Matrix!!
Given an integer n, create a matrix whose diagonal elements will be square matrices of size 1 to n. For example: n=2 z = ...

3年以上 前

解決済み


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

3年以上 前

解決済み


Define an arithmetic sequence
Given three numbers n, a, and d, define an arithmetic sequence of n terms with a being the initial term of the sequence and d be...

3年以上 前

解決済み


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

3年以上 前

解決済み


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

3年以上 前

解決済み


That's not my hat!
There exists a highly secretive hat consortium. Members possess identical hats. The members are invited to a meeting. All of the...

3年以上 前

解決済み


List the Euclid numbers
Euclid proved that the number of primes is infinite with the following argument. Suppose the primes form a finite set , , . Comp...

3年以上 前

解決済み


Evaluate the Kelvin functions
The Kelvin functions ber, bei, ker, and kei are related to Bessel functions of order . When the order is not specified, the defa...

3年以上 前

解決済み


prime consecutive sums
Create a number sequence of 1 to n, such that the sums of every two consecutive numbers are all primes. E.g. if n = 5, you may ...

4年弱 前

解決済み


Fill a rectangle with 1x1 and 2x2 tiles
A 3x2 rectangle can be filled with 1x1 and 2x2 tiles in three ways: The colors merely distinguish the sizes of the tiles. A 3...

4年弱 前

解決済み


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

4年弱 前

解決済み


Get twenty-four
Inpur four integers in 1 to 10, you may use plus, minus, multiply and divid to get 24. Note that every integer should be used on...

4年弱 前

解決済み


Palindrome Problem 1
Continued Problem 50033: A palindrome is one-thirteenth of the sum of and , where and are also palindrome. Give an example o...

4年弱 前

解決済み


Concatenate input positive integers to obtain a maximum.
Input some integers, you need to concatenate them to obtain a maximum integer. Neither use library function "perms" to list all ...

4年弱 前

解決済み


N-th Digit of all Write-Down Numbers
Write-Down Numbers are: 123456789101112131415161718192021222324252627282930... What is the N'th digit (where N is represented a...

4年弱 前

解決済み


n-th digit of write-down all numbers
Write down number as 123456789101112131415161718192021222324252627282930... what's the n-th digit? input n and get the digit.

4年弱 前

解決済み


Evaluate Poker Hand
Given an input table of card values and card suits between five and thirteen cards, choose the best five cards and output the ra...

4年弱 前

さらに読み込む