Sha256: 1267c55a16f14e9173108467b61cf93d356067b4163636a8cecec4d71cca8a18
Contents?: true
Size: 304 Bytes
Versions: 5
Compression:
Stored size: 304 Bytes
Contents
# coding: utf-8 class Integer def super_catalan n = self return 1 if n <= 2 Rational( 3 * ((2 * n) - 3) * (n - 1).super_catalan - (n - 3) * (n - 2).super_catalan, n ).to_i end memoize :super_catalan def super_catalan? in_sequence?(seq: :super_catalan) end end
Version data entries
5 entries across 5 versions & 1 rubygems