Community Profile

photo

RA


McMaster University

236 total contributions since 2014

Contact

RA's Badges

  • Quiz Master
  • Speed Demon
  • Commenter
  • Promoter
  • CUP Challenge Master
  • Creator
  • Solver

View details...

Contributions in
View by

Solved


Project Euler: Problem 2, Sum of even Fibonacci
Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 te...

etwa ein Jahr ago

Solved


Return the Fibonacci Sequence
Write a code which returns the Fibonacci Sequence such that the largest value in the sequence is less than the input integer N. ...

etwa ein Jahr ago

Solved


Integer Sequence - II : New Fibonacci
Crack the following Integer Sequence. (Hints : It has been obtained from original Fibonacci Sequence and all the terms are also ...

etwa ein Jahr ago

Solved


Compute Fibonacci Number
Compute the _n_-th Fibonacci Number f(0) = 0, f(1) = 1, f(2) = 1, f(3) = 2, ... f(42) = 267914296

etwa ein Jahr ago

Solved


Determine if a Given Number is a Triangle Number
*Description:* Determine if the elements of an input array are triangle numbers and return the result as an array with the sa...

etwa ein Jahr ago

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

etwa ein Jahr ago

Solved


Create a Multiplication table matrix...
Create a product table in this format: P = [ 1 2 3 4 5; 2 4 6 8 10; 3 6 9 12 15; 4 8 12 1...

etwa ein Jahr 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...

etwa ein Jahr ago

Solved


Divide by 4
Given the variable x as your input, divide it by four and put the result in y.

etwa ein Jahr ago

Solved


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

mehr als 5 Jahre ago

Solved


Count ones
Write a program to count number of ones (1s) in an integer variable input. For example: Input x=2200112231 output y=3 I...

mehr als 5 Jahre ago

Solved


Fahrenheit to Celsius converter
Convert Fahrenheit to Celsius degrees.

mehr als 5 Jahre ago

Solved


Determine the number of odd integers in a vector
Determine the number of unique odd integers in a vector. Examples: Input x = [2 5 8 3 7 1]; Output y = 4; Inp...

mehr als 5 Jahre ago

Solved


interesting center of magic matrix
output the centre of magic matrix of n input=7; output=25

mehr als 5 Jahre ago

Solved


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

mehr als 5 Jahre ago

Solved


Number of odd and even elements within matrix
Input(m) - any matrix with integers Output(n) - n(1)=number of odd elements, n(2)=number of even elements Example: * m=...

mehr als 5 Jahre ago

Solved


Tiling a matrix
Given a matrix and a number of columns, replicate matrix in a single row

mehr als 5 Jahre ago

Solved


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

mehr als 5 Jahre ago

Solved


Find the square of the sum of the digits of a number
If a number (n) is provided as an input, find the square of the sum of the digits of the number. Example If n = 21, the an...

mehr als 5 Jahre ago

Solved


Put Two 1D matrices into one 1D matrix
Example: If input a = [1 2 3 4 5]; input b = [10 9 8 7 6]; then output will be, y_correct = [1 10 2 9 3 8 4 7 5...

mehr als 5 Jahre ago

Solved


Concatenate two strings
Its very easy. Just concatenate two strings.

mehr als 5 Jahre ago

Solved


Symmetric matrix
You must create a n-by-n *symmetric* matrix such that A(row,col) = row/col for col >= row. Example if n =3 : output is : ...

mehr als 5 Jahre ago

Solved


Upper triangular matrix
Create a function to retrieve the upper triangular matrix of a matrix (without using tril). The matrix will always be square. ...

mehr als 5 Jahre ago

Solved


Find the dimensions of a matrix
Just find the number of columns of the given matrix. Example x = [1 2 3 4 5 6] y = 2

mehr als 5 Jahre ago

Solved


Switch matrix to a column vector
for e.g. x = [1 2 3 4] y = 1 3 2 4

mehr als 5 Jahre ago

Solved


Generate pi using logarithm
Generate pi using logarithm

mehr als 5 Jahre ago

Solved


Project Euler: Problem 6, Natural numbers, squares and sums.
The sum of the squares of the first ten natural numbers is, 1^2 + 2^2 + ... + 10^2 = 385 The square of the sum of the first ...

mehr als 5 Jahre 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...

mehr als 5 Jahre ago

Solved


Find nth maximum
Find nth maximum in a vector of integer numbers. Return NaN if no such number exists. x = [2 6 4 9 -10 3 1 5 -10]; So ...

mehr als 5 Jahre ago

Solved


N-Cards Problem
You have a deck of _N_ cards numbered in order from 1 to _N_. You discard the top card (card 1) and place the next card (card 2)...

mehr als 5 Jahre ago

Load more