You are viewing a single comment's thread. Return to all comments →
Perl:
sub utopianTree { my $n = shift; return ($n % 2 == 0) ? (2 ** (($n / 2) + 1)) - 1 : (2 ** ((($n + 1) / 2) + 1)) - 2; }
Seems like cookies are disabled on this browser, please enable them to open this website
Utopian Tree
You are viewing a single comment's thread. Return to all comments →
Perl: