Retired
Hyperoperation (retired)
Description:
The most basic operation in mathematics is counting.
1, 2, 3... b + 1 // b # of increments
The next operation is addition.
a + b = a + 1 + ... + 1 // b # of ones
The next extension to this sequence is multiplication
a * b = a + a + ... + a // b # of times
We can extend multiplication to exponentiation
a ^ b = a * a * ... * a // b # of times
This sequence of operations is known as hyperoperation and forms an infinite sequence of potential operations.
Create a function, hyperoperate(a, b , n), that returns the nth operation of a and b.
n = 0 is counting.
n = 1 is addition.
n = 2 is multiplication.
n = 3 is exponentiation.
The function should be able to handle all the cases where b = 0.
Algorithms
Mathematics
Logic
Numbers
Loops
Control Flow
Basic Language Features
Fundamentals
Memoization
Design Patterns
Design Principles
Stats:
Created | Aug 3, 2016 |
Warriors Trained | 30 |
Total Skips | 1 |
Total Code Submissions | 59 |
Total Times Completed | 20 |
JavaScript Completions | 20 |
Total Stars | 0 |
% of votes with a positive feedback rating | 46% of 12 |
Total "Very Satisfied" Votes | 4 |
Total "Somewhat Satisfied" Votes | 3 |
Total "Not Satisfied" Votes | 5 |
Total Rank Assessments | 13 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 8 kyu |