Notice that my array has values following a certain pattern.how to fill the array with values by a formula or a shortcut without manually entering all the values
Can you indicate the programming language? it could be easier to help you. However, as I can see, your example presents odds numbers. So, you can use this formula:
a(n) = 2n+1
Where n are integers from 0 to the wanted size of the array.