Community Profile

photo

Benjamin Richards


103 total contributions since 2019

Benjamin Richards's Badges

  • Speed Demon
  • Promoter
  • Commenter
  • Project Euler I
  • Community Group Solver
  • Introduction to MATLAB Master
  • Solver

View details...

Contributions in
View by

Solved


Return the 3n+1 sequence for n
A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...

4 days ago

Solved


Remove the vowels
Remove all the vowels in the given phrase. Example: Input s1 = 'Jack and Jill went up the hill' Output s2 is 'Jck nd Jll wn...

4 days ago

Solved


Remove any row in which a NaN appears
Given the matrix A, return B in which all the rows that have one or more <http://www.mathworks.com/help/techdoc/ref/nan.html NaN...

5 days ago

Solved


Find common elements in matrix rows
Given a matrix, find all elements that exist in every row. For example, given A = 1 2 3 5 9 2 5 9 3 2 5 9 ...

11 days ago

Solved


Remove the small words from a list of words.
Your job is to tidy up a list of words that appear in a string. The words are separated by one or more spaces. Remove all words ...

11 days ago

Solved


Target sorting
Sort the given list of numbers |a| according to how far away each element is from the target value |t|. The result should return...

12 days ago

Solved


Find state names that start with the letter N
Given a list of US states, remove all the states that start with the letter N. If s1 = 'Alabama Montana Nebraska Vermont Ne...

12 days ago

Solved


Replace NaNs with the number that appears to its left in the row.
Replace NaNs with the number that appears to its left in the row. If there are more than one consecutive NaNs, they should all ...

12 days ago

Solved


Prime factor digits
Consider the following number system. Calculate the prime factorization for each number n, then represent the prime factors in a...

12 days ago

Solved


Find the two most distant points
Given a collection of points, return the indices of the rows that contain the two points most distant from one another. The inpu...

13 days ago

Solved


Bullseye Matrix
Given n (always odd), return output a that has concentric rings of the numbers 1 through (n+1)/2 around the center point. Exampl...

13 days ago

Solved


Find all elements less than 0 or greater than 10 and replace them with NaN
Given an input vector x, find all elements of x less than 0 or greater than 10 and replace them with NaN. Example: Input ...

13 days ago

Solved


Return the largest number that is adjacent to a zero
This example comes from Steve Eddins' blog: <http://blogs.mathworks.com/steve/2009/05/27/learning-lessons-from-a-one-liner/ Lear...

13 days ago

Solved


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

13 days ago

Solved


Make a Palindrome Number
Some numbers like 323 are palindromes. Other numbers like 124 are not. But look what happens when we add that number to a revers...

14 days ago

Solved


Make a checkerboard matrix
Given an integer n, make an n-by-n matrix made up of alternating ones and zeros as shown below. The a(1,1) should be 1. Examp...

14 days ago

Solved


Double Factorial
Return double factorial n(n-2)...(5)(3)(1), n>0, odd n!! = n(n-2)...(6)(4)(2), n>0, even 1 ...

16 days ago

Solved


Triangle sequence
A sequence of triangles is constructed in the following way: 1) the first triangle is Pythagoras' 3-4-5 triangle 2) the s...

16 days ago

Solved


Fibonacci Decomposition
Every positive integer has a unique decomposition into nonconsecutive Fibonacci numbers f1+f2+ ... Given a positive integer n, r...

17 days ago

Solved


Fibonacci-Sum of Squares
Given the Fibonacci sequence defined by the following recursive relation, * F(n) = F(n-1) + F(n-2) * where F(1) = 1 and F(1)...

17 days ago

Solved


How many Fibonacci numbers?
Find the number of unique Fibonacci numbers (don't count repeats) in a vector of positive integers. Example: x = [1 2 3 4...

17 days ago

Solved


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

17 days ago

Solved


Find state names that end with the letter A
Given a list of US states, remove all the states that end with the letter A. Example: Input s1 = 'Alabama Montana Nebras...

17 days ago

Solved


Find the numeric mean of the prime numbers in a matrix.
There will always be at least one prime in the matrix. Example: Input in = [ 8 3 5 9 ] Output out is 4...

18 days ago

Solved


Remove all the consonants
Remove all the consonants in the given phrase. Example: Input s1 = 'Jack and Jill went up the hill'; Output s2 is 'a ...

18 days ago

Solved


Who Has the Most Change?
You have a matrix for which each row is a person and the columns represent the number of quarters, nickels, dimes, and pennies t...

18 days ago

Solved


Times 2 - START HERE
Try out this test problem first. Given the variable x as your input, multiply it by two and put the result in y. Examples:...

18 days ago

Solved


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

18 days ago

Solved


Summing digits
Given n, find the sum of the digits that make up 2^n. Example: Input n = 7 Output b = 11 since 2^7 = 128, and 1 + ...

19 days ago

Solved


Find the maximum number of decimal places in a set of numbers
Given a vector or matrix of values, calculate the maximum number of decimal places within the input. Trailing zeros do not coun...

19 days ago

Load more