Given
#S_n=n^2+20n+12,#
#"where "n = +ve " integer"#
Given expression can be arranged in different ways associated with a perfect square of integers.Here only 12 arrangements have been shown.
#S_n=(n+1)^2+18n+11.........[1]#
#S_n=(n+2)^2+16n+8..........[2]#
#S_n=(n+3)^2+14n+3..........[3]#
#S_n=(n+4)^2+12n-4..........[4]#
#S_n=(n+5)^2+10n-13.........[5]#
#S_n=(n+6)^2+color(red)(8(n-3).........[6])#
#S_n=(n+7)^2+6n-37..........[7]#
#S_n=(n+8)^2+color(red)(4(n-13).........[8])#
#S_n=(n+9)^2+2n-69..........[9]#
#S_n=(n+10)^2-88..............[10]#
#S_n=(n+11)^2-2n-109.........[11]#
#S_n=(n+12)^2-4(n+33).........[12]#
On inspection of above 10 relations we see that #S_n# will be perfect square in two cases i.e 6th and 8th,when n=3 and n=13 respectively.
So the sum of all the possible values of n for which #S_n# is a perfect square is =(3+13)=16.
#S_n# may be a perfect square other than these two for negatve value of n. Case 12 where #n=-33# is one such example.