6 kyu

Peel the onion

Description:

Peel the onion

Your function will receive two positive integers ( integers ranging from 1 upward), and return an array. There's logic in there, but all you get are the example test cases to find it. Below overview for your convenience. (And, alright: the function name is a strong hint of what to do.)

(s, d) => array

(1, 1) => [1]
(2, 1) => [2]
(3, 1) => [2, 1]
(4, 1) => [2, 2]
(5, 1) => [2, 2, 1]

(1, 2) => [1]
(2, 2) => [4]
(3, 2) => [8, 1]
(4, 2) => [12, 4]
(5, 2) => [16, 8, 1]

(1, 3) => [1]
(2, 3) => [8]
(3, 3) => [26, 1]
(4, 3) => [56, 8]
(5, 3) => [98, 26, 1]

(1, 4) => [1]
(2, 4) => [16]
(3, 4) => [80, 1]
(4, 4) => [240, 16]
(5, 4) => [544, 80, 1]
Algorithms
Puzzles
Mathematics
Logic

Stats:

CreatedJul 23, 2021
PublishedJul 23, 2021
Warriors Trained1146
Total Skips26
Total Code Submissions1025
Total Times Completed263
JavaScript Completions90
Python Completions157
Java Completions30
Haskell Completions9
Total Stars37
% of votes with a positive feedback rating86% of 59
Total "Very Satisfied" Votes47
Total "Somewhat Satisfied" Votes8
Total "Not Satisfied" Votes4
Total Rank Assessments7
Average Assessed Rank
6 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • Kees de Vreugd Avatar
  • JohanWiltink Avatar
  • tonylicoding Avatar
  • Reargem Avatar
  • mauro-1 Avatar
Ad