# Power of 2 loop

**URL:** <https://forum.ansible.com/t/power-of-2-loop/16011>\
**Category:** Ansible Project\
**Created:** [August 22, 2014, 12:49pm UTC](https://forum.ansible.com/t/power-of-2-loop/16011 "2014-08-22T12:49:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Imran\_Khan1](https://avatars.discourse-cdn.com/v4/letter/i/a4c791/32.png) [@Imran\_Khan1](https://forum.ansible.com/u/Imran_Khan1)\
**Post date:** [August 22, 2014, 12:49pm UTC](https://forum.ansible.com/t/power-of-2-loop/16011/1 "2014-08-22T12:49:14Z")

</div>

```auto
    - name: Do some mathematics divide multiply
      #insert logic here
      register: my_content # save logic in register
      with_sequence: count={{loopvar}} #I need a loop sequence here

```

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [August 22, 2014, 1:17pm UTC](https://forum.ansible.com/t/power-of-2-loop/16011/2 "2014-08-22T13:17:54Z")

</div>

You should be able to achieve this using the following syntax:

“{{ (loopvar|int)\*\*2 }}”
