Need help writing more efficient code (total newbie)

"const int" is the preferred way, for various subtle reasons.

@OP: It is preferable to post code that compiles:

sketch_oct07c.cpp: In function 'void loop()':
sketch_oct07c:22: error: 'i' was not declared in this scope