Vector of perfect squares upto n ^ 2
var perfectSquares = getPerfectSquares ( Math . pow ( n , 2 ) ) ; var count = 0 ; for ( var a = 1 ; a <= n ; a ++ ) { var aSquare = Math . pow ( a , 2 ) ; for ( var i = 0 ; i < perfectSquares . length ; i ++ ) { var cSquare = perfectSquares [ i ] ;