已解决


Is the number of 1s in a binary integer odd or even?
Your function should turn the input integers into binary form and count the number of 1s in the binary. If the number is odd, re...

3 years 前

已解决


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

3 years 前

已解决


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

3 years 前

已解决


Number of odd and even elements within matrix
Input(m) - any matrix with integers Output(n) - n(1)=number of odd elements, n(2)=number of even elements Example: * m=...

3 years 前

已解决


Prime Time
All you need to do here is submit your solution a prime number of seconds after the top of the hour. Any hour at all... Easy, ...

3 years 前

已解决


Leftovers? Again?!
I am thinking of a positive number X. To determine what number I am thinking of, I will give you two 1xN vectors. The first ve...

3 years 前

已解决


Multiply each matrix element by its row index and add its column index.
Return a matrix the same size as the input, multiply each element by its row index and add its column index. Example: x = [ 1 ...

3 years 前

已解决


Cluster Partition
Given an array (row or column) of numbers, divide the array into consecutive positive/negative numbers. 0 is to be treated inde...

3 years 前

已解决


Create an arrow matrix
An arrow matrix is a square matrix that contains ones on the diagonal, the last column, and last row. ...

3 years 前

已解决


Canadian Conundrum
After succesfully completing the French Conundrum, you have decided to take a vacation. Your trip is amongst the mighty mountai...

3 years 前

已解决


French Conundrum
The French army is trapped, sorrounded in backwards direction (South and West directions) by enemy traps and ambushes. You are n...

3 years 前

已解决


Calculate the Distance to Source of Lightning
Lightning discharge heats air rapidly with lightning channels reaching temperatures of up to 50,000 degrees Fahrenheit (which is...

3 years 前

已解决


Determine if Input is Oddish or Evenish (Odd/Even Sum of Digits)
Given a positive integer n, determine whether n is "oddish" or "evenish" - that is, whether the sum of the digits of n is odd or...

3 years 前

已解决


Easy Sequences 78: Trailing Zeros of Factorial Numbers at any Base
Given an integer and a number base , write a function that calculates the number of trailing zeros of the factorial of when wr...

3 years 前

已解决


Create block matrix of integers (j+k-1) - Part II
Given m, n, p, and q, create an m-by-n matrix made up of submatrices, each sized p-by-q (if possible - the last row and column o...

3 years 前

已解决


Create block matrix of integers (j+k-1) - Part I
Given m, n, p, and q, create a matrix of m-by-n blocks (submatrices), each sized p-by-q. The elements of the (j,k)th block all h...

3 years 前

已解决


Triangle Coordinates
Given a natural number n, return two -element vectors, x and y, containing the coordinates of a triangular arrangement of points...

3 years 前

已解决


Dartboard Average II
A dartboard arranges the numbers 1 to 20 such that each value is typically flanked by quite different values - for example, 20 i...

3 years 前

已解决


Possible Rugby Scores
Given a natural number s (> 4), representing a rugby team's score, return an n-by-3 matrix representing all n possible combinati...

3 years 前

已解决


Dartboard Average I
A dartboard arranges the numbers 1 to 20 such that each value is typically flanked by quite different values - for example, 20 i...

3 years 前

已解决


Angle Between Analog Clock Hands
Given a datetime variable t, return the angle (in degrees) between the hour and minute hands of an analog clock at the time repr...

3 years 前

已解决


Identifying teenager
Suppose the age of a person is given. If he/she is a teenage, answer is 'yes'. Otherwise, the answer is 'no'.

3 years 前

已解决


Split Even Number Into Two Primes
Given an even whole number n (> 2), return a 2-element vector of primes, p, such that p(1) + p(2) = n. Fun note: technically it...

3 years 前

已解决


Boustrophedon
Given a vector v and a positive integer n, return an m-by-n matrix containing the elements of v row-wise, alternating left-to-ri...

3 years 前

已解决


Where the Four Corners Am I? (Vectorized)
NOTE: this problem is intended to build on problem #55960 ("Where the Four Corners Am I?"). You may wish to solve that problem f...

3 years 前

已解决


Where the Four Corners Am I?
The "Four Corners" region of the US is where Colorado, Utah, Arizona, and New Mexico all meet - the only place where four states...

3 years 前

已解决


Next Tribonacci Number
The "Tribonacci" sequence is an extension of the idea of the Fibonacci sequence: That is, each new term is the sum of the thr...

3 years 前

已解决


Generate Tribonacci Sequence
The "Tribonacci" sequence is an extension of the idea of the Fibonacci sequence: That is, each new term is the sum of the thr...

3 years 前

已解决


Calculate Wind Chill Factor
The NWS Wind Chill Temperature (WCT) index formula for calculating the dangers from winter winds and freezing temperatures: Cal...

3 years 前

已解决


Korselt's Criterion
A composite integer n (n>=2) divides b^n-b, i.e. mod(b^n-b,n)==0, for all integers b if and only if n is square-free (doesn't ha...

3 years 前

加载更多