> For the complete documentation index, see [llms.txt](https://trizen.gitbook.io/sidef-lang/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trizen.gitbook.io/sidef-lang/programming_tasks/o/odd_and_square_numbers.md).

# Odd and square numbers

```ruby
var lo = 100
var hi = 1_000
 
say gather {
    for k in (lo.isqrt .. hi.isqrt) {
        take(k**2) if k.is_odd
    }
}
```

#### Output:

```
[121, 169, 225, 289, 361, 441, 529, 625, 729, 841, 961]
```
