The Goldbach Conjecture, Part 2
The <http://en.wikipedia.org/wiki/Goldbach's_conjecture Goldbach
conjecture> asserts that every even integer greater than 2 can ...
2年弱 前
解決済み
Twins in a Window
<http://en.wikipedia.org/wiki/Twin_primes Twin primes> are prime numbers that differ by 2, such as [11,13] or [41,43]. Write a f...
2年弱 前
解決済み
Twin Primes
Twin primes are pairs of primes that are immediately next to each other (difference of two). The lesser of twin primes are 3, 5,...
2年弱 前
解決済み
Prime factor digits
Consider the following number system. Calculate the prime factorization for each number n, then represent the prime factors in a...
2年弱 前
解決済み
Extra safe primes
Did you know that the number 5 is the first safe prime? A safe prime is a prime number that can be expressed as 2p+1, where p is...
2年弱 前
解決済み
Find the nearest prime number
Happy 5th birthday, Cody! Since 5 is a prime number, let's have some fun looking for other prime numbers.
Given a positive in...
2年弱 前
解決済み
Pernicious Anniversary Problem
Since Cody is 5 years old, it's pernicious. A <http://rosettacode.org/wiki/Pernicious_numbers Pernicious number> is an integer w...
2年弱 前
解決済み
Průměr z výběrového souboru
Napište funkci, která vrátí průměr z hodnot vektoru data. Např data = [1, 2, 3, 4, 5, 6, 7, 8, 9] je prumer = 5.
Alphabetize by last name
Given a list of names in a cell array, sort the list by the last name. So if
list = {'Barney Google','Snuffy Smith','Dagwood ...
2年弱 前
解決済み
Data decompression
A chunk of data is to be 'decompressed'.
Input:
* compressed: a row vector of uint8 values. This is the compressed data.
...
2年弱 前
解決済み
QWERTY coordinates
Given a lowercase letter or a digit as input, return the row where that letter appears on a standard U.S. QWERTY keyboard and it...
2年弱 前
解決済み
Pangrams!
A pangram, or holoalphabetic sentence, is a sentence using every letter of the alphabet at least once.
Example:
Input s ...
2年弱 前
解決済み
Word Distance - Sum
Let's suppose that the distance of a word can be calculated by summing the differences between its letters, having assigned the ...
With apologies to William Blake
Coder Coder, typing fast
Sitting at your desk, aghast.
What immortal MATLAB script
will solve this problem, nice and qu...
2年弱 前
解決済み
Diagonal of a Spiral Matrix
Write a function that will return same output as diag(spiral(n)). The only exception is that spiral and diag functions are not a...
2年弱 前
解決済み
Generate this matrix
For a given odd integer n, generate a matrix as follows:
Input: n = 5;
Output:
[ 2 1 0 0 0
1 ...
2年弱 前
解決済み
Rotate Matrix @180 degree
Rotate Matrix @180 degree
Example
A=[8 1 6; 3 5 7; 4 9 2], then answer would be
[2 9 4;...