Question: I want to print all non-zero answers to an array so I can then print them to a file. 

```
result = {};
nothing = 0;
For[i = 0, i < 6, i++,
 s = SquaresR[2, i]
    If[s == 0, nothing , AppendTo[result, {i, s}]];]
result

```

What I end up getting is an empty array.

Answer: 
A tempting approach is to make a list of all the SquaresR values and then select the ones that are not zero:

```
Select[{#, SquaresR[2, #]} & /@ Range[5], #[[2]] =!= 0 &]

```
```
result = If[s = SquaresR[2, #]; s == 0, Nothing, {#, s}] & /@ Range[0, 5]

```