Solved


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

5 years ago

Solved


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

5 years ago

Solved


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

5 years ago

Solved


Big numbers, least significant digits
Given two numbers, x and n, return the last d digits of the number that is calculated by x^n. In all cases, d will be the number...

5 years ago

Solved


Evened up (or not)
You will be provided with an array or matrix that contains various numbers, in addition to an evening variable, e, set to 1 or 0...

5 years ago

Solved


De-primed
Write a function that will multiply every prime number in the array or matrix by two, leaving all other numbers the same, and re...

5 years ago

Solved


MATLAB Basic: rounding III
Do rounding towards minus infinity. Example: -8.8, answer -9 +8.1 answer 8 +8.50 answer 8

5 years ago

Solved


Better Index Number
Let's say you want to save many, many files and append these files with a certain sortable index number. As you probably know, y...

5 years ago

Solved


Whole Number Concatenator
Write a function that concatenates whole numbers. For example: numcat(111,222) should return 111222 numcat(1,2,3,4,5) s...

5 years ago

Solved


The number of trailing zero digit of a factorial
For given positive integer n, take factorial of that number. How many trailing zeros does it have? Example: factorial(11) = 3...

5 years ago

Solved


Lunar Arithmetic (Multiplication)
<https://oeis.org/A087061 OEIS link for a description of lunar arithmetic> Simply take the larger digit when adding and take ...

5 years ago

Solved


Lunar Arithmetic (Addition)
<https://oeis.org/A087061 OEIS link for a description of lunar arithmetic> Simply take the larger digit. Example 1: ...

5 years ago

Solved


The last non-zero digit of a factorial
For given positive integer n, what is the last non-zero digit of n!? Example: factorial(11) = 39916800 Last non-zero d...

5 years ago

Solved


Numbers on 7-segment
This is a 7-segment: _ |_| |_| It's a 3-by-3 char matrix.It has made by 3 characters: '_' , '|' and ' ' (space...

5 years ago

Solved


Still more miles to go before I sleep
It's time for more odometer fun. Last problem, my car's odometer hit 56789. It's coming up on 111111 now, which (barring a maj...

5 years ago

Solved


Pattern Sum
Write a function which receives two single digit positive integers, (k and m) as parameters and calculates the total sum as: k...

5 years ago

Solved


Convert from Base 10 to base 5
Convert the input number from base 10 into base 5: for example: if a(in base 10)= 5 then a(in base 5)= 10

5 years ago

Solved


Rounding off numbers to n decimals
Inspired by a mistake in one of the problems I created, I created this problem where you have to round off a floating point numb...

5 years ago

Solved


MATLAB Basic: rounding II
Do rounding nearest integer. Example: -8.8, answer -9 +8.1 answer 8 +8.50 answer 9

5 years ago

Solved


modular arithmetic
Given three integers a,b and c, find the remainder when a^b is divided by c. Here, a^b will be well beyond the largest 64 bit in...

5 years ago

Solved


Hexagonal numbers on a spiral matrix
Put hexagonal numbers in a ( m x m ) spiral matrix and return the sum of its diagonal elements. Formula of hexagonal numbers ...

5 years ago

Solved


Infinite precision division
Develop a function that will divide a very very large integer numerator, supplied to function as a string (e.g., '12233344445555...

5 years ago

Solved


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

5 years ago

Solved


Sums of cubes and squares of sums
Given the positive integers 1:n, can you: 1. Compute twice the sum of the cubes of those numbers. 2. Subtract the square...

5 years ago

Solved


Project Euler: Problem 16, Sums of Digits of Powers of Two
2^15 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26. What is the sum of the digits of the number 2^N? Thanks ...

5 years ago

Solved


Large Sum (inspired by Project Euler 13)
Your function will be provided an arbitrary number of numbers of arbitrary sizes as a cell array of strings. Some numbers will b...

5 years ago

Solved


Divisible by 13
Write a function to determine if a number is divisible by 13. Similar to the number seven, this can be done by a few different m...

5 years ago

Solved


Check that number is whole number
Check that number is whole number Say x=15, then answer is 1. x=15.2 , then answer is 0. <http://en.wikipedia.org/wiki/Whole...

5 years ago

Solved


MATLAB Basic: rounding
Do rounding near to zero Example: -8.8, answer -8 +8.1 answer 8

5 years ago

Solved


How to multiply?
* Imagine you are in 3012 Anno Domini, when everyone must learn how to multiply, * and competing for the highly prestigious pos...

5 years ago

Load more