SHARE
TWEET

Untitled

a guest Mar 20th, 2017 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. squareNumberQ[{n_Integer,m_Integer}]:= IntegerQ[Sqrt[n^2+m^2]] ;
  2. allPossiblePairs = Flatten[Table[{n,m},{n,1,10},{m,1,10}],1] ;
  3. squareNumbers = Select[allPossiblePairs, squareNumberQ]
  4. (* {{3,4},{4,3},{6,8},{8,6}} *)
  5.    
  6. Flatten[Table[{n,m},{n,1,10},{m,n,10}],1]
  7.    
  8. DeleteCases[squareNumbers,#1[[_,1]]==#2[[_,2]]&]
RAW Paste Data
Top