A résolu


Form a square matrix from four square sub-matrices
Create a square matrix, y, from 4 square sub-matrices that will be constructed (x1, x2, x3, x4): y = [x1 x2; x3 x4]; ...

environ 9 ans il y a

A résolu


How long is the longest prime diagonal?
Stanislaw Ulam once observed that if the counting numbers are <http://en.wikipedia.org/wiki/Ulam_spiral arranged in a spiral>, t...

environ 9 ans il y a

A résolu


Eight Queens Solution Checker
Write a function to verify whether an arrangement of queens on a chessboard is a valid solution to the classic <http://en.wikipe...

environ 9 ans il y a

A résolu


N-Queens Checker
Picture a chessboard populated with a number of queens (i.e. pieces that can move like a queen in chess). The board is a matrix,...

environ 9 ans il y a

A résolu


Project Euler: Problem 4, Palindromic numbers
A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 ...

environ 9 ans il y a

A résolu


Dudeney Numbers: Numbers which are the cube of their decimal sum
From Wikipedia: _A Dudeney number is a positive integer that is a perfect cube such that the sum of its decimal digits is equa...

environ 9 ans il y a

A résolu


Determine if input is a perfect number
A <http://en.wikipedia.org/wiki/Perfect_number/ perfect number> occurs whent the sum of all divisors of a positive integer, exce...

environ 9 ans il y a

A résolu


Find Pseudo-Cyclic Number
A cyclic number is an integer in which cyclic permutations of the digits are successive multiples of the number https://en.wikip...

environ 9 ans il y a

A résolu


Fangs of a vampire number
A <http://en.wikipedia.org/wiki/Vampire_number vampire number> is a number v that is the product of two numbers x and y such tha...

environ 9 ans il y a

A résolu


Check if two matrices are permutations of each other
Your function should return true for the elements of one matrix is the permutation of the other matrix: x = [1 2 3; 4 5 6; ...

environ 9 ans il y a

A résolu


Divide elements by sum of elements
In this problem, I ask you to write a function which will divide the elements of each column by the sum of the elements of the s...

environ 9 ans il y a

A résolu


index of n^2 in magic(n)
input=5 magic matrix 17 24 1 8 15 23 5 7 14 16 4 6 13 20 22 10 ...

environ 9 ans il y a

A résolu


Permute diagonal and antidiagonal
Permute diagonal and antidiagonal For example [1 2 3;4 5 6;7 8 9] -> [3 2 1;4 5 6;9 8 7] WITHOUT diag function (and variable n...

environ 9 ans il y a

A résolu


Find the maximum two numbers of every column of a matrix
Find the maximum two numbers of every column of a matrix. Example: If we input a matrix A = [ 1 2 4 6 0 3 ...

environ 9 ans il y a

A résolu


row-th maximum row elements
Input a is a square matrix of size n*n. Output vector v is of size 1*n. The ith element of output v is the ith largest element o...

environ 9 ans il y a

A résolu


Create an m x n array consisting only of an input value.
Create an array with m rows and n columns wherein all entries are assigned the input value x.

environ 9 ans il y a

A résolu


Pascal's Matrix
Given an integer n &ge; 0, generate the ( _n_+1) &times; ( _n_+1) lower triangular <http://en.wikipedia.org/wiki/Pascal_matrix P...

environ 9 ans il y a

A résolu


Find the product of the positive elements above the main diagonal.
Example Input A=[1 2; -3 0] Output 2

environ 9 ans il y a

A résolu


Numbers at bit-boundary
Find if a number is on or below the bit-boundary, as defined below. Examples 7,9 straddle the bit-boundary at 2^3 as do 31...

environ 9 ans il y a

A résolu


Convert decimal to binary and then generate the minimum binary it can with jumbling
input is 10 --> 1010 output should be 3 --> 0011 input 23 --> 10111 output should be 15 --> 01111

environ 9 ans il y a

A résolu


X plus binary inverted x
Given a n-bits number x, what is the sum of x to the binary inverted version of x? (this might be more simple than you think :-)...

environ 9 ans il y a

A résolu


User defined nextpow function
Create a function which will take 2 arguments as n and x, and return y, where, n^y >= abs(x). [ Similar to builtin "nextpow2" fu...

environ 9 ans il y a

A résolu


Look and say Conway's sequence
In mathematics, the look-and-say sequence is the sequence of integers beginning as follows: 1, 11, 21, 1211, 111221, 312211, ...

environ 9 ans il y a

A résolu


Index of a Rational number
The set of real numbers are infinite. They are so many that real numbers can't even be enumerated. However, unlike real numbers ...

environ 9 ans il y a

A résolu


Construct an index vector from two input vectors in vectorized fashion
Create an index vector defined by two input vectors, one defining the beginnings of one or more index ranges, and the other defi...

environ 9 ans il y a

A résolu


Numbers with prime factors 2, 3 and 5.
Make a function which takes one positive integer n and returns a matrix with the numbers of the form (2^i)*(3^j)*(5^k) which are...

environ 9 ans il y a

A résolu


Remove the air bubbles
Given a matrix a, return a matrix b in which all the zeros have "bubbled" to the top. That is, any zeros in a given column shoul...

environ 9 ans il y a

A résolu


Pandigital Factors (Based on Euler 491)
A Pandigital Number is a number containing all of the digits from 0-9 inclusive, with the added stipulation that it does not hav...

environ 9 ans il y a

A résolu


It's going down. We're finding simbers!
This problem is inspired by Project Euler 520: Simbers. "We define a simber to be a positive integer in which any odd digit, ...

environ 9 ans il y a

A résolu


Max Change in Consecutive Elements
If an array is given as input then find the index of consecutive elements that represent maximum change. Example: Input ...

environ 9 ans il y a

Charger plus