Sequence of Squares

Problem #126

Tags: brainfuck mathematics

Who solved this?

This problem is simple - you are given value X and you need to write a Brainfuck program printing squares of all integers from 1 to X.

At this time you can use "stack" with brainfuck. It is accessed with two additional commands:

It is handy in storing values temporarily. For example the task of copying value to neighbor cell could be solved with just three commands #>$. However this feature is enabled only for specific tasks (like this).

Input data contain the single value X (not necessarily the same as given you for example when testing your code!).
Answer should contain squares of integers from 1 to X.

Example:

input data:
5

answer
1 4 9 16 25
You need to login to get test data and submit solution.