n = 2,S = 3 = 3 x 1
n = 3,S = 6 = 3 x 2
n = 4,S = 9 = 3 x 3
n = n,S = 3 x (n-1)
n = 5,S = 3 x (5-1) = 12
n = 7,S = 3 x (7-1) = 18
n = 11,S = 3 x (11-1) = 30
n = 2,S = 3 = 3 x 1
n = 3,S = 6 = 3 x 2
n = 4,S = 9 = 3 x 3
n = n,S = 3 x (n-1)
n = 5,S = 3 x (5-1) = 12
n = 7,S = 3 x (7-1) = 18
n = 11,S = 3 x (11-1) = 30