How to create cycle function in elixir

Thank you, I have 2 questions:

  1. how do I use this in my code, I need it to be printed a number in my code each loop, like this:
  • the_number_which_I_need = 1
  • the_number_which_I_need = 2
  • the_number_which_I_need = 3
  • the_number_which_I_need = 4
  • the_number_which_I_need = 1
<%= for el <- posts_entries do %>
    <%= el["title"] %>
   <%= the_number_which_I_need %>
<% end %>
  1. is there a way to create this in a function?