← Back to challenges

3D Visual Block Sequence

PythonHardmathnumbersalgorithms

Instructions

A block sequence in three dimensions. We can write a formula for this one:

Sequence Step 1 - 5

Create a function that takes a number (step) as an argument and returns the amount of blocks in that step.

Examples

blocks(1) ➞ 5

blocks(5) ➞ 39

blocks(2) ➞ 12

Notes

  • Step 0 obviously has to return 0.
  • The input is always a positive integer.
python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.