Find Rotated Substring
Given a string s1, find if a rotated version of s1 is present in a second string s2.
For example, rotated version of some strin...
Decimal Comparison
*Background*
A utility of particular interest to Cody and other MATLAB ventures is comparing the equality of two numbers. In ...
27日 前
解決済み
Transposition as a CIPHER
This all about transcripting a text message. If the input string is: s1 = 'My name is Sourav Mondal', then the output is: s2 = '...
27日 前
解決済み
Find matching parenthesis
One of the most indispensable things about a great text editor for programming is the ability to quickly jump between matching p...
27日 前
解決済み
Find matching string from a list of strings
Write a function that returns a string that is a unique match (if it exists) of the string inStr from a list of strings strList....
27日 前
解決済み
Ordinal numbers
Given an integer n, return the corresponding ordinal number as a character string. For example,
ord(1)='1st'
ord(2)=...
Guess Cipher
Guess the formula to transform strings as follows:
'Hello World!' --> 'Ifmmp Xpsme!'
'Can I help you?' --> 'Dbo J ifm...
27日 前
解決済み
Find the next prime number
Find the next prime number or numbers for given n. For example:
n = 1;
out = 2;
or
n = [5 7];
out = [7 11];
...
29日 前
解決済み
Make a vector of prime numbers
Input(n) - length of vector with prime numbers
Output(v) - vector of prime numbers
Example:
* n=1; v=2
* n=3; v=[2 3 5...
29日 前
解決済み
Largest Twin Primes
<http://en.wikipedia.org/wiki/Twin_prime Twin primes> are primes p1, p2 = p1 + 2 such that both p1 and p2 are prime numbers. Giv...
29日 前
解決済み
Mersenne Primes
A Mersenne prime is a prime number of the form M = 2^p - 1, where p is another prime number. For example, 31 is a Mersenne prim...
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...
Mersenne Primes vs. All Primes
A Mersenne prime (M) is a prime number of the form M = 2^p - 1, where p is another prime number. <https://www.mathworks.com/matl...
29日 前
解決済み
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...
29日 前
解決済み
Project Euler: Problem 7, Nth prime
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.
What is the Nth prime numb...