Gelöst


Circular Primes (based on Project Euler, problem 35)
The number, 197, is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime. The...

etwa ein Monat vor

Gelöst


The Goldbach Conjecture
The Goldbach conjecture asserts that every even integer greater than 2 can be expressed as the sum of two primes. Given the eve...

etwa ein Monat vor

Gelöst


Sophie Germain prime
In number theory, a prime number p is a *Sophie Germain prime* if 2p + 1 is also prime. For example, 23 is a Sophie Germain prim...

etwa ein Monat vor

Gelöst


There are 10 types of people in the world
Those who know binary, and those who don't. The number 2015 is a palindrome in binary (11111011111 to be exact) Given a year...

etwa ein Monat vor

Gelöst


Given an unsigned integer x, find the largest y by rearranging the bits in x
Given an unsigned integer x, find the largest y by rearranging the bits in x. Example: Input x = 10 Output y is 12 since ...

etwa ein Monat vor

Gelöst


Find the longest sequence of 1's in a binary sequence.
Given a string such as s = '011110010000000100010111' find the length of the longest string of consecutive 1's. In this examp...

etwa ein Monat vor

Gelöst


Relative ratio of "1" in binary number
Input(n) is positive integer number Output(r) is (number of "1" in binary input) / (number of bits). Example: * n=0; r=...

etwa ein Monat vor

Gelöst


Binary code (array)
Write a function which calculates the binary code of a number 'n' and gives the result as an array(vector). Example: Inpu...

etwa ein Monat vor

Gelöst


Bit Reversal
Given an unsigned integer _x_, convert it to binary with _n_ bits, reverse the order of the bits, and convert it back to an inte...

etwa ein Monat vor

Gelöst


Binary numbers
Given a positive, scalar integer n, create a (2^n)-by-n double-precision matrix containing the binary numbers from 0 through 2^n...

etwa ein Monat vor

Gelöst


Rescale Scores
Each column (except last) of matrix X contains students' scores in a course assignment or a test. The last column has a weighted...

etwa ein Monat vor

Gelöst


Toeplitize a matrix
Similar to <http://www.mathworks.com/matlabcentral/cody/problems/3094-hankelize-a-matrix Problem 3094. Hankelize a matrix>, now ...

etwa ein Monat vor

Gelöst


Hankelize a matrix
Similar to <http://www.mathworks.com/matlabcentral/cody/problems/42501-toeplitize-a-matrix Problem 42501. Toeplitize a matrix>, ...

etwa ein Monat vor

Gelöst


Convert float to base N
The matlab function dec2base converts a positive integer number to a specified base. Extend it so that it works with non intege...

etwa ein Monat vor

Gelöst


Integer complexity (Large numbers)
Inspired by <http://www.mathworks.com/matlabcentral/cody/problems/42831-integer-complexity Problem 42831>, this problem aims to ...

etwa ein Monat vor

Gelöst


Integer complexity
Given an array, n, of positive integers, return an array, c, of the same size, in which each element is the complexity of the co...

etwa ein Monat vor

Gelöst


Number construction III
Given a positive integer, n, return a, b and c, such that 1. n = a^1.5+b^2.5+c^3.5 2. a, b and c are all positive integers...

etwa ein Monat vor

Gelöst


Number construction II
Given a positive integer, n, return a, b, c and d, such that 1. n = a*2^b+c*3^d 2. a, b, c and d are all positive integers...

etwa ein Monat vor

Gelöst


Number construction I
Given a positive integer, n, return a, b, c and d, such that 1. n = a*sqrt(b)+c*sqrt(d) 2. a, b, c and d are all positive ...

etwa ein Monat vor

Gelöst


Find the gcm of n given values
Create a function that given n integer values greater than zero, finds the two numbers with the greatest common divisor and retu...

etwa ein Monat vor

Gelöst


Convert integer to base26 using letters
Write a function that converts a decimal integer to base26 using the letters of the english alphabet, i.e. 0->'a', 1->'b', 2->'c...

etwa ein Monat vor

Gelöst


Fill an array given a sum and array length values
Fill an array with random numbers so that their sum and array length will be equal to the given values as input. Function will g...

etwa ein Monat vor

Gelöst


Binary Inversion
Given the unsigned 8-bit integer x, return the number y which is the binary inversion of x. For example if x is 5, y should b...

etwa ein Monat vor

Gelöst


Make visible max values
Make visible maximum values of rows input = [1 2 3 4 5; 6 9 8 2 1; 2 1 4 5 8; 1 9 7 9 2]; ...

etwa ein Monat vor

Gelöst


prime test
find largest 2 digit prime number

etwa ein Monat vor

Gelöst


Summing Rows and Columns
Create a matrix y of size (n+1) whose last column's elements are the summation of the elements of all the other columns and last...

etwa ein Monat vor

Gelöst


means
Calculate the arithmetic, the geometric and the harmonic mean of a given vector (with positive elements) and return them in a ve...

etwa ein Monat vor

Gelöst


Vector raised to a power, element-wise (★)
Given a vector A and a number x, raise each element of the vector to the power of x. Thus, if A = [2 5 7 1] and x = 0.5, then ...

etwa ein Monat vor

Gelöst


Given a string s, find the length of the longest substring without repeating characters.
Given a string s, find the length of the longest substring without repeating characters. Example 1: Input: s = "abcabcbb" O...

etwa ein Monat vor

Gelöst


Must be in the front row...
You are given a matrix followed by a single number. Your object is to write a script that will shift the matrix around so that ...

etwa ein Monat vor

Mehr laden