> 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/e/elementary_cellular_automaton/random_number_generator.md).

# Random number generator

```ruby
var auto = Automaton(30, [1] + 100.of(0));
 
10.times {
    var sum = 0;
    8.times {
        sum = (2*sum + auto.cells[0]);
        auto.next;
    };
    say sum;
};
```

#### Output:

```
220
197
147
174
117
97
149
171
240
241
```
