Number of Symmetric Relations on a Set | function find the square of n ; Base case ; Return 2 ^ ( n ( n + 1 ) / 2 ) ; Driver code
< ? php function countSymmetric ( $ n ) { if ( $ n == 0 ) return 1 ; return 1 << ( ( $ n * ( $ n + 1 ) ) / 2 ) ; } $ n = 3 ; echo ( countSymmetric ( $ n ) ) ; ? >