You need to sign in or sign up before continuing.×
Retired

Recursive Multiplication Table (retired)

Description:

Let's create a multiplication table using recursion! Our function will get two arguments:

  1. The first number of the multiplication table
  2. How many rows we want

Each row will be 8 numbers long and have the input number first, with each number after it multiplied by two. For example, if our first argument is 10:

[[10, 20, 40, 80, 160, 320, 640, 1280]]

Then, the next row will start with the first number of the last row + 1. For example, the first arg (starting num) is 10 and second (num of rows) is 3:

[[10, 20, 40, 80, 160, 320, 640, 1280],

[11, 22, 44, 88, 176, 352, 704, 1408],

[12, 24, 48, 96, 192, 384, 768, 1536]]

The function should return a 2D array with each row represented as an array, as depicted above. Remember to try this with recursion!!

Fundamentals
Recursion
Algorithms
Computability Theory
Logic
Theoretical Computer Science
Arithmetic
Mathematics
Numbers
Tables
Data Structures

Stats:

CreatedNov 28, 2017
Warriors Trained23
Total Skips0
Total Code Submissions44
Total Times Completed7
JavaScript Completions7
Total Stars0
% of votes with a positive feedback rating38% of 4
Total "Very Satisfied" Votes0
Total "Somewhat Satisfied" Votes3
Total "Not Satisfied" Votes1
Total Rank Assessments4
Average Assessed Rank
7 kyu
Highest Assessed Rank
7 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • leegt Avatar
  • JohanWiltink Avatar
Ad