Erlang Shape Area
-module(shape_area).
-export([shape_area/1]).

shape_area(N) when N =< 1 ->
    1;
shape_area(N) ->
    shape_area(N - 1) + 4 * (N - 1).

This returns the area of the growing n-interesting polygon using the direct formula instead of building the shape.