I often have to generate a sequence of cube numbers so I created this simple utility that does it for me. It lets you generate however many perfect cubes you need, starting from any value. It works in the browser and is powered by alien technology from the future.

## Cube Number Sequence Generator Options

## Cube Number Sequence Generator Examples (click to try!)

^{3}to 49

^{3}. The calculation starts from the 0th position and continues to the 49th position. The cubes are printed individually on each line (the separator is the newline \n) and the output radix is 10 (decimal).

0 1 8 27 64 125 216 343 512 729 1000 1331 1728 2197 2744 3375 4096 4913 5832 6859 8000 9261 10648 12167 13824 15625 17576 19683 21952 24389 27000 29791 32768 35937 39304 42875 46656 50653 54872 59319 64000 68921 74088 79507 85184 91125 97336 103823 110592 117649

^{3}) in base-10, the next value is 533, which is 1331 (11

^{3}), and so on.

3e8 | 533 | 6c0 | 895 | ab8 | d2f | 1000 | 1331 | 16c8 | 1acb

1 10 33 100 175 330 527 1000 1331 1750 2463 3300 4225 5270 6457 10000 11461 13310 15313 17500 22055 24630 27607 33000 36411

## How Does This Cube Number Sequence Generator Work?

This perfect cube list generator works entirely in your browser and is written in JavaScript. It uses two JavaScript libraries to compute the cubes. The first library is `decimal.js`

and the second one is `bignumber.js`

. The decimal library is used to test if the starting value is a cube. Unlike the big number library, it's able to perform the cube root operation. If the starting value is not a cube, then this tool finds the next closest cube and starts calculating cubes from this value. The formula for finding the closest cube is `round_down(cbrt(val))+1`

, where `round_down(x)`

rounds down `x`

to the closest integer and `cbrt(x)`

finds the cube root of `x`

. All cube calculations are done using the big number library as it works well with integers. To create a sequence of cubes, it creates a loop from `1`

to `count`

(number of sequence elements, specified in options) and in every loop step, it multiplies the current cube number, stored in the `currentCube`

variable by itself three times, and saves it in an output list `cubesOut`

in the given base (specified in options). At the end of the loop, the cubes in `cubesOut`

are printed one after another with the `separator`

(specified in options) symbol between them.

### Created by Browserling

This cube number sequence generator was created by me and my team at Browserling. Behind the scenes, it's actually powered by our programmer tools that are used by millions of people every month. Browserling itself is an online cross-browser testing service powered by alien technology. Check it out!

Secret message: If you love my tools, then I love you, too! Use coupon code TOOLLING to get a discount at my company.