'From Squeak3.6 of ''6 October 2003'' [latest update: #5424]'! Object subclass: #RPrime instanceVariableNames: 'tbl ' classVariableNames: '' poolDictionaries: '' category: 'Category-Yuki Quiz'! !RPrime methodsFor: 'initialization'! initialize: n tbl := Array new: n + 1. 1 to: tbl size do: [ :i | tbl at: i put: ( i caseOf: { [1] -> [Array new: n + 1 withAll: false]. [2] -> [Array new: n + 1 withAll: true]} otherwise: [Array new: n + 1])]. (tbl at: 1) at: 2 put: true! ! !RPrime methodsFor: 'testing'! check: n with: m ^ ((tbl at: n + 1) at: (m + 1)) ifNil: [ (tbl at: n + 1) at: (m + 1) put: (self check: m \\ n with: n)]! ! !RPrime class methodsFor: 'instance creation'! new: n ^ self new initialize: n; yourself! !