Beta

Guess the list pattern #3

8 of 9Beast

Description:

Make a function called "pattern" that takes two integers as input and returns the correct pattern as a list.

Four examples are shown below:

pattern(30, 7) = [1, 1033017668127734890497, 633318697598977, 123145302310913, 1]

pattern(-15, -4) = [549755813887, 131073, 33554431, 1]

pattern(23, 3) = [137438953473, 1044835113549955073, 32985348833281, 1, 3298534883329, 10737418241, 1610612737, 1]

pattern(-27, -5) = [19791209299967, 1048577, 274877906943, 6815745, 687194767359, 1]
Fundamentals
Lists
Data Structures
Mathematics
Arrays
Puzzles

Similar Kata:

More By Author:

Check out these other kata created by Beast

Stats:

CreatedSep 15, 2017
PublishedSep 15, 2017
Warriors Trained93
Total Skips1
Total Code Submissions57
Total Times Completed9
Python Completions8
Ruby Completions2
Total Stars1
% of votes with a positive feedback rating0% of 2
Total "Very Satisfied" Votes0
Total "Somewhat Satisfied" Votes0
Total "Not Satisfied" Votes2
Total Rank Assessments3
Average Assessed Rank
4 kyu
Highest Assessed Rank
2 kyu
Lowest Assessed Rank
5 kyu
Ad
Contributors
  • Beast Avatar
Ad