# The 6174 phenomenon # Emily Kukura, Spring 2017 with(MmaTranslator[Mma]): with(ListTools): with(FileTools): with(combinat): print(`Type Help(); to begin.`): ################################################################################ # Help procedures # ################################################################################ Help:=proc(): if nargs=0 then print(`6174phenom.txt contains the following primary procedures.`): print(`Type Help(); for help with a procedure.`): print(`Type Help1(); for a list of secondary procedures.`): print(): print(`*************************************************************`): print(`Analysis procedures:`): print(`*************************************************************`): print(`listPhenom, randomEG, allOrbits, randomAnalysis, `): print(`maxOrbitLength, getIterationPGF, moms, rangeAllOrbits,`): print(`correspondence, getSampleIterationPGF`): print(): print(`*************************************************************`): print(`Paper-creating procedures: `): print(`*************************************************************`): print(`getPCconjecturesPaper, getNPCconjecturesPaper,`): print(`getPCconjecturesPaperLength3, getNPCconjecturesPaperLength3`): print(`getPCconjecturesPaperLength4, getNPCconjecturesPaperLength4,`): print(`getNPCconjecturesPaperLength6`): print(`getPCconjecturesPaperLength7, getNPCconjecturesPaperLength7,`): print(`createStatsPaper, singleStatsPaper, getSingleStats, addStats.`): print(): print(`*************************************************************`): print(`Verification procedures: `): print(`*************************************************************`): print(`verifyOddBaseLength3Theorems, verifyEvenBaseLength3Theorems,`): print(`verifyOddBaseLength4Conjectures, verifyElementsConjecture,`): print(`verifyParityConjecture, verifyOrbitLengthsDivConjecture,`): print(`verify2PowerLength4Conjectures,`): print(`verify3x2PowerLength4Conjectures, verify5x2PowerLength4Theorems,`): print(`verify7x2PowerLength4Conjectures,verify3PowerLength4Conjectures,`): print(`verifyEvenBaseLength6Proposition, verifyEvenBaseLength7Conjectures.`): print(): print(`*************************************************************`): print(`"Checking" procedures`): print(`*************************************************************`): print(`checkOddBaseLength3Theorems, checkEvenBaseLength3Theorems,`): print(`checkOrbitLengthsDivConjecture, checkParityConjecture, checkElementsConjecture,`): print(`checkOddBaseLength4Conjectures, check2PowerLength4Conjectures,`): print(`check3x2PowerLength4Conjectures, check5x2PowerLength4Theorems,`): print(`check7x2PowerLength4Conjectures,check3PowerLength4Conjectures, checkEvenBaseLength7Conjectures`): print(): print(`*************************************************************`): print(`Conjecture Statement procedures: `): print(`*************************************************************`): print(`getAllConjectures, `): print(`theOddBaseLength3Theorems, theEvenBaseLength3Theorems,`): print(`theOddBaseLength4Conjectures, the3x2PowerLength4Conjectures,`): print(`the5x2PowerLength4Theorems, the7x2PowerLength4Conjectures,`): print(`the2PowerLength4Conjectures, the3PowerLength4Conjectures,`): print(`theEvenBaseLength6Proposition, theEvenBaseLength7Conjectures.`): print(`*************************************************************`): # CREATE # MODIFY # print(`getPCconjecturesPaper, getNPCconjecturesPaper,`): else LookupProc(args[1]): fi: end: Help1:=proc() if nargs = 0 then print(`6174phenom.txt contains the following secondary procedures.`): print(`Type Help(); for help with a procedure.`): print(`Type Help(); to list primary procedures.`): print(): print(`Secondary Procedures: iterate, getAllElements, length3Orbits`): print(`length4Orbits, length7Orbits, getMaxBasePC, stringPhenom, phenom, getData,`): print(`getOrbitLengths, lengthsWithConjectures, conjecturedOddBaseLength4Elements`): print(`randomNum, baseSubtract, toBase10, isFixedPoint, freqList, getOrbitsGF`): else LookupProc(args[1]): fi: end: ################################################################################ # Primary Procedures # ################################################################################ listPhenom := proc(numberList, myBase) #cant begin with number leading with 0 local res, resList, allNums, symbolNumList, curNumList, seenNumBefore, numIterations, finalNum, indexOfFinalNum, orbitSize, isTrivial, validInputs, orbit, numIterToOrbit, digitLength: if not whattype(numberList) = list then return(FAIL, `input number should be a list of integers`) fi: seenNumBefore := false: curNumList := numberList: digitLength := length(myBase - 1): allNums := [curNumList]: isTrivial := checkTriv(curNumList): validInputs := inputsValid(curNumList, myBase): if isTrivial then return(FAIL, "input number must contain at least 2 distinct digits"): elif not validInputs then return(FAIL, "inputs invalid"): fi: while not seenNumBefore do resList:=iterate(curNumList, myBase): if resList in allNums then seenNumBefore := true: allNums := [op(allNums), resList]: finalNum := resList: else allNums := [op(allNums), resList]: curNumList := resList: fi: od: numIterations := nops(allNums): indexOfFinalNum := Search(finalNum, allNums): #search gets the first occurence orbitSize := numIterations - indexOfFinalNum: numIterToOrbit := numIterations - orbitSize: orbit := subList(allNums, indexOfFinalNum, indexOfFinalNum + orbitSize - 1): orbit := getCanonOrbit(orbit): return([numIterToOrbit, orbitSize, orbit, allNums]): end: #******************************************************************************* stringPhenom := proc(stringNum, myBase) #number must be input as a string to handle leading zeros case #exclude trivial case when is just a string of one repeated number local res, resList, allNums, numList, resString, temp, seenNumBefore, numIterations, finalNum, indexOfFinalNum, orbitSize, i, isTrivial, validInputs, orbit, numIterToOrbit, correctedNum, digitLength: if not whattype(stringNum) = string then return(FAIL, `input number should be a string`) fi: seenNumBefore := false: allNums := [stringNum]: numList := getNumList(stringNum, myBase): if [numList][1] = FAIL then return(FAIL, numList[2]): fi: digitLength := length(myBase - 1): for i from 1 to nops(numList) do numList[i] := parse(numList[i]): od: isTrivial := checkTriv(numList): validInputs := inputsValid(numList, myBase): if isTrivial then return(FAIL, "input number must contain at least 2 distinct digits"): elif not validInputs then return(FAIL, "inputs invalid"): fi: while not seenNumBefore do resList := iterate(numList, myBase): temp := resList: for i from 1 to nops(resList) do temp[i] := convert(resList[i], string): if length(resList[i]) < digitLength then temp[i] := getCorrectLengthNum(resList[i], digitLength): fi: od: resString := cat(op(temp)): if resString in allNums then seenNumBefore := true: allNums := [op(allNums), resString]: finalNum := resString: else allNums := [op(allNums), resString]: numList := resList: fi: od: numIterations := nops(allNums): indexOfFinalNum := Search(finalNum, allNums): #search gets the first occurence orbitSize := numIterations - indexOfFinalNum: numIterToOrbit := numIterations - orbitSize: orbit := subList(allNums, indexOfFinalNum, indexOfFinalNum + orbitSize - 1): orbit := getCanonOrbit(orbit): return([numIterToOrbit, orbitSize, orbit, allNums]): end: #******************************************************************************* phenom := proc(number, myBase) #cant begin with number leading with 0 local res, resList, allNums, symbolNumList, curNumList, seenNumBefore, numIterations, finalNum, indexOfFinalNum, orbitSize, isTrivial, validInputs, orbit, numIterToOrbit, digitLength: seenNumBefore := false: symbolNumList := getNumList(Reverse(convert(number, base, 10)), myBase): if [symbolNumList][1] = FAIL then return(FAIL, symbolNumList[2]): fi: curNumList := [seq(parse(symbolNumList[i]), i=1..nops(symbolNumList))]: digitLength := length(myBase - 1): allNums := [curNumList]: isTrivial := checkTriv(curNumList): validInputs := inputsValid(curNumList, myBase): if isTrivial then return(FAIL, "input number must contain at least 2 distinct digits"): elif not validInputs then return(FAIL, "inputs invalid"): fi: while not seenNumBefore do resList:=iterate(curNumList, myBase): if resList in allNums then seenNumBefore := true: allNums := [op(allNums), resList]: finalNum := resList: else allNums := [op(allNums), resList]: curNumList := resList: fi: od: numIterations := nops(allNums): indexOfFinalNum := Search(finalNum, allNums): #search gets the first occurence orbitSize := numIterations - indexOfFinalNum: numIterToOrbit := numIterations - orbitSize: orbit := subList(allNums, indexOfFinalNum, indexOfFinalNum + orbitSize - 1): orbit := getCanonOrbit(orbit): return([numIterToOrbit, orbitSize, orbit, allNums]): end: #******************************************************************************* randomEG := proc(theLength, myBase) local numList, res, isTrivial: if myBase <= 1 or theLength <= 1 then return(FAIL, "base and length must both be integers greater than 2"): fi: numList := randomNum(theLength, myBase): isTrivial := checkTriv(numList): if not isTrivial then res := listPhenom(numList, myBase): else res := randomEG(theLength, myBase): #run again fi: return(res): end: #******************************************************************************* allOrbits := proc(theLength, theBase, form) local orbits, curOrbit, curNum, curNumList, maxNumList, maxNum, listOrbits, isTrivial, seenNums, i, temp, stringOrbits, stringOrbit, digitLength, orbitSets, distinctOrbits, seenDigits: if not form in {"string", "list"} then return(FAIL, `last argument should specify form, either: "string" or "list"`): fi: orbits := {}: maxNumList := [seq(theBase-1, i=1..theLength)]: maxNum := toBase10(maxNumList, theBase): seenNums := {}: for curNum from 0 to maxNum do curNumList := convert(curNum, base, theBase): #may not be full length, also in reverse order if not nops(curNumList) = theLength then curNumList := extendList(curNumList, theLength): #adds any necessary beginning 0's fi: curNumList:=sort(curNumList): #wlog order doesnt matter isTrivial := checkTriv(curNumList): if not isTrivial then if not curNumList in seenNums then curOrbit := listPhenom(curNumList, theBase)[3]: orbits := {op(orbits), curOrbit}: seenNums := {op(seenNums), curNumList}: fi: fi: od: if form = "string" then digitLength := length(theBase-1): listOrbits := [op(orbits)]: stringOrbits := [op(orbits)]: for i from 1 to nops(orbits) do stringOrbits[i]:= getStringOrbit(listOrbits[i], digitLength): od: orbits := {op(stringOrbits)}: fi: return(orbits): end: #******************************************************************************* maxOrbitLength:=proc(theLength, theBase) local theOrbits, curSize, maxSize, i: theOrbits := [op(allOrbits(theLength, theBase, "list"))]: maxSize := nops(theOrbits[1]): for i from 2 to nops(theOrbits) do curSize := nops(theOrbits[i]): if curSize > maxSize then maxSize := curSize: fi: od: return(maxSize): end: #******************************************************************************* #shift list by m-1, so that aList[m] is the new lists first element shiftList := proc(aList, m) local newArray, listLength, i: listLength := numelems(aList): newArray := Array([seq(0, i=1..listLength)]): for i from 1 to m-1 do newArray[i+1-m+listLength]:= aList[i]: od: for i from m to listLength do newArray[i+1-m] := aList[i]: od: return(convert(newArray,list)): end: #******************************************************************************* #shift list by m-1, so that aList[m] is the new lists first element shiftListOld := proc(aList, m) local newList, listLength, i: listLength := numelems(aList): newList := [seq(0, i=1..listLength)]: for i from 1 to m-1 do newList[i+1-m+listLength]:= aList[i]: od: for i from m to listLength do newList[i+1-m] := aList[i]: od: return(newList): end: #******************************************************************************* # this one will make PGF over ALL numbers using the fact that except for fixed points # (and the first number in fullList) e.g. listPhenom([1,2,3,4],10) = listPhenom([3,1,2,4],10): # ? allow for "trivial" list e.g. [1,1,1,1] ? getIterationPGF:=proc(theLength, theBase, x) local pgf, curNumIter, maxNumList, maxNum, seenNums, curNum, curNumList, isTrivial, counter, isFixedPoint, numPerms, cur, curOrbits, curOrbit, orbits, orbitList, orb, i, j, elt: if not whattype(theLength) = integer or not whattype(theBase) = integer then return(FAIL, "inputs must all be integers"): fi: pgf := 0: counter := 0: maxNumList := [seq(theBase-1, i=1..theLength)]: maxNum := toBase10(maxNumList, theBase): seenNums := {}: orbits := {}: for curNum from 0 to maxNum do curNumList := convert(curNum, base, theBase): #may not be full length, also in reverse order if nops(curNumList) < theLength then curNumList := extendList(curNumList, theLength): #adds any necessary beginning 0's fi: curNumList:=sort(curNumList): #wlog order doesnt matter if not fixed point isTrivial := checkTriv(curNumList): if not isTrivial then if not curNumList in seenNums then numPerms := getNumPerms(curNumList): counter := counter + numPerms: cur := listPhenom(curNumList, theBase): curNumIter := cur[1]: curOrbit := cur[3]: pgf := pgf + (numPerms * x^curNumIter): seenNums := {op(seenNums), curNumList}: orbits := {op(orbits), curOrbit}: fi: fi: od: orbitList := [op(orbits)]: for i from 1 to nops(orbitList) do orb := orbitList[i]: for j from 1 to nops(orb) do elt := orb[j]: if elt in seenNums then #so it was counted accurately, but all its permutations were counted with complexity 1 instead of 2 numPerms := getNumPerms(elt): pgf := pgf - (numPerms - 1) * x + (numPerms - 1) * x^2: else #so elt not in seenNums, so a perm of it is in seenNums, and so elt itself should have been #complexity 1, but instead counted as 2 pgf := pgf - x^2 + x: fi: od: od: pgf := (1/counter) * pgf: return(pgf): end: #******************************************************************************* getSampleIterationPGF:=proc(theLength, theBase, x, n) local pgf, curNumIter, maxNumList, maxNum, seenNums, curNum, curNumList, isTrivial, counter, isFixedPoint, numPerms, cur, curOrbits, curOrbit, orbits, orbitList, orb, i, j, elt, k: if not whattype(theLength) = integer or not whattype(theBase) = integer then return(FAIL, "inputs must all be integers"): fi: pgf := 0: counter := 0: for k from 0 to n do cur := randomEG(theLength, theBase): curNumIter := cur[1]: pgf := pgf + x^curNumIter: od: pgf := (1/n) * pgf: return(pgf): end: #******************************************************************************* moms:=proc(f, x, desiredMoment) local av, q, qCurr, qList, moments, i, stdMoms, stdDev, p: p := unapply(f,x): av := subs(x = 1, D(p)(x)): q := p(x)/x^(evalf(av)): qCurr := x*diff(q, x): qList := [qCurr]: for i from 2 to 6 do qCurr := x*diff(qCurr, x): qList := [op(qList), qCurr]: od: moments := subs(x = 1, qList): stdMoms := [seq(0, i=1..6)]: stdMoms[1] := av: stdDev := sqrt(moments[2]): stdMoms[2] := stdDev: if stdDev = 0 then if desiredMoment <= 2 then return(evalf(stdMoms,4)[desiredMoment]) else return(FAIL, "standard deviation is zero, so cannot calculate desired moment"): fi: else for i from 3 to 6 do stdMoms[i] := moments[i]/(stdDev^i): od: return(evalf(stdMoms,4)[desiredMoment]): fi: end: #******************************************************************************* getAllMoms:=proc(f,x): return([seq(moms(f,x,i), i=1..6)]): end: #******************************************************************************* getData:=proc(theLength, theBase) local orbs, numOrbs, longestOrbLength: orbs := allOrbits(theLength, theBase, "list"): numOrbs := nops(orbs): longestOrbLength := getLongestOrbitLength(orbs): return([numOrbs, longestOrbLength]): end: #******************************************************************************* getPCconjecturesPaperLength3:=proc(bases) local isPreComputed: isPreComputed := true: conjecturesPaperLength3(bases, isPreComputed): end: #******************************************************************************* getNPCconjecturesPaperLength3:=proc(bases) local isPreComputed: isPreComputed := false: conjecturesPaperLength3(bases, isPreComputed): end: #******************************************************************************* getPCconjecturesPaperLength4:=proc(bases) local isPreComputed: isPreComputed := true: conjecturesPaperLength4(bases, isPreComputed): end: #******************************************************************************* getNPCconjecturesPaperLength4:=proc(bases) local isPreComputed: isPreComputed := false: conjecturesPaperLength4(bases, isPreComputed): end: #******************************************************************************* getNPCConjecturesPaperLength6:=proc(bases) local isPreComputed: isPreComputed := false: conjecturesPaperLength6(bases, isPreComputed): end: #******************************************************************************* getPCconjecturesPaperLength7:=proc(bases) local isPreComputed: isPreComputed := true: conjecturesPaperLength7(bases, isPreComputed): end: #******************************************************************************* getNPCconjecturesPaperLength7:=proc(bases) local isPreComputed: isPreComputed := false: conjecturesPaperLength4(bases, isPreComputed): end: #******************************************************************************* getPCconjecturesPaper:=proc(theLengths, bases) local isPreComputed: isPreComputed := true: conjecturesPaper(theLengths, bases, isPreComputed): end: #******************************************************************************* getNPCconjecturesPaper:=proc(theLengths, bases) local isPreComputed: isPreComputed := false: conjecturesPaper(theLengths, bases, isPreComputed): end: #******************************************************************************* conjecturesPaperLength4:=proc(bases, isPC) local verifiable, theLengths, basesList, oddBasesVer, the2PowerBasesVer, the3PowerBasesVer, the3x2PowerBasesVer, the5x2PowerBasesVer, the7x2PowerBasesVer, i, n, maxBasePC, curBase, numOdd, num2Power, num3Power, num3x2Power, num5x2Power, num7x2Power: if not whattype(bases) in {list, set} then return(FAIL, `first input should be a set or list of bases`): fi: maxBasePC := getMaxBasePC(4): basesList := sort([op(bases)]): n:=nops(basesList): oddBasesVer := []: the2PowerBasesVer := []: the3PowerBasesVer := []: the3x2PowerBasesVer := []: the5x2PowerBasesVer := []: the7x2PowerBasesVer := []: for i from 1 to n do curBase := basesList[i]: verifiable := evalb(curBase <= maxBasePC): if curBase mod 2 = 1 then oddBasesVer := [op(oddBasesVer), [curBase, verifiable]]: fi: if whattype(log[2](curBase)) = integer and curBase >= 2^2 then the2PowerBasesVer := [op(the2PowerBasesVer), [curBase, verifiable]]: fi: if whattype(log[2](curBase/3)) = integer and curBase >= 3*2 then the3x2PowerBasesVer := [op(the3x2PowerBasesVer), [curBase, verifiable]]: fi: if whattype(log[2](curBase/5)) = integer and curBase >= 5*2 then the5x2PowerBasesVer := [op(the5x2PowerBasesVer), [curBase, verifiable]]: fi: if whattype(log[2](curBase/7)) = integer and curBase >= 7*2 then the7x2PowerBasesVer := [op(the7x2PowerBasesVer), [curBase, verifiable]]: fi: if whattype(log[3](curBase)) = integer and curBase >= 3^2 then the3PowerBasesVer := [op(the3PowerBasesVer), [curBase, verifiable]]: fi: od: numOdd := nops(oddBasesVer): num2Power := nops(the2PowerBasesVer): num3Power := nops(the3PowerBasesVer): num3x2Power := nops(the3x2PowerBasesVer): num5x2Power := nops(the5x2PowerBasesVer): num7x2Power := nops(the7x2PowerBasesVer): if numOdd + num2Power + num3Power + num3x2Power + num5x2Power + num7x2Power >= 1 then print(): printf("*******************************************\n"): printf("* \n"): printf("* Length 4 conjecture(s) for bases \n"): printf("* %a \n", bases): printf("* \n"): printf("*******************************************\n\n"): settingNotation(): else return(`None of the input bases satisfy any available conjectures for length 4.`): fi: print(): if numOdd >= 1 then printf("*************************************************\n"): printf("*************************************************\n\n"): printf("Odd-Base Conjecture(s)\n\n"): printf("*************************************************\n"): printf("*************************************************\n\n"): theOddBaseLength4Conjectures(false): print(): fi: for i from 1 to numOdd do printOddBaseLength4Conjectures(oddBasesVer[i][1], oddBasesVer[i][2], isPC): od: if num2Power >= 1 then printf("*************************************************\n"): printf("*************************************************\n\n"): printf("2-Power Conjectures\n\n"): printf("*************************************************\n"): printf("**************************************************\n\n"): the2PowerLength4Conjectures(false): print(): fi: for i from 1 to num2Power do print2PowerLength4Conjectures(the2PowerBasesVer[i][1], the2PowerBasesVer[i][2], isPC): od: if num3Power >= 1 then printf("*************************************************\n"): printf("*************************************************\n\n"): printf("3-Power Conjectures\n\n"): printf("*************************************************\n"): printf("**************************************************\n\n"): the3PowerLength4Conjectures(false): print(): fi: for i from 1 to num3Power do print3PowerLength4Conjectures(the3PowerBasesVer[i][1], the3PowerBasesVer[i][2], isPC): od: if num3x2Power >= 1 then printf("*************************************************\n"): printf("*************************************************\n\n"): printf("3x2-Power Conjectures\n\n"): printf("*************************************************\n"): printf("**************************************************\n\n"): the3x2PowerLength4Conjectures(false): print(): fi: for i from 1 to num3x2Power do print3x2PowerLength4Conjectures(the3x2PowerBasesVer[i][1], the3x2PowerBasesVer[i][2], isPC): od: if num5x2Power >= 1 then printf("*************************************************\n"): printf("*************************************************\n\n"): printf("5x2-Power Theorems\n\n"): printf("*************************************************\n"): printf("**************************************************\n\n"): the5x2PowerLength4Conjectures(false): print(): fi: for i from 1 to num5x2Power do print5x2PowerLength4Theorems(the5x2PowerBasesVer[i][1], the5x2PowerBasesVer[i][2], isPC): od: if num7x2Power >= 1 then printf("*************************************************\n"): printf("*************************************************\n\n"): printf("7x2-Power Conjectures\n\n"): printf("*************************************************\n"): printf("**************************************************\n\n"): the7x2PowerLength4Conjectures(false): print(): fi: for i from 1 to num7x2Power do print7x2PowerLength4Conjectures(the7x2PowerBasesVer[i][1], the7x2PowerBasesVer[i][2], isPC): od: end: #******************************************************************************* conjecturesPaperLength3:=proc(bases, isPC) local verifiable, theLengths, basesList, evenBasesVer, oddBasesVer, i, n, maxBasePC, curBase, numOdd, numEven: if not whattype(bases) in {list, set} then return(FAIL, `first input should be a set or list of bases`): fi: maxBasePC := getMaxBasePC(3): basesList := sort([op(bases)]): n:=nops(basesList): evenBasesVer := []: oddBasesVer := []: for i from 1 to n do curBase := basesList[i]: verifiable := evalb(curBase <= maxBasePC): if curBase mod 2 = 1 then oddBasesVer := [op(oddBasesVer), [curBase, verifiable]]: else evenBasesVer := [op(evenBasesVer), [curBase, verifiable]]: fi: od: numOdd := nops(oddBasesVer): numEven := nops(evenBasesVer): settingNotation(): print(): if numOdd + numEven >= 1 then print(): printf("*******************************************\n"): printf("* \n"): printf("* Length 3 Theorems for bases \n"): printf("* %a \n", bases): printf("* \n"): printf("*******************************************\n\n"): fi: if numOdd >= 1 then printf("*************************************************\n"): printf("*************************************************\n\n"): printf("Odd-Base Conjecture(s)\n\n"): printf("*************************************************\n"): printf("*************************************************\n\n"): theOddBaseLength3Theorems(false): print(): print(): fi: for i from 1 to nops(oddBasesVer) do printOddBaseLength3Theorems(oddBasesVer[i][1], oddBasesVer[i][2], isPC): od: if numEven >= 1 then printf("*************************************************\n"): printf("*************************************************\n\n"): printf("Even-Base Conjecture(s)\n\n"): printf("*************************************************\n"): printf("*************************************************\n\n"): theEvenBaseLength3Theorems(false): print(): fi: for i from 1 to nops(evenBasesVer) do printEvenBaseLength3Theorems(evenBasesVer[i][1], evenBasesVer[i][2], isPC): od: end: #******************************************************************************* conjecturesPaperLength6:=proc(bases, isPC) local verifiable, theLengths, basesList, evenBasesVer, i, n, curBase, numEven: if not whattype(bases) in {list, set} then return(FAIL, `first input should be a set or list of bases`): fi: basesList := sort([op(bases)]): n:=nops(basesList): evenBasesVer := []: for i from 1 to n do curBase := basesList[i]: verifiable := true: if curBase mod 2 = 0 then evenBasesVer := [op(evenBasesVer), [curBase, verifiable]]: fi: od: numEven := nops(evenBasesVer): if numEven >= 1 then print(): printf("*******************************************\n"): printf("* \n"): printf("* Length 6 Proposition for bases \n"): printf("* %a \n", bases): printf("* \n"): printf("*******************************************\n\n"): settingNotation(): print(): printf("*************************************************\n"): printf("*************************************************\n\n"): printf("Even-Base Conjecture(s)\n\n"): printf("*************************************************\n"): printf("*************************************************\n\n"): theEvenBaseLength6Proposition(false): print(): fi: for i from 1 to nops(evenBasesVer) do printEvenBaseLength6Proposition(evenBasesVer[i][1], evenBasesVer[i][2], isPC): od: end: #******************************************************************************* conjecturesPaperLength7:=proc(bases, isPC) local verifiable, theLengths, basesList, evenBasesVer, i, n, maxBasePC, curBase, numEven: if not whattype(bases) in {list, set} then return(FAIL, `first input should be a set or list of bases`): fi: maxBasePC := getMaxBasePC(7): basesList := sort([op(bases)]): n:=nops(basesList): evenBasesVer := []: for i from 1 to n do curBase := basesList[i]: verifiable := evalb(curBase <= maxBasePC): if curBase mod 2 = 0 then if curBase mod 4 = 0 and curBase >= 4*6 then evenBasesVer := [op(evenBasesVer), [curBase, verifiable]]: elif curBase mod 4 = 2 and curBase >= 4*4+2 then evenBasesVer := [op(evenBasesVer), [curBase, verifiable]]: fi: fi: od: numEven := nops(evenBasesVer): if numEven >= 1 then print(): printf("*******************************************\n"): printf("* \n"): printf("* Length 7 conjecture(s) for bases \n"): printf("* %a \n", bases): printf("* \n"): printf("*******************************************\n\n"): settingNotation(): print(): printf("*************************************************\n"): printf("*************************************************\n\n"): printf("Even-Base Conjecture(s)\n\n"): printf("*************************************************\n"): printf("*************************************************\n\n"): theEvenBaseLength7Conjectures(false): print(): fi: for i from 1 to nops(evenBasesVer) do printEvenBaseLength7Conjectures(evenBasesVer[i][1], evenBasesVer[i][2], isPC): od: end: #******************************************************************************* conjecturesPaper:=proc(inputLengthsExpr, bases, isPC) local verifiable, theLengths: #verify theLengths subset of lenths with conjectures if inputLengthsExpr = "all" then theLengths := lengthsWithConjectures(): else theLengths := inputLengthsExpr: fi: if not whattype(theLengths) in {list, set} then return(FAIL, `first input should be a set or list of lengths`): fi: if not `subset`({op(theLengths)}, lengthsWithConjectures()) then return(FAIL, `The first input should be a set of lengths for which there are available conjectures, which is in this case`, lengthsWithConjectures()): fi: if 3 in theLengths then conjecturesPaperLength3(bases, isPC): fi: if 4 in theLengths then conjecturesPaperLength4(bases, isPC): fi: if 6 in theLengths then conjecturesPaperLength6(bases, isPC): fi: if 7 in theLengths then conjecturesPaperLength7(bases, isPC): fi: end: #******************************************************************************* print2PowerLength4Conjectures:=proc(theBase, isVerifiable, isPreComp) local k, j, conjS, evenStringConjS, oddStringConjS, S, n, parity, orbits, numOrbs, nParity, isConjTrue: n := log[2](theBase): if not whattype(n) = integer then return(FAIL, `first input should be a power of 2`): fi: printf("*****************\n"): printf(" base b = %d \n", theBase): printf("*****************"): print(): evenStringConjS := `[k, k+1, seq(2k, i=1..k-1), seq(2(k+1), i=1..k-1)]`: oddStringConjS := `[seq(2k+1, i=1..k), seq(2(k+1)+1, i=1..k)]`: if n mod 2 = 0 then k := n/2: nParity := `even`: conjS := [k, k+1, seq(2*k, i=1..k-1), seq(2*(k+1), i=1..k-1)]: else k := (n-1)/2: #so n=2k+1 nParity := `odd`: conjS := [seq(2*k+1, i=1..k), seq(2*(k+1)+1, i=1..k)]: fi: if isVerifiable or not isPreComp then #so want to get explicit verification if not isPreComp then #so want to compute new orbits := allOrbits(4, theBase, "list"): else orbits := length4Orbits(theBase): fi: numOrbs := nops(orbits): S := getOrbitLengths(orbits): isConjTrue := evalb(S = conjS): printf("For b = %d, so n = %d, and in particular n is %s, and k = %d.\n", theBase, n, nParity, k): printf("The list of all limiting orbits is: \n\n"): print(): for j from 1 to numOrbs do print(orbits[j]): od: print(): printf("Thus N(4,b) = %d and L(4,b) = %a.\n", numOrbs, S): printf("Thus the n-%s Conjecture is %s.\n", nParity, isConjTrue): print(): else #so dont compute, just state conjecture printf("The base b= %d has not been pre-computed, but since in this case n = %d,\n", theBase, n): printf("and in particular n is %s and k = %d:", nParity, k): print(): printf("the n-%s conjecture applied to the base b = %d says that N(4,b) = %d and L(4,b) = %a.", nParity, theBase, 2*k, conjS): print(): fi: end: #******************************************************************************* print3x2PowerLength4Conjectures:=proc(theBase, isVerifiable,isPreComp) local k, j, conjS, conjL, S, n, parity, orbits, numOrbs, conjGenerator1, conjGenerator2, generator1, generator2, nParity, isConjTrue: n := log[2](theBase/3): if not whattype(n) = integer then return(FAIL, `first input should be of the form 3*2^n for some positive integer n`): fi: printf("*****************\n"): printf(" base b = %d \n", theBase): printf("*****************"): print(): conjGenerator1 :=[2^n - 1, 3*2^n - 1, 3*2^n - 1, 2^(n+1)]: if n mod 2 = 0 then k := n/2: nParity := `even`: conjS := [2*k+1, 2*(2*k+1)]: conjL := 2: conjGenerator2 := [2^n, 2^(n-1)-1, 5*2^(n-1) - 1, 2^(n+1)]: else k := (n-1)/2: #so n=2k+1 nParity := `odd`: conjS := [6*(k+1)]: conjL := 1: fi: if isVerifiable or not isPreComp then #so want to get explicit verification if not isPreComp then #so want to compute new orbits := allOrbits(4, theBase, "list"): else orbits := length4Orbits(theBase): fi: numOrbs := nops(orbits): S := getOrbitLengths(orbits): if n mod 2 = 0 then if nops([op(orbits)][1]) < nops([op(orbits)][2]) then #so first is smaller generator1 := [op(orbits)][1][1]: generator2 := [op(orbits)][2][1]: else generator2 := [op(orbits)][1][1]: generator1 := [op(orbits)][2][1]: fi: isConjTrue := evalb(S = conjS and generator1 = conjGenerator1 and generator2 = conjGenerator2): else #only 1 orbit generator1 := op(orbits)[1]: isConjTrue := evalb(S = conjS and generator1 = conjGenerator1): fi: printf("For b = %d, n = %d, and in particular n is %s, and k = %d.\n", theBase, n, nParity, k): printf("The list of all limiting orbits is: \n\n"): print(): for j from 1 to numOrbs do print(orbits[j]): od: print(): printf("Thus N(4,b) = %d and L(4,b) = %a.\n", numOrbs, S): if n mod 2 = 0 then printf("Further, the generator for the smaller limiting orbit is %a and \n", generator1): printf("the generator for the larger limiting orbit is %a.\n", generator2): else printf("Further, the generator for the limiting orbit is %a.\n", generator1): fi: printf("Thus the n-%s Conjecture is %s.\n", nParity, isConjTrue): print(): else printf("The base b = %d has not been pre-computed, but since in this case n = %d\,n", theBase, n): printf("and in particular n is %s and k = %d:", nParity, k): print(): printf("the n-%s conjecture applied to the base b = %d says that N(4,b) = %d and L(4,b) = %a.\n", nParity, theBase, conjL, conjS): if n mod 2 = 0 then printf("Further, it says that the generator for the smaller limiting orbit is %a and \n", conjGenerator1): printf("the generator for the larger limiting orbit is %a.\n", conjGenerator2): else printf("Further, the generator for the limiting orbit is %a.\n", conjGenerator1): fi: print(): fi: end: #******************************************************************************* print5x2PowerLength4Theorems:=proc(theBase, isVerifiable,isPreComp) local k, j, conjS, conjL, the0mod4StringConjS, the2mod4StringConjS, oddStringConjS, S, n, orbits, numOrbs, conjGenerator1, conjGenerator2, generator1, generator2, nParity, isConjTrue: n := log[2](theBase/5): if not whattype(n) = integer then return(FAIL, `first input should be of the form 5*2^n for some positive integer n`): fi: printf("*****************\n"): printf(" base b = %d \n", theBase): printf("*****************"): print(): conjGenerator1 :=[3*2^n, 2^n - 1, 2^(n+2) - 1, 2^(n+1)]: if n mod 4 in {0,2} then k := n mod 4: nParity := `even`: conjL := 2: if k = 0 then conjS := [1, n+1]: conjGenerator2 := [2^n - 1, 5*2^n - 1, 5*2^n - 1, 2^(n+2)]: else conjS := [1, 2*(n+1)]: conjGenerator2 := [2^(n+1) - 1, 5*2^n - 1, 5*2^n - 1, 3*2^n]: fi: else nParity := `odd`: conjS := [1]: conjL := 1: fi: if isVerifiable or not isPreComp then #so want to get explicit verification if not isPreComp then #so want to compute new orbits := allOrbits(4, theBase, "list"): else orbits := length4Orbits(theBase): fi: numOrbs := nops(orbits): S := getOrbitLengths(orbits): if n mod 2 = 0 then if nops([op(orbits)][1]) < nops([op(orbits)][2]) then #so first is smaller generator1 := [op(orbits)][1][1]: generator2 := [op(orbits)][2][1]: else generator2 := [op(orbits)][1][1]: generator1 := [op(orbits)][2][1]: fi: isConjTrue := evalb(S = conjS and generator1 = conjGenerator1 and generator2 = conjGenerator2): else #only 1 orbit generator1 := op(orbits)[1]: isConjTrue := evalb(S = conjS and generator1 = conjGenerator1): fi: printf("For b = %d, n = %d, and in particular n mod 4 is %d.\n", theBase, n, n mod 4): printf("The list of all limiting orbits is: \n\n"): print(): for j from 1 to numOrbs do print(orbits[j]): od: print(): printf("Thus N(4,b) = %d and L(4,b) = %a.\n", numOrbs, S): if isConjTrue then if n mod 2 = 0 then printf("Further, the first limiting orbit is %a and \n", [generator1]): printf("and a generator for the second limiting orbit is %a.\n", generator2): else printf("Further, the limiting orbit is %a.\n", [generator1]): fi: fi: printf("Thus the n-%s Conjecture is %s.\n", nParity, isConjTrue): print(): else printf("The base b = %d has not been pre-computed, but since in this case n = %d,\n", theBase, n): printf("and in particular n mod 4 is %d: ", n mod 4): print(): printf("the n-%s conjecture says that N(4,b) = %d and L(4,b) = %a.\n", nParity, conjL, conjS): if n mod 2 = 0 then printf("Further, it says that the smaller limiting orbit is %a and \n", [conjGenerator1]): printf("the generator for the larger limiting orbit is %a.\n", conjGenerator2): else printf("Further, it says that the singular limiting orbit is %a.\n", [conjGenerator1]): fi: print(): fi: end: #******************************************************************************* print7x2PowerLength4Conjectures:=proc(theBase, isVerifiable, isPreComp) local k, j, conjS, conjL, mod0StringConjS, notMod0StringConjS, S, n, parity, orbits, numOrbs, nParity, isConjTrue, conjGenerator1, conjGenerator2, generator1, generator2: n := log[2](theBase/7): if not whattype(n) = integer then return(FAIL, `first input should be of the form 7*2^n for some positive integer n`): fi: printf("*****************\n"): printf(" base b = %d \n", theBase): printf("*****************"): print(): conjGenerator1 := [3*2^n, 2^n - 1, 3*2^(n+1) - 1, 2^(n+2)]: if n mod 3 = 0 then k := n/3: conjS := [3, 3*k+1]: conjL := 2: conjGenerator2 := [2^n-1, 7*2^n-1, 7*2^n - 1, 3*2^(n+1)]: else conjS := [3]: conjL := 1: fi: if isVerifiable or not isPreComp then #so want to get explicit verification if not isPreComp then #so want to compute new orbits := allOrbits(4, theBase, "list"): else orbits := length4Orbits(theBase): fi: numOrbs := nops(orbits): S := getOrbitLengths(orbits): if n mod 3 = 0 then if nops([op(orbits)][1]) < nops([op(orbits)][2]) then #so first is smaller generator1 := [op(orbits)][1][1]: generator2 := [op(orbits)][2][1]: else generator2 := [op(orbits)][1][1]: generator1 := [op(orbits)][2][1]: fi: isConjTrue := evalb(S = conjS and generator1 = conjGenerator1 and generator2 = conjGenerator2): else #only 1 orbit generator1 := op(orbits)[1]: isConjTrue := evalb(S = conjS and generator1 = conjGenerator1): fi: if n mod 3 = 0 then printf("For b = %d, n = %d, and in particular n mod 3 = %d and k = %d.\n", theBase, n, n mod 3, k): else printf("For b = %d, n = %d, and in particular n mod 3 = %d.", theBase, n, n mod 3): fi: printf("The list of all limiting orbits is: \n\n"): print(): for j from 1 to numOrbs do print(orbits[j]): od: print(): printf("Thus N(4,b) = %d and L(4,b) = %a.\n", numOrbs, S): if n mod 3 = 0 then if isConjTrue then printf("Further, the generator for the smaller limiting orbit is %a and \n", generator1): printf("the generator for the larger limiting orbit is %a.\n", generator2): fi: printf("Thus the n mod 3 = 0 conjecture is %s.\n", isConjTrue): else if isConjTrue then printf("Further, the generator for the limiting orbit is %a.\n", generator1): fi: printf("Thus the n mod 3 nonzero conjecture is %s.\n", isConjTrue): fi: print(): else printf("The base b = %d has not been pre-computed, but since in this case n = %d,\n", theBase, n): if n mod 3 = 0 then printf("and in particular n mod 3 = %d and k = %d:", n mod 3, k): print(): printf("the n mod 3 = 0 conjecture says that N(4,b) = %d and L(4,b) = %a.", conjL, conjS): printf("Further, it says that the generator for the smaller limiting orbit is %a and \n", conjGenerator1): printf("the generator for the larger limiting orbit is %a.\n", conjGenerator2): else printf("and in particular n mod 3 = %d:", n mod 3): print(): printf("the n mod 3 nonzero conjecture says that N(4,b) = %d and L(4,b) = %a.", conjL, conjS): printf("Further, the generator for the limiting orbit is %a.\n", conjGenerator1): fi: fi: end: #******************************************************************************* print3PowerLength4Conjectures:=proc(theBase, isVerifiable, isPreComp) local k, j, conjS, conjL, stringConjS, S, n, nParity, orbits, numOrbs, isConjTrue: n := log[3](theBase): if not whattype(n) = integer then return(FAIL, `first input should be a power of 3`): fi: printf("*****************\n"): printf(" base b = %d \n", theBase): printf("*****************"): print(): conjS := [seq(seq(3^k, i=1..3^k-1), k=1..n-1)]: conjL := sum(3^k - 1, k=1..n-1): if isVerifiable or not isPreComp then #so want to get explicit verification if not isPreComp then #so want to compute new orbits := allOrbits(4, theBase, "list"): else orbits := length4Orbits(theBase): fi: numOrbs := nops(orbits): S := getOrbitLengths(orbits): isConjTrue := evalb(S = conjS): printf("For b = %d, n = %d.\n", theBase, n): printf("The list of all limiting orbits is: \n\n"): print(): for j from 1 to numOrbs do print(orbits[j]): od: print(): printf("Thus N(4,b) = %d and L(4,b) = %a.\n", numOrbs, S): printf("Thus the conjecture is %s.\n", isConjTrue): print(): else printf("The base b = %d has not been pre-computed, but since in this case n = %d:\n", theBase, n): print(): printf("the conjecture says that N(4,b) = %d and L(4,b) = %a.", conjL, conjS): print(): fi: end: #******************************************************************************* printOddBaseLength4Conjectures:=proc(theBase, isVerifiable, isPreComp) local k, j, i, conjElementsExpr, S, m, n, parity, orbits, numOrbs, conjParity: n := (theBase-1)/2: if not whattype(n) = integer then return(FAIL, `first input should be an odd positive integer`): fi: printf("*****************\n"): printf(" base b = %d \n", theBase): printf("*****************"): print(): k := 'k': i := 'i': if isVerifiable or not isPreComp then #so want to get explicit verification if not isPreComp then #so want to compute new orbits := allOrbits(4, theBase, "list"): else orbits := length4Orbits(theBase): fi: numOrbs := nops(orbits): if numOrbs mod 2 = 0 then parity := `even`: else parity := `odd`: fi: S := {op(getOrbitLengths(orbits))}: m := max(S): printf("For b = %d, n = %d, and the list of all limiting orbits is: \n\n", theBase, n): print(): for j from 1 to numOrbs do print(orbits[j]): od: print(): printf("Thus N(4,b) = %d, n mod 4 = %d, L(4,b) = %a, and m = %d.\n", numOrbs, n mod 4, S, m): printf("Since N(4,b) has %s parity, Conjecture A is %s.\n", parity, checkParityConjecture(orbits, theBase)): printf("and by checking each entry of L(4,b) we see that Conjecture B is %s. \n", checkOrbitLengthsDivConjecture(orbits)): printf("Finally, in this case U = {seq(seq([2*k+1, 2*i, %d-2*i, %d-2*k], i=0..k-1), k=1..%d)}, which more explicitly is:", 2*n-1,2*n,n-1): print(): print(conjecturedOddBaseLength4Elements(theBase)): print(): printf("and so comparing U with the list of limiting orbits above, we see that in this case "): printf("Conjecture C is %s.", checkElementsConjecture(orbits, theBase)): print(): else printf("The base b = %d has not been pre-computed, but since in this case n = %d:\n", theBase, n): if n mod 4 in {0,1} then conjParity := `even`: else conjParity := `odd`: fi: print(): printf("n mod 4 = %d, and so Conjecture A says that N(4,b) is %s.", n mod 4, conjParity): printf("Further, Conjecture C says that U = {seq(seq([2*k+1, 2*i, %d-2*i, %d-2*k], i=0..k-1), k=1..%d)}, which more explicitly is:", 2*n-1,2*n,n-1): print(): print(conjecturedOddBaseLength4Elements(theBase)): print(): fi: end: #******************************************************************************* printOddBaseLength3Theorems:=proc(theBase, isVerifiable, isPreComp) local j, n, parity, orbits, numOrbs, conjNumOrbs, conjLengths, conjOrbit, lengths, isConjTrue: n := (theBase-1)/2: if not whattype(n) = integer then return(FAIL, `first input should be an odd positive integer`): fi: printf("*****************\n"): printf(" base b = %d \n", theBase): printf("*****************"): print(): conjNumOrbs := 1: conjLengths := [2]: conjOrbit :=[[n-1, 2*n, n+1], [n, 2*n, n]]: if isVerifiable or not isPreComp then #so want to get explicit verification if not isPreComp then #so want to compute new orbits := allOrbits(3, theBase, "list"): else orbits := length3Orbits(theBase): fi: numOrbs := nops(orbits): lengths := getOrbitLengths(orbits): isConjTrue := evalb(lengths = conjLengths and orbits = {conjOrbit}): printf("For b = %d, n = %d.\n", theBase, n): printf("The list of all limiting orbits is: \n\n"): print(): for j from 1 to numOrbs do print(orbits[j]): od: print(): printf("Thus N(3,b) = %d and L(3,b) = %a.\n", numOrbs, lengths): if lengths = [2] then printf("Further, the limiting orbit is %a.\n", op(orbits)): fi: printf("Thus the conjecture is %s.\n", isConjTrue): print(): else printf("The base b = %d has not been pre-computed, but since in this case n = %d:\n", theBase, n): print(): printf("the theorem says that N(3,b) = %d and L(3,b) = %a.\n", conjNumOrbs, conjLengths): printf("Further, it says that the limiting orbit is %a.\n", conjOrbit): print(): fi: end: #******************************************************************************* printEvenBaseLength3Theorems:=proc(theBase, isVerifiable, isPreComp) local j, n, parity, orbits, numOrbs, conjNumOrbs, conjLengths, conjOrbit, lengths, isConjTrue: n := theBase/2: if not whattype(n) = integer then return(FAIL, `first input should be an even positive integer`): fi: printf("*****************\n"): printf(" base b = %d \n", theBase): printf("*****************"): print(): conjNumOrbs := 1: conjLengths := [1]: conjOrbit :=[[n-1, 2*n-1, n]]: if isVerifiable or not isPreComp then #so want to get explicit verification if not isPreComp then #so want to compute new orbits := allOrbits(3, theBase, "list"): else orbits := length3Orbits(theBase): fi: numOrbs := nops(orbits): lengths := getOrbitLengths(orbits): isConjTrue := evalb(lengths = conjLengths and orbits = {conjOrbit}): printf("For b = %d, n = %d.\n", theBase, n): printf("The list of all limiting orbits is: \n\n"): print(): for j from 1 to numOrbs do print(orbits[j]): od: print(): printf("Thus N(3,b) = %d and L(3,b) = %a.\n", numOrbs, lengths): if lengths = [1] then printf("Further, the limiting orbit is %a.\n", op(orbits)): fi: printf("Thus the conjecture is %s.\n", isConjTrue): print(): else printf("The base b = %d has not been pre-computed, but since in this case n = %d:\n", theBase, n): print(): printf("the theorem says that N(3,b) = %d and L(3,b) = %a.\n", conjNumOrbs, conjLengths): printf("Further, it says that the limiting orbit is %a.\n", conjOrbit): print(): fi: end: #******************************************************************************* printEvenBaseLength6Proposition:=proc(theBase, isVerifiable, isPreComp) local n, isConjTrue: n := theBase/2: if not whattype(n) = integer or theBase < 2 then return(FAIL, `first input should be an even positive integer`): fi: isConjTrue := verifyEvenBaseLength6Proposition(theBase): printf("*****************\n"): printf(" base b = %d \n", theBase): printf("*****************"): print(): printf("For b = %d, n = %d.\n", theBase, n): printf("Thus since K(%a) = %a,\n", [n, n-1, 2*n-1, 2*n-1, n-1, n], iterate([n, n-1, 2*n-1, 2*n-1, n-1, n],theBase)): printf("the proposition is %s in this case.\n", isConjTrue): print(): end: #******************************************************************************* printEvenBaseLength7Conjectures:=proc(theBase, isVerifiable, isPreComp) local k, j, conjNumOrbs, conjLengths, lengths, n, orbits, numOrbs, nParity, isConjTrue, conjGenerator1, conjGenerator2, generator1, generator2: if not whattype(theBase/2) = integer or theBase < 2 then return(FAIL, `first input should be an even positive integer`): elif theBase mod 4 = 0 then if theBase < 4*6 then return(FAIL, `for bases which are 0 mod 4 the input base should be at least 24.`): fi: elif theBase mod 4 = 2 then if theBase < 4*4+2 then return(FAIL, `for bases which are 2 mod 4 the input base should be at least 18.`): fi: fi: printf("*****************\n"): printf(" base b = %d \n", theBase): printf("*****************"): print(): if theBase mod 4 = 0 then n := theBase/4: conjNumOrbs := 2: conjLengths := [1,19]: conjGenerator1 := [3*n, 2*n, n-1, 4*n-1, 3*n-1,2*n-1,n]: conjGenerator2 := [3*n-1,2*n-2,n-2,4*n-1,3*n,2*n+1,n+1]: else #so theBase mod 4 = 2, since base is even n := (theBase - 2)/4: conjGenerator1 := [3*n+1, 2*n, n-2, 4*n+1, 3*n+2, 2*n+1, n+1]: conjNumOrbs := 1: conjLengths := [4]: fi: if isVerifiable or not isPreComp then #so want to get explicit verification if not isPreComp then #so want to compute new orbits := allOrbits(7, theBase, "list"): else orbits := length7Orbits(theBase): fi: numOrbs := nops(orbits): lengths := getOrbitLengths(orbits): if myBase mod 4 = 0 then if nops([op(orbits)][1]) < nops([op(orbits)][2]) then #so first is smaller generator1 := [op(orbits)][1][1]: generator2 := [op(orbits)][2][1]: else #so myBase mod 4 = 2, since base is even generator2 := [op(orbits)][1][1]: generator1 := [op(orbits)][2][1]: fi: isConjTrue := evalb(lengths = conjLengths and generator1 = conjGenerator1 and generator2 = conjGenerator2): else #only 1 orbit generator1 := op(orbits)[1]: isConjTrue := evalb(lengths = conjLengths and generator1 = conjGenerator1): fi: printf("For b = %d, n = %d, and in particular b mod 4 = %d.\n", theBase, n, theBase mod 4): printf("The list of all limiting orbits is: \n\n"): print(): for j from 1 to numOrbs do print(orbits[j]): od: print(): printf("Thus N(7,b) = %d and L(7,b) = %a.\n", numOrbs, lengths): if myBase mod 4 = 0 then if isConjTrue then printf("Further, length 1 orbit is %a and \n", [generator1]): printf("the generator for the length 19 orbit is %a.\n", generator2): fi: printf("Thus the b mod 4 = 0 conjecture is %s.\n", isConjTrue): else #so myBase mod 4 = 2 if isConjTrue then printf("Further, the generator for the limiting orbit is %a.\n", generator1): fi: printf("Thus the b mod 4 = 2 conjecture is %s.\n", isConjTrue): fi: print(): else printf("The base b = %d has not been pre-computed, but since in this case n = %d,\n", theBase, n): if theBase mod 4 = 0 then printf("and in particular b mod 4 = %d:", theBase mod 4): print(): printf("the b mod 4 = 0 conjecture says that N(7,b) = %d and L(7,b) = %a.", conjNumOrbs, conjLengths): printf("Further, it says that the length 1 orbit is %a and \n", [conjGenerator1]): printf("the generator for the length 19 orbit is %a.\n", conjGenerator2): else printf("and in particular b mod 4 = %d:", theBase mod 4): print(): printf("the b mod 4 = 2 conjecture says that N(7,b) = %d and L(7,b) = %a.", conjNumOrbs, conjLengths): printf("Further, the generator for the limiting orbit is %a.\n", conjGenerator1): fi: fi: end: #******************************************************************************* verifyOddBaseLength4Conjectures := proc(myBase, isPC) local orbits, bool, isElementsConjTrue, isParityConjTrue, isOrbitLengthsConjTrue: if myBase < 2 or not whattype(myBase) = integer then return(FAIL, `first input must be a positive integer >= 2`): fi: if isPC then if myBase > getMaxBasePC(4) then return(FAIL, `there is no pre-computed data for input base`): fi: orbits := length4Orbits(myBase): else orbits := allOrbits(4, myBase, "list"): fi: bool := false: isElementsConjTrue := checkElementsConjecture(orbits, myBase): isParityConjTrue := checkParityConjecture(orbits, myBase): isOrbitLengthsConjTrue := checkOrbitLengthsDivConjecture(orbits): if (isElementsConjTrue and isParityConjTrue and isOrbitLengthsConjTrue) then bool := true: fi: return(bool): end: #******************************************************************************* verifyElementsConjecture := proc(myBase, isPC) local orbits: if myBase < 2 or not whattype(myBase) = integer then return(FAIL, `first input must be a positive integer >= 2`): fi: if isPC then if myBase > getMaxBasePC(4) then return(FAIL, `there is no pre-computed data for input base`): fi: orbits := length4Orbits(myBase): else orbits := allOrbits(4, myBase, "list"): fi: return(checkElementsConjecture(orbits, myBase)): end: #******************************************************************************* conjecturedOddBaseLength4Elements := proc(myBase) local n, conjElements: n := (myBase - 1)/2: if not whattype(n) = integer or myBase <= 4 then return(FAIL, `conjecture is only for odd bases >= 5`): fi: conjElements := {seq(seq([2*k+1, 2*i, 2*(n-i)-1, 2*(n-k)], i=0..k-1), k=1..n-1)}: return(conjElements): end: #******************************************************************************* verifyParityConjecture := proc(myBase, isPC) local orbits: #parity 0 = even, parity 1 = odd if myBase < 2 or not whattype(myBase) = integer then return(FAIL, `first input must be a positive integer >= 2`): fi: if isPC then if myBase > getMaxBasePC(4) then return(FAIL, `there is no pre-computed data for input base`): fi: orbits := length4Orbits(myBase): else orbits := allOrbits(4, myBase, "list"): fi: return(checkParityConjecture(orbits, myBase)): end: #******************************************************************************* verifyOrbitLengthsDivConjecture := proc(myBase, isPC) local orbits: if myBase < 2 or not whattype(myBase) = integer then return(FAIL, `first input must be a positive integer >= 2`): fi: if isPC then if myBase > getMaxBasePC(4) then return(FAIL, `there is no pre-computed data for input base`): fi: orbits := length4Orbits(myBase): else orbits := allOrbits(4, myBase, "list"): fi: return(checkOrbitLengthsDivConjecture(orbits)): end: #******************************************************************************* verify2PowerLength4Conjectures := proc(myBase, isPC) local orbits: if myBase < 2 or not whattype(myBase) = integer then return(FAIL, `first input must be a positive integer >= 2`): fi: if isPC then if myBase > getMaxBasePC(4) then return(FAIL, `there is no pre-computed data for input base`): fi: orbits := length4Orbits(myBase): else orbits := allOrbits(4, myBase, "list"): fi: return(check2PowerLength4Conjectures(orbits, myBase)): end: #******************************************************************************* verify3x2PowerLength4Conjectures := proc(myBase, isPC) local orbits: if myBase < 2 or not whattype(myBase) = integer then return(FAIL, `first input must be a positive integer >= 2`): fi: if isPC then if myBase > getMaxBasePC(4) then return(FAIL, `there is no pre-computed data for input base`): fi: orbits := length4Orbits(myBase): else orbits := allOrbits(4, myBase, "list"): fi: return(check3x2PowerLength4Conjectures(orbits, myBase)): end: #******************************************************************************* verify5x2PowerLength4Theorems := proc(myBase, isPC) local orbits: if myBase < 2 or not whattype(myBase) = integer then return(FAIL, `first input must be a positive integer >= 2`): fi: if isPC then if myBase > getMaxBasePC(4) then return(FAIL, `there is no pre-computed data for input base`): fi: orbits := length4Orbits(myBase): else orbits := allOrbits(4, myBase, "list"): fi: return(check5x2PowerLength4Theorems(orbits, myBase)): end: #******************************************************************************* verify7x2PowerLength4Conjectures := proc(myBase, isPC) local orbits: if myBase < 2 or not whattype(myBase) = integer then return(FAIL, `first input must be a positive integer >= 2`): fi: if isPC then if myBase > getMaxBasePC(4) then return(FAIL, `there is no pre-computed data for input base`): fi: orbits := length4Orbits(myBase): else orbits := allOrbits(4, myBase, "list"): fi: return(check7x2PowerLength4Conjectures(orbits, myBase)): end: #******************************************************************************* verify3PowerLength4Conjectures := proc(myBase, isPC) local orbits: if myBase < 2 or not whattype(myBase) = integer then return(FAIL, `first input must be a positive integer >= 2`): fi: if isPC then if myBase > getMaxBasePC(4) then return(FAIL, `there is no pre-computed data for input base`): fi: orbits := length4Orbits(myBase): else orbits := allOrbits(4, myBase, "list"): fi: return(check3PowerLength4Conjectures(orbits, myBase)): end: #******************************************************************************* verifyOddBaseLength3Theorems := proc(myBase, isPC) local orbits: if myBase < 2 or not whattype(myBase) = integer then return(FAIL, `first input must be a positive integer >= 2`): fi: if isPC then if myBase > getMaxBasePC(3) then return(FAIL, `there is no pre-computed data for input base`): fi: orbits := length3Orbits(myBase): else orbits := allOrbits(3, myBase, "list"): fi: return(checkOddBaseLength3Theorems(orbits, myBase)): end: #******************************************************************************* verifyEvenBaseLength3Theorems := proc(myBase, isPC) local orbits: if myBase < 2 or not whattype(myBase) = integer then return(FAIL, `first input must be a positive integer >= 2`): fi: if isPC then if myBase > getMaxBasePC(3) then return(FAIL, `there is no pre-computed data for input base`): fi: orbits := length3Orbits(myBase): else orbits := allOrbits(3, myBase, "list"): fi: return(checkEvenBaseLength3Theorems(orbits, myBase)): end: #******************************************************************************* verifyEvenBaseLength7Conjectures := proc(myBase, isPC) local orbits: if myBase < 2 or not whattype(myBase) = integer then return(FAIL, `first input must be a positive integer >= 2`): fi: if isPC then if myBase > getMaxBasePC(7) then return(FAIL, `there is no pre-computed data for input base`): fi: orbits := length7Orbits(myBase): else orbits := allOrbits(7, myBase, "list"): fi: return(checkEvenBaseLength7Conjectures(orbits, myBase)): end: #******************************************************************************* verifyEvenBaseLength6Proposition := proc(myBase) local n: if myBase < 2 or not whattype(myBase/2) = integer then return(FAIL, `first input must be an even positive integer >= 2`): fi: n := myBase/2: return(isFixedPoint([n, n-1, 2*n-1, 2*n-1, n-1, n], myBase)): end: #******************************************************************************* #(k,m) is an element of [n] choose 2, f(k,m) gives corresponding 4-digit integer correspondence := proc(n,t1,t2) local inputTypes, S1, S2, b, k, m, outerDiff, innerDiff, outerPair, innerPair, d1, d2, d3, d4: ### input validation ### if t1 < t2 then #switch k and m k := t2: m := t1: else k := t1: m := t2: fi: inputTypes := {whattype(n), whattype(k), whattype(m)}: if not inputTypes = {integer} then return(FAIL, `all inputs should be integers`): elif k = m then return(FAIL, `the second and third inputs should not be the same.`): elif k > n or m > n or k <= 0 or m <= 0 then return(FAIL, `the second and third inputs should be integers between 1 and n`): fi: ### input validation ### b := 2*n + 1: S1 := {seq(n-2*i, i=0..floor(n/2)-1)}: S2 := {seq(n-(2*i+1), i=0..ceil(n/2)-2)}: if k in S1 then outerDiff := 2*m - 1: innerDiff := 2*k - 1: elif k in S2 then outerDiff := 2*k - 1: innerDiff := 2*m - 1: fi: outerPair := [(b + outerDiff)/2, (b - outerDiff)/2]: innerPair := [(b - 2 + innerDiff)/2, (b - 2 -innerDiff)/2]: if outerPair[1] mod 2 = 1 then #e.g. is odd, #d1 should be odd, d4 even d1 := outerPair[1]: d4 := outerPair[2]: else d1 := outerPair[2]: d4 := outerPair[1]: fi: if innerPair[1] mod 2 = 1 then #e.g. is odd, #d2 should be even, d3 odd d2 := innerPair[2]: d3 := innerPair[1]: else d2 := innerPair[1]: d3 := innerPair[2]: fi: return([d1,d2,d3,d4]): end: #******************************************************************************* createStatsPaper:=proc(file): if Exists(file) then return(FAIL, `file already exists`): fi: fopen(file, APPEND, TEXT): fprintf(file, "\n\n"): fprintf(file, "Summary of statistics for various lengths and bases:\n"): fprintf(file, "------------------------------------------------------"): fclose(file): print(`type addStats(, , ) to add the stats for the specified `): print(`length and base to the desired file`): end: #******************************************************************************* singleStatsPaper:=proc(theLength, theBase, theFile) local pgf, curData, orbits, longestOrbitLength, numOrbs, fileID, i, allMoms, gf, curDir, fileName, file: if Exists(theFile) then return(FAIL, `file already exists`): elif theFile = "null" then curDir := currentdir(): fileName := cat("length",theLength, "base", theBase, ".txt"): file := cat(curDir,"/", fileName): else file := theFile: fi: addStats(theLength, theBase, file): if theFile = "null" then return(file): fi: end: #******************************************************************************* addStats:=proc(theLength, theBase, file) local pgf, curData, orbits, longestOrbitLength, numOrbs, fileID, i, allMoms, gf: fopen(file, APPEND, TEXT): curData := getPGFandOrbits(theLength, theBase, x): pgf := curData[1]: orbits := curData[2]: numOrbs := nops(orbits): longestOrbitLength := getLongestOrbitLength(orbits): allMoms := [seq(moms(pgf,x,i), i=1..6)]: gf := getOrbitsGF(orbits, x): fprintf(file, "**********************************************\n"): fprintf(file, "Statistics for base %d and length %d:\n", theBase, theLength): fprintf(file, "**********************************************\n\n"): fprintf(file, "Number of limiting orbits: %d\n", numOrbs): fprintf(file, "Maximum orbit length: %d\n\n", longestOrbitLength): fprintf(file, "The entire list of limiting orbits is: \n\n"): for i from 1 to numOrbs do fprintf(file, "\t-%a\n", orbits[i]): od: fprintf(file, "\nand the corresponding generating function is: \n\t g(x) = %a\n\n", gf): fprintf(file, "\nThe pgf for number of iterations to reach a limiting orbit is: \n\t p(x) = %a\n\n", pgf): fprintf(file, "The standard moments for this pgf are %a. In particular:\n\n", allMoms): fprintf(file, "The average is: %f\n", allMoms[1]): fprintf(file, "The standard deviation is: %f\n", allMoms[2]): fprintf(file, "The skewness is: %f\n", allMoms[3]): fprintf(file, "The kurtosis is: %f\n", allMoms[4]): fprintf(file, "The fifth standard moment is: %f\n", allMoms[5]): fprintf(file, "The sixth standard moment is: %f\n", allMoms[6]): fprintf(file, "\n\n"): fclose(file): end: #******************************************************************************* getSingleStats:=proc(theLength, theBase) local pgf, curData, orbits, longestOrbitLength, numOrbs, i, allMoms, gf: curData := getPGFandOrbits(theLength, theBase, x): pgf := curData[1]: orbits := curData[2]: numOrbs := nops(orbits): longestOrbitLength := getLongestOrbitLength(orbits): allMoms := [seq(moms(pgf,x,i), i=1..6)]: gf := getOrbitsGF(orbits, x): printf("**********************************************\n"): printf("Statistics for base %d and length %d:\n", theBase, theLength): printf("**********************************************\n\n"): printf("Number of limiting orbits: %d\n", numOrbs): printf("Maximum orbit length: %d\n\n", longestOrbitLength): printf("The entire list of limiting orbits is: \n\n"): for i from 1 to numOrbs do print(orbits[i]): od: print(): printf("\t and the corresponding generating function is: \n"): print(`g(x)` = gf): printf("\nThe pgf for number of iterations to reach a limiting orbit is: \n"): print(`p(x)` = pgf): printf("The standard moments for this pgf are %a. In particular:\n\n", allMoms): printf("The average is: %f\n", allMoms[1]): printf("The standard deviation is: %f\n", allMoms[2]): printf("The skewness is: %f\n", allMoms[3]): printf("The kurtosis is: %f\n", allMoms[4]): printf("The fifth standard moment is: %f\n", allMoms[5]): printf("The sixth standard moment is: %f\n", allMoms[6]): print(): print(): end: ################################################################################ # Suplementary procedures # ################################################################################ iterate:=proc(numList, myBase) local maxNumList, minNumList, minNum, maxNum, desiredLength, res, resList, shift, adjResList, i: desiredLength := nops(numList): minNumList := sort(numList): #gives min num in base list form maxNumList := sort(numList, `>`): #gives max num in base list form resList := baseSubtract(maxNumList, minNumList, myBase): #need to ensure res is proper length, i.e. length should be the same as num1 - do not #want to truncate beginning zeros if nops(resList) < desiredLength then #add back in beginning 0s shift := desiredLength - nops(resList): adjResList := [seq(0, i=1..desiredLength)]: #keep first desiredLenth - nops(resList) entries at 0 for i from 1 to nops(resList) do adjResList[i + shift] := resList[i]: od: resList := adjResList: fi: return(resList): end: #******************************************************************************* randomAnalysis := proc(theLength, theBase, n) local i, curOrbit, orbits, cur, U, S, L, m: orbits := {}: for i from 1 to n do cur := randomEG(theLength, theBase): curOrbit := cur[3]: if not curOrbit in orbits then orbits := {op(orbits), curOrbit}: fi: od: return(orbits): end: #******************************************************************************* getAllConjectures:=proc() settingNotation(): print(): printf("*******************************************\n"): printf("* *\n"): printf("* Length 3 Theorems *\n"): printf("* *\n"): printf("*******************************************\n\n"): printf("******************************************\n"): printf("Odd-Base Theorem\n"): printf("******************************************\n\n"): theOddBaseLength3Theorems(false): printf("******************************************\n"): printf("Even-Base Theorem\n"): printf("******************************************\n\n"): theEvenBaseLength3Theorems(false): print(): printf("*******************************************\n"): printf("* *\n"): printf("* Length 4 conjecture(s) *\n"): printf("* *\n"): printf("*******************************************\n\n"): printf("******************************************\n"): printf("2-Power Conjectures\n"): printf("******************************************\n"): the2PowerLength4Conjectures(false): printf("******************************************\n"): printf("3*2-Power Conjectures\n"): printf("******************************************\n\n"): the3x2PowerLength4Conjectures(false): printf("******************************************\n"): printf("5*2-Power Theorems\n"): printf("******************************************\n\n"): the5x2PowerLength4Theorems(false): printf("******************************************\n"): printf("7*2-Power Conjectures\n"): printf("******************************************\n\n"): the7x2PowerLength4Conjectures(false): printf("******************************************\n"): printf("3-Power Conjectures\n"): printf("******************************************\n\n"): the3PowerLength4Conjectures(false): printf("******************************************\n"): printf("Odd-Base Conjecture(s)\n"): printf("******************************************\n\n"): theOddBaseLength4Conjectures(false): print(): printf("*******************************************\n"): printf("* *\n"): printf("* Length 6 Proposition *\n"): printf("* *\n"): printf("*******************************************\n\n"): printf("******************************************\n"): printf("Even-Base Proposition\n"): printf("******************************************\n\n"): theEvenBaseLength6Proposition(false): print(): printf("*******************************************\n"): printf("* *\n"): printf("* Length 7 Conjectures *\n"): printf("* *\n"): printf("*******************************************\n\n"): printf("******************************************\n"): printf("Even-Base Conjectures\n"): printf("******************************************\n\n"): theEvenBaseLength7Conjectures(false): end: #******************************************************************************* settingNotation:=proc(): printf("For a given base b and number of digits l, let N(l,b) denote the number of\n"): printf("limiting orbits occuring over all possible input numbers num with l digits\n"): printf("in base b to the iterative procedure listPhenom(num,b), and let L(l,b) denote\n"): printf("the list of lengths of each orbit, sorted in increasing order."): print(): end: #******************************************************************************* theEvenBaseLength3Theorems:=proc(includeSettingNotation): if includeSettingNotation then settingNotation(): fi: printf("For an even b >= 2, let n be the unique integer s.t. b = 2*n\n"): printf("Then we have the following theorem:"): print(): printf("Theorem: N(3,b) = 1. Specifically, L(3,b) = [1].\n"): printf("In particular, the single limiting orbit is given by [[n-1, 2*n-1, n]]."): print(): end: #******************************************************************************* theOddBaseLength3Theorems:=proc(includeSettingNotation): if includeSettingNotation then settingNotation(): fi: printf("For an odd b >= 3, let n be the unique integer s.t. b = 2*n+1.\n"): printf("Then we have the following theorem:"): print(): printf("N(3,b) = 1. Specifically, L(3,b) = [2].\n"): printf("In particular, the single limiting orbit is given by [[n-1, 2*n, n+1], [n, 2*n, n]]. "): print(): end: #******************************************************************************* theOddBaseLength4Conjectures:=proc(includeSettingNotation) local conjElementsExpr: conjElementsExpr := `{seq(seq([2*k+1, 2*i, 2*(n-i)-1, 2*(n-k)], i=0..k-1), k=1..n-1)}`: if includeSettingNotation then settingNotation(): fi: printf("For an odd b >= 5, let n be the unique integer s.t. b = 2*n+1.\n"): printf("Finally, let U be the union of all the 4-digit numbers which occur in some limiting orbit.\n"): print(): printf("Then we have the following conjectures:\n"): print(): printf("Conjecture A (Parity Conjecture): If n mod 4 = 0 or 1 then N(4,b) is even, and if n mod 4 = 2 or 3, then N(4,b) is odd.\n"): print(): printf("Conjecture B (Orbit Lengths Division Conjecture): Each integer in L(4,b) divides m.\n"): print(): printf("Conjecture C (Elements Conjecture): U = %s.\n", conjElementsExpr): print(): end: #******************************************************************************* the2PowerLength4Conjectures:=proc(includeSettingNotation): if includeSettingNotation then settingNotation(): fi: printf("For a b >= 4 which is a power of 2, let n be the unique integer s.t. b = 2^n."): printf("Then we have the following conjectures:"): print(): printf("n-even conjecture: N(4,b) = n. Specifically, writing n = 2k we have that L(4,b) = [k, k+1, seq(2k, i=1..k-1), seq(2(k+1), i=1..k-1)]."): print(): printf("n-odd conjecture: N(4,b) = n-1. Specifically, writing n = 2k+1 we have that L(4,b) = [seq(2k+1, i=1..k), seq(2(k+1)+1, i=1..k)]"): print(): end: #******************************************************************************* the3x2PowerLength4Conjectures:=proc(includeSettingNotation): if includeSettingNotation then settingNotation(): fi: printf("For a b >= 6 which is of the form b = 3*2^n, we have the following conjectures:"): print(): printf("n-even conjecture: N(4,b) = 2. Specifically, writing n = 2k we have that L(4,b) = [2k+1, 2(2k+1)]."): printf("In particular, the first orbit is generated by [2^n - 1, 3*2^n - 1, 3*2^n - 1, 2^(n+1)]"): printf("and the second orbit is generated by [2^n, 2^(n-1)-1, 5*2^(n-1) - 1, 2^(n+1)]. "): print(): printf("n-odd conjecture: N(4,b) = 1. Specifically, writing n = 2k+1 we have that L(4,b) = [6(k+1)]."): printf("In particular, the singular orbit is generated by [2^n, 2^(n-1)-1, 5*2^(n-1) - 1, 2^(n+1)]."): print(): end: #******************************************************************************* the5x2PowerLength4Theorems:=proc(includeSettingNotation) local the0mod4StringConjS, the2mod4StringConjS, oddStringConjS: the0mod4StringConjS := `[1, n+1]`: the2mod4StringConjS := `[1, 2(n+1)]`: oddStringConjS := `[1]`: if includeSettingNotation then settingNotation(): fi: printf("For a base b >= 10 which is of the form b = 5*2^n, we have the following theorems:\n"): print(): printf("n-even theorem: N(4,b) = 2. Specifically, if n mod 4 = 0 then then L(4,b) = %s.\n", the0mod4StringConjS): printf("If n mod 4 = 2 then then L(4,b) = %s.\n", the2mod4StringConjS): printf("In particular, in either case the first orbit is given by [[3*2^n, 2^n - 1, 2^(n+2) - 1, 2^(n+1)]].\n"): printf("In the case n mod 4 = 0 the second orbit is generated by [2^n - 1, 5*2^n - 1, 5*2^n - 1, 2^(n+2)].\n "): printf("and in the case n mod 4 = 2 the second orbit is generated by [2^(n+1) - 1, 5*2^n - 1, 5*2^n - 1, 3*2^n)]. "): print(): printf("n-odd theorem: N(4,b) = 1. Specifically, L(4,b) = %s.\n", oddStringConjS): printf("In particular, the singular orbit is given by [[3*2^n, 2^n - 1, 2^(n+2) - 1, 2^(n+1)]].\n"): print(): end: #******************************************************************************* the7x2PowerLength4Conjectures:=proc(includeSettingNotation) local mod0StringConjS, notMod0StringConjS: mod0StringConjS := `[3, 3k+1]`: notMod0StringConjS := `[3]`: if includeSettingNotation then settingNotation(): fi: printf("For a base b >= 14 which is of the form b = 7*2^n, we have the following conjectures:\n"): print(): printf("n mod 3 = 0 conjecture: N(4,b) = 2. Specifically, writing n = 3k we have that L(4,b) = %s.\n", mod0StringConjS): printf("In particular, the first orbit is generated by [3*2^n, 2^n - 1, 3*2^(n+1) - 1, 2^(n+2)]\n"): printf("and the second orbit is generated by [2^n-1, 7*2^n-1, 7*2^n - 1, 3*2^(n+1)]. "): print(): printf("n mod 3 nonzero conjecture: N(4,b) = 1. Specifically, L(4,b) = %s.\n", notMod0StringConjS): printf("In particular, the singular orbit is generated by [3*2^n, 2^n - 1, 3*2^(n+1) - 1, 2^(n+2)].\n"): print(): end: #******************************************************************************* the3PowerLength4Conjectures:=proc(includeSettingNotation) local stringConjS: stringConjS := `[seq(seq(3^k, i=1..3^k-1), k=1..n-1)]`: if includeSettingNotation then settingNotation(): fi: printf("For a base b >= 9 which is a power of 3, let n be the unique integer s.t. b = 3^n. \n"): printf("Then we have the following conjecture:\n"): print(): printf("Conjecture: N(4,b) = sum(3^i-1, i=1..n-1). In particular L(4,b) = %s.\n", stringConjS): print(): end: #******************************************************************************* theEvenBaseLength6Proposition:=proc(includeSettingNotation): if includeSettingNotation then # settingNotation(): don't need this additional notation for this simple proposition fi: printf("For an even b >= 2, let n be the unique integer s.t. b = 2*n\n"): printf("Then we have the following proposition:\n"): print(): printf("Proposition: %a is a fixed point under the Kaprekar function.\n", [n, n-1, 2*n-1, 2*n-1, n-1, n]): print(): end: #******************************************************************************* theEvenBaseLength7Conjectures:=proc(includeSettingNotation): if includeSettingNotation then settingNotation(): fi: printf("For an even b >= 2, we have the following conjectures:\n"): print(): printf("b mod 4 = 0 conjecture: Writing b = 4n, if n >= 6 we have that: \n"): printf("N(7,b) = 2 and L(7,b) = [1, 19].\n"): printf("In particular, length 1 orbit is given by %a,\n", [[3*n, 2*n, n-1, 4*n-1, 3*n-1,2*n-1,n]]): printf("and the length 19 orbit is generated by %a. ", [3*n-1,2*n-2,n-2,4*n-1,3*n,2*n+1,n+1 ]): print(): printf("b mod 4 = 2 conjecture: Writing b = 4n+2, if n >= 4 we have that:\n"): printf("N(7,b) = 1 and L(7,b) = [4].\n"): printf("In particular, the singular orbit is generated by %a.\n", [3*n+1, 2*n, n-2, 4*n+1, 3*n+2, 2*n+1, n+1]): print(): end: #******************************************************************************* checkOrbitLengthsDivConjecture := proc(orbits) local S, maxLength, bool: S := getOrbitLengths(orbits): maxLength := max(S): bool := checkDivList(S, maxLength): return(bool): end: #******************************************************************************* checkParityConjecture := proc(orbits, myBase) local numOrbits, bool, n, resid, conjParity, S: if myBase < 5 or whattype(myBase/2) = integer then return(FAIL, `Parity Conjecture does not apply to input base`): fi: S := getOrbitLengths(orbits): numOrbits := numelems(S): n:= (myBase-1)/2: resid := n mod 4: bool := false: if resid = 0 or resid = 1 then conjParity := 0: elif resid = 2 or resid = 3 then conjParity := 1: fi: if numOrbits mod 2 = conjParity then bool := true: fi: return(bool): end: #******************************************************************************* checkElementsConjecture := proc(orbits, myBase) local components, n, bool: if myBase < 5 or whattype(myBase/2) = integer then return(FAIL, `Elements Conjecture does not apply to input base`): fi: components := getAllElements([op(orbits)]): bool := false: n:= (myBase-1)/2: if binomial(n,2) = nops(components) then #continue, otherwise no need to continue, conjecture false. if components = conjecturedOddBaseLength4Elements(myBase) then bool := true: fi: fi: return(bool): end: #******************************************************************************* checkOddBaseLength4Conjectures:= proc(orbits, myBase) local sA, sB, sC: if myBase < 5 or whattype(myBase/2) = integer then return(FAIL, `The odd base conjectures do not apply to input base`): fi: sA := checkParityConjecture(orbits, myBase): sB := checkOrbitLengthsDivConjecture(orbits): sC := checkElementsConjecture(orbits, myBase): return(evalb(sA and sB and sC)): end: #******************************************************************************* checkOddBaseLength4ConjecturesForRS:= proc(minBase, maxBase, numTrials) local s, sA, sB, sC, numSteps, curAnalysis, i: if minBase < 5 or whattype(minBase/2) = integer then return(FAIL, `The odd base conjectures do not apply to input minimum base`): fi: numSteps := (maxBase - minBase)/2: s := [seq(randomAnalysis(4, minBase+2*i, numTrials), i = 0 .. numSteps)]: sA := [seq([minBase + 2*(i-1), checkParityConjecture(s[i], minBase + 2*(i-1))], i = 1 .. numSteps + 1)]: sB := [seq([minBase + 2*(i-1), checkOrbitLengthsDivConjecture(s[i])], i = 1 .. numSteps + 1)]: sC := [seq([minBase + 2*(i-1), checkElementsConjecture(s[i], minBase + 2*(i-1))], i = 1 .. numSteps + 1)]: return([sA, sB, sC]): end: #******************************************************************************* check2PowerLength4Conjectures := proc(orbits, myBase) local m,k, bool, conjLengths, lengths: m:=log[2](myBase): bool := false: if not whattype(m) = integer or myBase < 2^2 then return(FAIL, `second input should be a base which is a power of two which is at least 2^2`): fi: lengths := getOrbitLengths(orbits): if whattype(m/2) = integer then #even power k := m/2: conjLengths := [k, k+1, seq(2*k, i=1..k-1), seq(2*(k+1), i=1..k-1)]: else #odd power k := (m-1)/2: conjLengths := [seq(2*k+1, i=1..k), seq(2*(k+1)+1, i=1..k)]: fi: if lengths = conjLengths then bool := true: fi: return(bool): end: #******************************************************************************* check3x2PowerLength4Conjectures := proc(orbits, myBase) local n ,k, conjLengths, lengths, numOrbs, conjNumOrbs, conjGenerator1, conjGenerator2, generator1, generator2, nParity, isConjTrue: n:=log[2](myBase/3): isConjTrue := false: if not whattype(n) = integer or myBase < 3*2 then return(FAIL, `second input should be a base which is of the form 3*2^n for some integer n >= 1`): fi: lengths := sort(getOrbitLengths(orbits)): conjGenerator1 :=[2^n - 1, 3*2^n - 1, 3*2^n - 1, 2^(n+1)]: if n mod 2 = 0 then #even power k := n/2: conjLengths := [2*k+1, 2*(2*k+1)]: conjNumOrbs := 2: conjGenerator2 := [2^n, 2^(n-1)-1, 5*2^(n-1) - 1, 2^(n+1)]: else #odd power k := (n-1)/2: conjLengths := [6*(k+1)]: conjNumOrbs := 1: fi: numOrbs := nops(orbits): if n mod 2 = 0 then if nops([op(orbits)][1]) < nops([op(orbits)][2]) then #so first is smaller generator1 := [op(orbits)][1][1]: generator2 := [op(orbits)][2][1]: else generator2 := [op(orbits)][1][1]: generator1 := [op(orbits)][2][1]: fi: isConjTrue := evalb(lengths = conjLengths and generator1 = conjGenerator1 and generator2 = conjGenerator2): else #only 1 orbit generator1 := op(orbits)[1]: isConjTrue := evalb(lengths = conjLengths and generator1 = conjGenerator1): fi: return(isConjTrue): end: #******************************************************************************* check5x2PowerLength4Theorems := proc(orbits, myBase) local n, k, conjLengths, lengths, numOrbs, conjNumOrbs, conjGenerator1, conjGenerator2, generator1, generator2, isConjTrue: n:=log[2](myBase/5): isConjTrue := false: if not whattype(n) = integer or myBase < 5*2 then return(FAIL, `second input should be a base which is of the form 5*2^n for some integer n >= 1`): fi: lengths := getOrbitLengths(orbits): conjGenerator1 :=[3*2^n, 2^n - 1, 2^(n+2) - 1, 2^(n+1)]: if n mod 4 in {0,2} then k := n mod 4: conjNumOrbs := 2: if k = 0 then conjLengths := [1, n+1]: conjGenerator2 := [2^n - 1, 5*2^n - 1, 5*2^n - 1, 2^(n+2)]: else conjLengths := [1, 2*(n+1)]: conjGenerator2 := [2^(n+1) - 1, 5*2^n - 1, 5*2^n - 1, 3*2^n]: fi: else conjNumOrbs := 1: conjLengths := [1]: fi: numOrbs := nops(orbits): if n mod 2 = 0 then if nops([op(orbits)][1]) < nops([op(orbits)][2]) then #so first is smaller generator1 := [op(orbits)][1][1]: generator2 := [op(orbits)][2][1]: else generator2 := [op(orbits)][1][1]: generator1 := [op(orbits)][2][1]: fi: isConjTrue := evalb(lengths = conjLengths and generator1 = conjGenerator1 and generator2 = conjGenerator2): else #conjectured only 1 orbit generator1 := op(orbits)[1]: isConjTrue := evalb(lengths = conjLengths and generator1 = conjGenerator1): fi: return(isConjTrue): end: #******************************************************************************* check7x2PowerLength4Conjectures := proc(orbits, myBase) local n, k, conjLengths, lengths, numOrbs, conjNumOrbs, isConjTrue, conjGenerator1, conjGenerator2, generator1, generator2: n:=log[2](myBase/7): isConjTrue := false: if not whattype(n) = integer or myBase < 7*2 then return(FAIL, `second input should be a base which is of the form 7*2^n for some integer n >= 1`): fi: lengths := getOrbitLengths(orbits): conjGenerator1 := [3*2^n, 2^n - 1, 3*2^(n+1) - 1, 2^(n+2)]: if n mod 3 = 0 then k := n/3: conjLengths := [3, 3*k+1]: conjNumOrbs := 2: conjGenerator2 := [2^n-1, 7*2^n-1, 7*2^n - 1, 3*2^(n+1)]: else conjLengths := [3]: conjNumOrbs := 1: fi: numOrbs := nops(orbits): if n mod 3 = 0 then if nops([op(orbits)][1]) < nops([op(orbits)][2]) then #so first is smaller generator1 := [op(orbits)][1][1]: generator2 := [op(orbits)][2][1]: else generator2 := [op(orbits)][1][1]: generator1 := [op(orbits)][2][1]: fi: isConjTrue := evalb(lengths = conjLengths and generator1 = conjGenerator1 and generator2 = conjGenerator2): else #only 1 orbit generator1 := op(orbits)[1]: isConjTrue := evalb(lengths = conjLengths and generator1 = conjGenerator1): fi: return(isConjTrue): end: #******************************************************************************* check3PowerLength4Conjectures := proc(orbits, myBase) local n, bool, conjLengths, lengths, i: n:=log[3](myBase): bool := false: if not whattype(n) = integer or myBase < 3^2 then return(FAIL, `second input should be a base which is a power of 3 which is at least 3^2`): fi: lengths := getOrbitLengths(orbits): conjLengths := []: for i from 1 to n-1 do conjLengths := [op(conjLengths), seq(3^i, k=1..(3^i)-1)]: od: if lengths = conjLengths then bool := true: fi: return(bool): end: #******************************************************************************* checkOddBaseLength3Theorems := proc(orbits, myBase) local n, isConjTrue, conjNumOrbs, numOrbs, conjLengths, conjOrbit, lengths, i: if not myBase mod 2 = 1 then return(FAIL, `the second input (the base) should be an odd integer`): elif myBase < 3 then return(FAIL, `second input (the base) should be at least 3`): fi: n := (myBase-1)/2: conjNumOrbs := 1: conjLengths := [2]: conjOrbit :=[[n-1, 2*n, n+1], [n, 2*n, n]]: numOrbs := nops(orbits): lengths := getOrbitLengths(orbits): isConjTrue := evalb(lengths = conjLengths and orbits = {conjOrbit}): return(isConjTrue): end: #******************************************************************************* checkEvenBaseLength3Theorems := proc(orbits, myBase) local n, isConjTrue, conjNumOrbs, numOrbs, conjLengths, conjOrbit, lengths, i: if not myBase mod 2 = 0 then return(FAIL, `the second input (the base) should be an even integer`): elif myBase < 2 then return(FAIL, `second input, the base, should be at least 2`): fi: n := myBase/2: conjNumOrbs := 1: conjLengths := [1]: conjOrbit :=[[n-1, 2*n-1, n]]: numOrbs := nops(orbits): lengths := getOrbitLengths(orbits): isConjTrue := evalb(lengths = conjLengths and orbits = {conjOrbit}): return(isConjTrue): end: #******************************************************************************* checkEvenBaseLength7Conjectures := proc(orbits, myBase) local n, isConjTrue, conjNumOrbs, numOrbs, conjLengths, conjOrbit, conjGenerator1, conjGenerator2, generator1, generator2, lengths, i: if not myBase mod 2 = 0 then return(FAIL, `the second input (the base) should be an even integer`): elif myBase < 2 then return(FAIL, `second input, the base, should be at least 2`): fi: if myBase mod 4 = 0 then if myBase < 4*6 then return(FAIL, `for bases which are 0 mod 4 the base should be at least 24.`): fi: elif myBase mod 4 = 2 then if myBase < 4*4+2 then return(FAIL, `for bases which are 2 mod 4 the base should be at least 18.`): fi: fi: lengths := getOrbitLengths(orbits): numOrbs := nops(orbits): if myBase mod 4 = 0 then n := myBase/4: conjNumOrbs := 2: conjLengths := [1,19]: conjGenerator1 := [3*n, 2*n, n-1, 4*n-1, 3*n-1,2*n-1,n]: conjGenerator2 := [3*n-1,2*n-2,n-2,4*n-1,3*n,2*n+1,n+1]: else #so myBase mod 4 = 2, since base is even n := (myBase - 2)/4: conjGenerator1 := [3*n+1, 2*n, n-2, 4*n+1, 3*n+2, 2*n+1, n+1]: conjNumOrbs := 1: conjLengths := [4]: fi: if myBase mod 4 = 0 then if nops([op(orbits)][1]) < nops([op(orbits)][2]) then #so first is smaller generator1 := [op(orbits)][1][1]: generator2 := [op(orbits)][2][1]: else #so myBase mod 4 = 2, since base is even generator2 := [op(orbits)][1][1]: generator1 := [op(orbits)][2][1]: fi: isConjTrue := evalb(lengths = conjLengths and generator1 = conjGenerator1 and generator2 = conjGenerator2): else #only 1 orbit generator1 := op(orbits)[1]: isConjTrue := evalb(lengths = conjLengths and generator1 = conjGenerator1): fi: return(isConjTrue): end: #******************************************************************************* freqList := proc(intList) local intSet, x, frequencyList, cur: intSet := {op(intList)}: frequencyList:=[]: for x in intSet do cur := [x, Occurrences(x,intList)]: frequencyList:=[op(frequencyList), cur]: od: return(frequencyList): end: #******************************************************************************* getOrbitLengths := proc(orbits) local n, S, orbitList, i: orbitList := [op(orbits)]: n := numelems(orbitList): S := Array([seq(0, i=1..n)]): for i from 1 to n do S[i] := nops(orbitList[i]): od: return(convert(S,list)): end: #******************************************************************************* checkDivList := proc(integerList, m) local bool, i: bool := true: for i from 1 to numelems(integerList) do if not whattype(m/integerList[i]) = integer then bool := false: fi: od: return(bool): end: #******************************************************************************* #returns all component elements in list or set of lists #e.g. [[1,2], [3,4,5], [6,7]] would return {1,2,3,4,5,6,7} getAllElements := proc(listOfLists) local l, elements, i, j, curList: if not whattype(listOfLists) in {set, list} then return(FAIL, `input should be a set (or list) of lists`): fi: l := nops(listOfLists): elements := {}: for i from 1 to l do curList := listOfLists[i]: for j from 1 to nops(curList) do elements := {op(elements), curList[j]}: od: od: return(elements): end: #******************************************************************************* getLongestOrbitLength := proc(orbits) local orbitList, orbitLengths, largestOrbLength: orbitList := [op(orbits)]: orbitLengths := [seq(nops(orbitList[i]), i=1..nops(orbitList))]: largestOrbLength := max(orbitLengths): return(largestOrbLength): end: #******************************************************************************* lengthsWithConjectures := proc(): return({3,4,6,7}): end: #******************************************************************************* getMaxBasePC:=proc(b) local res: if b = 3 then res := 55: elif b = 4 then res := 51: elif b = 7 then res := 18: fi: end: #******************************************************************************* length3Orbits:=proc(b) local bases: bases[2] := {[[0, 1, 1]]}: bases[4] := {[[1, 3, 2]]}: bases[6] := {[[2, 5, 3]]}: bases[8] := {[[3, 7, 4]]}: bases[10] := {[[4, 9, 5]]}: bases[12] := {[[5, 11, 6]]}: bases[14] := {[[6, 13, 7]]}: bases[16] := {[[7, 15, 8]]}: bases[18] := {[[8, 17, 9]]}: bases[20] := {[[9, 19, 10]]}: bases[22] := {[[10, 21, 11]]}: bases[24] := {[[11, 23, 12]]}: bases[26] := {[[12, 25, 13]]}: bases[28] := {[[13, 27, 14]]}: bases[30] := {[[14, 29, 15]]}: bases[32] := {[[15, 31, 16]]}: bases[34] := {[[16, 33, 17]]}: bases[36] := {[[17, 35, 18]]}: bases[38] := {[[18, 37, 19]]}: bases[40] := {[[19, 39, 20]]}: bases[42] := {[[20, 41, 21]]}: bases[44] := {[[21, 43, 22]]}: bases[46] := {[[22, 45, 23]]}: bases[48] := {[[23, 47, 24]]}: bases[50] := {[[24, 49, 25]]}: bases[52] := {[[25, 51, 26]]}: bases[54] := {[[26, 53, 27]]}: bases[3] := {[[0, 2, 2], [1, 2, 1]]}: bases[5] := {[[1, 4, 3], [2, 4, 2]]}: bases[7] := {[[2, 6, 4], [3, 6, 3]]}: bases[9] := {[[3, 8, 5], [4, 8, 4]]}: bases[11] := {[[4, 10, 6], [5, 10, 5]]}: bases[13] := {[[5, 12, 7], [6, 12, 6]]}: bases[15] := {[[6, 14, 8], [7, 14, 7]]}: bases[17] := {[[7, 16, 9], [8, 16, 8]]}: bases[19] := {[[8, 18, 10], [9, 18, 9]]}: bases[21] := {[[9, 20, 11], [10, 20, 10]]}: bases[23] :={[[10, 22, 12], [11, 22, 11]]}: bases[25] := {[[11, 24, 13], [12, 24, 12]]}: bases[27] := {[[12, 26, 14], [13, 26, 13]]}: bases[29] := {[[13, 28, 15], [14, 28, 14]]}: bases[31] := {[[14, 30, 16], [15, 30, 15]]}: bases[33] := {[[15, 32, 17], [16, 32, 16]]}: bases[35] := {[[16, 34, 18], [17, 34, 17]]}: bases[37] := {[[17, 36, 19], [18, 36, 18]]}: bases[39] := {[[18, 38, 20], [19, 38, 19]]}: bases[41] := {[[19, 40, 21], [20, 40, 20]]}: bases[43] := {[[20, 42, 22], [21, 42, 21]]}: bases[45] := {[[21, 44, 23], [22, 44, 22]]}: bases[47] := {[[22, 46, 24], [23, 46, 23]]}: bases[49] := {[[23, 48, 25], [24, 48, 24]]}: bases[51] := {[[24, 50, 26], [25, 50, 25]]}: bases[53] := {[[25, 52, 27], [26, 52, 26]]}: bases[55] := {[[26, 54, 28], [27, 54, 27]]}: return(bases[b]): end: #******************************************************************************* length4Orbits:=proc(b) local bases: bases[2] := {[[0, 1, 1, 1]], [[1, 0, 0, 1]]}: bases[4] := {[[3, 0, 2, 1]], [[1, 3, 3, 2], [2, 0, 2, 2]]}: bases[6] := {[[1, 5, 5, 4], [4, 0, 4, 2], [4, 1, 3, 2], [3, 0, 4, 3], [3, 5, 5, 2], [3, 1, 3, 3]]}: bases[8] := {[[3, 0, 6, 5], [6, 1, 5, 2], [5, 2, 4, 3]], [[1, 7, 7, 6], [6, 0, 6, 2], [6, 3, 3, 2], [3, 7, 7, 4], [4, 2, 4, 4]]}: bases[10] := {[[6, 1, 7, 4]]}: bases[12] := {[[3, 11, 11, 8], [8, 2, 8, 4], [6, 3, 7, 6]], [[4, 1, 9, 8], [8, 3, 7, 4], [5, 2, 8, 7], [6, 1, 9, 6], [7, 11, 11, 4], [7, 3, 7, 5]]}: bases[14] := {[[6, 1, 11, 8], [10, 1, 11, 4], [10, 5, 7, 4]]}: bases[16] := {[[5, 2, 12, 11], [10, 5, 9, 6]], [[3, 15, 15, 12], [12, 2, 12, 4], [10, 7, 7, 6]], [[3, 0, 14, 13], [14, 9, 5, 2], [12, 3, 11, 4], [9, 6, 8, 7]], [[1, 15, 15, 14], [14, 0, 14, 2], [14, 11, 3, 2], [12, 7, 7, 4], [7, 15, 15, 8], [8, 6, 8, 8]]}: bases[18] := {[[6, 1, 15, 12], [14, 5, 11, 4], [10, 5, 11, 8]], [[10, 1, 15, 8], [14, 1, 15, 4], [14, 9, 7, 4]]}: bases[20] := {[[12, 3, 15, 8]], [[5, 2, 16, 15], [14, 9, 9, 6], [7, 19, 19, 12], [12, 6, 12, 8], [6, 3, 15, 14], [12, 7, 11, 8]]}: bases[22] := {[[6, 1, 19, 16], [18, 9, 11, 4], [14, 1, 19, 8], [18, 5, 15, 4], [14, 9, 11, 8]], [[10, 1, 19, 12], [18, 1, 19, 4], [18, 13, 7, 4], [14, 5, 15, 8], [10, 5, 15, 12]]}: bases[24] := {[[7, 23, 23, 16], [16, 6, 16, 8], [10, 7, 15, 14], [8, 3, 19, 16], [16, 7, 15, 8], [9, 6, 16, 15], [10, 5, 17, 14], [12, 3, 19, 12], [15, 23, 23, 8], [15, 7, 15, 9], [8, 5, 17, 16], [12, 7, 15, 12]]}: bases[26] := {[[10, 1, 23, 16], [22, 5, 19, 4], [18, 13, 11, 8]], [[6, 1, 23, 20], [22, 13, 11, 4], [18, 1, 23, 8], [22, 9, 15, 4], [18, 5, 19, 8], [14, 9, 15, 12]], [[10, 5, 19, 16], [14, 5, 19, 12], [14, 1, 23, 12], [22, 1, 23, 4], [22, 17, 7, 4], [18, 9, 15, 8]]}: bases[28] := {[[12, 3, 23, 16], [20, 3, 23, 8], [20, 11, 15, 8]]}: bases[30] := {[[18, 5, 23, 12]], [[10, 5, 23, 20], [18, 9, 19, 12]], [[22, 1, 27, 8], [26, 13, 15, 4]], [[6, 1, 27, 24], [26, 17, 11, 4], [22, 5, 23, 8], [18, 13, 15, 12]], [[10, 1, 27, 20], [26, 9, 19, 4], [22, 9, 19, 8], [14, 9, 19, 16]], [[14, 1, 27, 16], [26, 1, 27, 4], [26, 21, 7, 4], [22, 13, 15, 8]], [[14, 5, 23, 16], [18, 1, 27, 12], [26, 5, 23, 4], [22, 17, 11, 8]]}: bases[32] := {[[3, 0, 30, 29], [30, 25, 5, 2], [28, 19, 11, 4], [24, 7, 23, 8], [17, 14, 16, 15]], [[5, 2, 28, 27], [26, 21, 9, 6], [20, 11, 19, 12], [9, 6, 24, 23], [18, 13, 17, 14]], [[1, 31, 31, 30], [30, 0, 30, 2], [30, 27, 3, 2], [28, 23, 7, 4], [24, 15, 15, 8], [15, 31, 31, 16], [16, 14, 16, 16]], [[3, 31, 31, 28], [28, 2, 28, 4], [26, 23, 7, 6], [20, 15, 15, 12], [7, 31, 31, 24], [24, 6, 24, 8], [18, 15, 15, 14]]}: bases[34] := {[[10, 5, 27, 24], [22, 13, 19, 12]], [[26, 1, 31, 8], [30, 17, 15, 4]], [[6, 1, 31, 28], [30, 21, 11, 4], [26, 9, 23, 8], [18, 13, 19, 16]], [[10, 1, 31, 24], [30, 13, 19, 4], [26, 5, 27, 8], [22, 17, 15, 12]], [[14, 1, 31, 20], [30, 5, 27, 4], [26, 21, 11, 8], [18, 9, 23, 16]], [[14, 5, 27, 20], [22, 5, 27, 12], [22, 9, 23, 12], [14, 9, 23, 20]], [[18, 1, 31, 16], [30, 1, 31, 4], [30, 25, 7, 4], [26, 17, 15, 8]], [[18, 5, 27, 16], [22, 1, 31, 12], [30, 9, 23, 4], [26, 13, 19, 8]]}: bases[36] := {[[12, 3, 31, 24], [28, 11, 23, 8], [20, 11, 23, 16]], [[20, 3, 31, 16], [28, 3, 31, 8], [28, 19, 15, 8]]}: bases[38] := {[[6, 1, 35, 32], [34, 25, 11, 4], [30, 13, 23, 8], [22, 9, 27, 16], [18, 5, 31, 20], [26, 1, 35, 12], [34, 13, 23, 4], [30, 9, 27, 8], [22, 17, 19, 16]], [[10, 1, 35, 28], [34, 17, 19, 4], [30, 1, 35, 8], [34, 21, 15, 4], [30, 5, 31, 8], [26, 21, 15, 12], [14, 5, 31, 24], [26, 9, 27, 12], [18, 13, 23, 20]], [[10, 5, 31, 28], [26, 17, 19, 12], [14, 1, 35, 24], [34, 9, 27, 4], [30, 17, 19, 8], [22, 1, 35, 16], [34, 5, 31, 4], [30, 25, 11, 8], [22, 13, 23, 16]], [[14, 9, 27, 24], [18, 9, 27, 20], [18, 1, 35, 20], [34, 1, 35, 4], [34, 29, 7, 4], [30, 21, 15, 8], [22, 5, 31, 16], [26, 5, 31, 12], [26, 13, 23, 12]]}: bases[40] := {[[24, 7, 31, 16]]}: bases[42] := {[[14, 5, 35, 28], [30, 13, 27, 12], [18, 13, 27, 24]], [[18, 5, 35, 24], [30, 5, 35, 12], [30, 17, 23, 12]], [[26, 1, 39, 16], [38, 9, 31, 4], [34, 21, 19, 8]], [[6, 1, 39, 36], [38, 29, 11, 4], [34, 17, 23, 8], [26, 5, 35, 16], [30, 9, 31, 12], [22, 17, 23, 20]], [[10, 1, 39, 32], [38, 21, 19, 4], [34, 1, 39, 8], [38, 25, 15, 4], [34, 9, 31, 8], [26, 21, 19, 16]], [[10, 5, 35, 32], [30, 21, 19, 12], [18, 1, 39, 24], [38, 5, 35, 4], [34, 29, 11, 8], [26, 17, 23, 16]], [[14, 1, 39, 28], [38, 13, 27, 4], [34, 13, 27, 8], [26, 13, 27, 16], [14, 9, 31, 28], [22, 13, 27, 20]], [[18, 9, 31, 24], [22, 5, 35, 20], [30, 1, 39, 12], [38, 17, 23, 4], [34, 5, 35, 8], [30, 25, 15, 12]], [[22, 1, 39, 20], [38, 1, 39, 4], [38, 33, 7, 4], [34, 25, 15, 8], [26, 9, 31, 16], [22, 9, 31, 20]]}: bases[44] := {[[12, 3, 39, 32], [36, 19, 23, 8], [28, 3, 39, 16], [36, 11, 31, 8], [28, 19, 23, 16]], [[20, 3, 39, 24], [36, 3, 39, 8], [36, 27, 15, 8], [28, 11, 31, 16], [20, 11, 31, 24]]}: bases[46] := {[[6, 1, 43, 40], [42, 33, 11, 4], [38, 21, 23, 8], [30, 1, 43, 16], [42, 13, 31, 4], [38, 17, 27, 8], [30, 9, 35, 16], [26, 13, 31, 20], [18, 5, 39, 28], [34, 9, 35, 12], [26, 21, 23, 20]], [[10, 1, 43, 36], [42, 25, 19, 4], [38, 5, 39, 8], [34, 29, 15, 12], [22, 13, 31, 24], [18, 1, 43, 28], [42, 9, 35, 4], [38, 25, 19, 8], [30, 5, 39, 16], [34, 13, 31, 12], [22, 17, 27, 24]], [[10, 5, 39, 36], [34, 25, 19, 12], [22, 5, 39, 24], [34, 1, 43, 12], [42, 21, 23, 4], [38, 1, 43, 8], [42, 29, 15, 4], [38, 13, 31, 8], [30, 17, 27, 16], [14, 9, 35, 32], [26, 17, 27, 20]], [[14, 1, 43, 32], [42, 17, 27, 4], [38, 9, 35, 8], [30, 25, 19, 16], [14, 5, 39, 32], [34, 17, 27, 12], [22, 9, 35, 24], [26, 1, 43, 20], [42, 5, 39, 4], [38, 33, 11, 8], [30, 21, 23, 16]], [[18, 9, 35, 28], [26, 9, 35, 20], [26, 5, 39, 20], [34, 5, 39, 12], [34, 21, 23, 12], [22, 1, 43, 24], [42, 1, 43, 4], [42, 37, 7, 4], [38, 29, 15, 8], [30, 13, 31, 16], [18, 13, 31, 28]]}: bases[48] := {[[15, 47, 47, 32], [32, 14, 32, 16], [18, 15, 31, 30], [16, 11, 35, 32], [24, 15, 31, 24]], [[16, 7, 39, 32], [32, 15, 31, 16], [17, 14, 32, 31], [18, 13, 33, 30], [20, 11, 35, 28], [24, 7, 39, 24], [31, 47, 47, 16], [31, 15, 31, 17], [16, 13, 33, 32], [20, 15, 31, 28]]}: bases[50] := {[[30, 9, 39, 20]], [[14, 1, 47, 36], [46, 21, 27, 4], [42, 5, 43, 8], [38, 33, 15, 12], [26, 17, 31, 24]], [[6, 1, 47, 44], [46, 37, 11, 4], [42, 25, 23, 8], [34, 1, 47, 16], [46, 17, 31, 4], [42, 13, 35, 8], [34, 21, 27, 16], [18, 5, 43, 32], [38, 13, 35, 12], [26, 21, 27, 24]], [[10, 1, 47, 40], [46, 29, 19, 4], [42, 9, 39, 8], [34, 29, 19, 16], [18, 9, 39, 32], [30, 13, 35, 20], [22, 9, 39, 28], [30, 5, 43, 20], [38, 9, 39, 12], [30, 25, 23, 20]], [[10, 5, 43, 40], [38, 29, 19, 12], [26, 9, 39, 24], [30, 1, 47, 20], [46, 9, 39, 4], [42, 29, 19, 8], [34, 9, 39, 16], [30, 17, 31, 20], [14, 9, 39, 36], [30, 21, 27, 20]], [[14, 5, 43, 36], [38, 21, 27, 12], [26, 5, 43, 24], [38, 1, 47, 12], [46, 25, 23, 4], [42, 1, 47, 8], [46, 33, 15, 4], [42, 17, 31, 8], [34, 13, 35, 16], [22, 17, 31, 28]], [[18, 1, 47, 32], [46, 13, 35, 4], [42, 21, 27, 8], [34, 5, 43, 16], [38, 17, 31, 12], [26, 13, 35, 24], [22, 1, 47, 28], [46, 5, 43, 4], [42, 37, 11, 8], [34, 25, 23, 16]], [[18, 13, 35, 32], [22, 13, 35, 28], [22, 5, 43, 28], [38, 5, 43, 12], [38, 25, 23, 12], [26, 1, 47, 24], [46, 1, 47, 4], [46, 41, 7, 4], [42, 33, 15, 8], [34, 17, 31, 16]]}: bases[3] := {[[1, 0, 1, 2], [1, 2, 2, 1]]}: bases[5] := {[[3, 0, 3, 2]]}: bases[7] := {[[3, 0, 5, 4], [5, 0, 5, 2], [5, 2, 3, 2]]}: bases[9] := {[[3, 0, 7, 6], [7, 2, 5, 2], [5, 2, 5, 4]], [[5, 0, 7, 4], [7, 0, 7, 2], [7, 4, 3, 2]]}: bases[11] := {[[3, 0, 9, 8], [9, 4, 5, 2], [7, 0, 9, 4], [9, 2, 7, 2], [7, 4, 5, 4]], [[5, 0, 9, 6], [9, 0, 9, 2], [9, 6, 3, 2], [7, 2, 7, 4], [5, 2, 7, 6]]}: bases[13] := {[[5, 0, 11, 8], [11, 2, 9, 2], [9, 6, 5, 4]], [[3, 0, 11, 10], [11, 6, 5, 2],[9, 0, 11, 4], [11, 4, 7, 2], [9, 2, 9, 4], [7, 4, 7, 6]], [[5, 2, 9, 8], [7, 2, 9, 6],[7, 0, 11, 6], [11, 0, 11, 2], [11, 8, 3, 2], [9, 4, 7, 4]]}: bases[15] := {[[9, 2, 11, 6]], [[5, 2, 11, 10], [9, 4, 9, 6]], [[11, 0, 13, 4], [13, 6, 7, 2]], [[3, 0, 13, 12], [13, 8, 5, 2], [11, 2, 11, 4], [9, 6, 7, 6]], [[5, 0, 13, 10], [13, 4, 9, 2], [11, 4, 9, 4], [7, 4, 9, 8]], [[7, 0, 13, 8], [13, 0, 13, 2], [13, 10, 3, 2], [11, 6, 7, 4]], [[7, 2, 11, 8], [9, 0, 13, 6], [13, 2, 11, 2], [11, 8, 5, 4]]}: bases[17] := {[[5, 2, 13, 12], [11, 6, 9, 6]], [[13, 0, 15, 4], [15, 8, 7, 2]], [[3, 0, 15, 14], [15, 10, 5, 2], [13, 4, 11, 4], [9, 6, 9, 8]], [[5, 0, 15, 12], [15, 6, 9, 2], [13, 2, 13, 4], [11, 8, 7, 6]], [[7, 0, 15, 10], [15, 2, 13, 2], [13, 10, 5, 4], [9, 4, 11, 8]], [[7, 2, 13, 10], [11, 2, 13, 6], [11, 4, 11, 6], [7, 4, 11, 10]], [[9, 0, 15, 8], [15, 0, 15, 2], [15, 12, 3, 2], [13, 8, 7, 4]], [[9, 2, 13, 8], [11, 0, 15, 6], [15, 4, 11, 2], [13, 6, 9, 4]]}: bases[19] := {[[3, 0, 17, 16], [17, 12, 5, 2], [15, 6, 11, 4], [11, 4, 13, 8], [9, 2, 15, 10], [13, 0, 17, 6], [17, 6, 11, 2], [15, 4, 13, 4], [11, 8, 9, 8]], [[5, 0, 17, 14], [17, 8, 9, 2], [15, 0, 17, 4], [17, 10, 7, 2], [15, 2, 15, 4], [13, 10, 7, 6], [7, 2, 15, 12], [13, 4, 13, 6], [9, 6, 11, 10]], [[5, 2, 15, 14], [13, 8, 9, 6], [7, 0, 17, 12], [17, 4, 13, 2], [15, 8, 9, 4], [11, 0, 17, 8], [17, 2, 15, 2], [15, 12, 5, 4], [11, 6, 11, 8]], [[7, 4, 13, 12], [9, 4, 13, 10], [9, 0, 17, 10], [17, 0, 17, 2], [17, 14, 3, 2], [15, 10, 7, 4], [11, 2, 15, 8], [13, 2, 15, 6], [13, 6, 11, 6]]}: bases[21] := {[[7, 2, 17, 14], [15, 6, 13, 6], [9, 6, 13, 12]], [[9, 2, 17, 12], [15, 2, 17, 6], [15, 8, 11, 6]], [[13, 0, 19, 8], [19, 4, 15, 2], [17, 10, 9, 4]], [[3, 0, 19, 18], [19, 14, 5, 2], [17, 8, 11, 4], [13, 2, 17, 8], [15, 4, 15, 6], [11, 8, 11, 10]], [[5, 0, 19, 16], [19, 10, 9, 2], [17, 0, 19, 4], [19, 12, 7, 2], [17, 4, 15, 4], [13, 10, 9, 8]], [[5, 2, 17, 16], [15, 10, 9, 6], [9, 0, 19, 12], [19, 2, 17, 2], [17, 14, 5, 4], [13, 8, 11, 8]], [[7, 0, 19, 14], [19, 6, 13, 2], [17, 6, 13, 4], [13, 6, 13, 8], [7, 4, 15, 14], [11, 6, 13, 10]], [[9, 4, 15, 12], [11, 2, 17, 10], [15, 0, 19, 6], [19, 8, 11, 2], [17, 2, 17, 4], [15, 12, 7, 6]], [[11, 0, 19, 10], [19, 0, 19, 2], [19, 16, 3, 2], [17, 12, 7, 4], [13, 4, 15, 8], [11, 4, 15, 10]]}: bases[23] := {[[3, 0, 21, 20], [21, 16, 5, 2], [19, 10, 11, 4], [15, 0, 21, 8], [21, 6, 15, 2], [19, 8, 13, 4], [15, 4, 17, 8], [13, 6, 15, 10], [9, 2, 19, 14], [17, 4, 17, 6], [13, 10, 11, 10]], [[5, 0, 21, 18], [21, 12, 9, 2], [19, 2, 19, 4], [17, 14, 7, 6], [11, 6, 15, 12], [9, 0, 21, 14], [21, 4, 17, 2],[19, 12, 9, 4], [15, 2, 19, 8], [17, 6, 15, 6], [11, 8, 13, 12]], [[5, 2, 19, 18], [17, 12, 9, 6], [11, 2, 19, 12], [17, 0, 21, 6], [21, 10, 11, 2], [19, 0, 21, 4], [21, 14, 7, 2],[19, 6, 15, 4], [15, 8, 13, 8], [7, 4, 17, 16], [13, 8, 13, 10]], [[7, 0, 21, 16], [21, 8, 13, 2], [19, 4, 17, 4], [15, 12, 9, 8], [7, 2, 19, 16], [17, 8, 13, 6], [11, 4, 17, 12], [13, 0, 21, 10], [21, 2, 19, 2], [19, 16, 5, 4], [15, 10, 11, 8]], [[9, 4, 17, 14], [13, 4, 17, 10], [13, 2, 19, 10], [17, 2, 19, 6], [17, 10, 11, 6], [11, 0, 21, 12], [21, 0, 21, 2],[21, 18, 3, 2], [19, 14, 7, 4], [15, 6, 15, 8], [9, 6, 15, 14]]}: bases[25] := {[[15, 4, 19, 10]], [[7, 0, 23, 18], [23, 10, 13, 2], [21, 2, 21, 4], [19, 16, 7, 6], [13, 8, 15, 12]], [[3, 0, 23, 22], [23, 18, 5, 2], [21, 12, 11, 4], [17, 0, 23, 8], [23, 8, 15, 2], [21, 6, 17, 4], [17, 10, 13, 8], [9, 2, 21, 16], [19, 6, 17, 6], [13, 10, 13, 12]], [[5, 0, 23, 20], [23, 14, 9, 2], [21, 4, 19, 4], [17, 14, 9, 8], [9, 4, 19, 16], [15, 6, 17, 10], [11, 4, 19, 14], [15, 2, 21, 10], [19, 4, 19, 6], [15, 12, 11, 10]], [[5, 2, 21, 20], [19, 14, 9, 6], [13, 4, 19, 12], [15, 0, 23, 10], [23, 4, 19, 2], [21, 14, 9, 4], [17, 4, 19, 8], [15, 8, 15, 10], [7, 4, 19, 18], [15, 10, 13, 10]], [[7, 2, 21, 18], [19, 10, 13, 6], [13, 2, 21, 12], [19, 0, 23, 6], [23, 12, 11, 2], [21, 0, 23, 4], [23, 16, 7, 2], [21, 8, 15, 4], [17, 6, 17, 8], [11, 8, 15, 14]], [[9, 0, 23, 16], [23, 6, 17, 2], [21, 10, 13, 4], [17, 2, 21, 8], [19, 8, 15, 6], [13, 6, 17, 12], [11, 0, 23, 14], [23, 2, 21, 2], [21, 18, 5, 4], [17, 12, 11, 8]], [[9, 6, 17, 16], [11, 6, 17, 14], [11, 2, 21, 14], [19, 2, 21, 6], [19, 12, 11, 6], [13, 0, 23, 12], [23, 0, 23, 2], [23, 20, 3, 2], [21, 16, 7, 4], [17, 8, 15, 8]]}: bases[27] := {[[9, 2, 23, 18], [21, 8, 17, 6], [15, 8, 17, 12]], [[15, 2, 23, 12], [21, 2, 23, 6], [21, 14, 11, 6]], [[3, 0, 25, 24], [25, 20, 5, 2], [23, 14, 11, 4], [19, 2, 23, 8], [21, 10, 15, 6], [15, 4, 21, 12], [17, 2, 23, 10], [21, 6, 19, 6], [15, 12, 13, 12]], [[5, 0, 25, 22], [25, 16, 9, 2], [23, 6, 19, 4], [19, 12, 13, 8], [11, 0, 25, 16], [25, 4, 21, 2], [23, 16, 9, 4], [19, 6, 19, 8], [13, 10, 15, 14]], [[5, 2, 23, 22], [21, 16, 9, 6], [15, 6, 19, 12], [13, 2, 23, 14], [21, 0, 25, 6], [25, 14, 11, 2], [23, 2, 23, 4], [21, 18, 7, 6], [15, 10, 15, 12]], [[7, 0, 25, 20], [25, 12, 13, 2], [23, 0, 25, 4], [25, 18, 7, 2], [23, 10, 15, 4], [19, 4, 21, 8], [17, 10, 15, 10], [7, 4, 21, 20], [17, 12, 13, 10]], [[7, 2, 23, 20], [21, 12, 13, 6], [15, 0, 25, 12], [25, 2, 23, 2], [23, 20, 5, 4], [19, 14, 11, 8], [11, 2, 23, 16], [21, 4, 21, 6], [17, 14, 11, 10]], [[9, 0, 25, 18], [25, 8, 17, 2], [23, 8, 17, 4], [19, 8, 17, 8], [11, 8, 17, 16], [9, 4, 21, 18], [17, 8, 17, 10], [9, 6, 19, 18], [13, 8, 17, 14]], [[11, 4, 21, 16], [17, 4, 21, 10], [17, 6, 19, 10], [13, 6, 19, 14], [13, 0, 25, 14], [25, 0, 25, 2], [25, 22, 3, 2], [23, 18, 7, 4], [19, 10, 15, 8]], [[11, 6, 19, 16], [13, 4, 21, 14], [17, 0, 25, 10], [25, 6, 19, 2], [23, 12, 13, 4], [19, 0, 25, 8], [25, 10, 15, 2], [23, 4, 21, 4], [19, 16, 9, 8]]}: bases[29] := {[[7, 2, 25, 22], [23, 14, 13, 6], [17, 0, 27, 12], [27, 4, 23, 2], [25, 18, 9, 4], [21, 8, 19, 8], [13, 10, 17, 16]], [[3, 0, 27, 26], [27, 22, 5, 2], [25, 16, 11, 4], [21, 4, 23, 8], [19, 12, 15, 10], [9, 2, 25, 20], [23, 10, 17, 6], [17, 6, 21, 12], [15, 4, 23, 14], [19, 0, 27, 10], [27, 8, 19, 2], [25, 10, 17, 4], [21, 6, 21, 8], [15, 12, 15, 14]], [[5, 0, 27, 24], [27, 18, 9, 2], [25, 8, 19, 4], [21, 10, 17, 8], [13, 6, 21, 16], [15, 2, 25, 14], [23, 0, 27, 6], [27, 16, 11, 2], [25, 4, 23, 4], [21, 18, 9, 8], [13, 8, 19, 16], [11, 2, 25, 18], [23, 6, 21, 6], [17, 14, 13, 12]], [[5, 2, 25, 24], [23, 18, 9, 6], [17, 8, 19, 12], [11, 4, 23, 18], [19, 6, 21, 10], [15, 8, 19, 14], [11, 0, 27, 18], [27, 6, 21, 2], [25, 14, 13, 4], [21, 0, 27, 8], [27, 12, 15, 2], [25, 2, 25, 4], [23, 20, 7, 6], [17, 12, 15, 12]], [[7, 0, 27, 22], [27, 14, 13, 2], [25, 0, 27, 4], [27, 20, 7, 2], [25, 12, 15, 4], [21, 2, 25, 8], [23, 12, 15, 6], [17, 2, 25, 12], [23, 4, 23, 6], [19, 16, 11, 10], [9, 4, 23, 20], [19, 10, 17, 10], [9, 6, 21, 20], [15, 10, 17, 14]], [[7, 4, 23, 22], [19, 14, 13, 10], [9, 0, 27, 20], [27, 10, 17, 2], [25, 6, 21, 4], [21, 14, 13, 8], [13, 0, 27, 16], [27, 2, 25, 2], [25, 22, 5, 4], [21, 16, 11, 8], [13, 4, 23, 16], [19, 2, 25, 10], [23, 8, 19, 6], [17, 10, 17, 12]], [[11, 6, 21, 18], [15, 6, 21, 14], [15, 0, 27, 14], [27, 0, 27, 2], [27, 24, 3, 2], [25, 20, 7, 4], [21, 12, 15, 8], [13, 2, 25, 16], [23, 2, 25, 6], [23, 16, 11, 6], [17, 4, 23, 12], [19, 4, 23, 10], [19, 8, 19, 10], [11, 8, 19, 18]]}: bases[31] := {[[3, 0, 29, 28], [29, 24, 5, 2], [27, 18, 11, 4], [23, 6, 23, 8], [17, 14, 15, 14]], [[5, 0, 29, 26], [29, 20, 9, 2], [27, 10, 19, 4], [23, 8, 21, 8], [15, 12, 17, 16]], [[5, 2, 27, 26], [25, 20, 9, 6], [19, 10, 19, 12], [9, 6, 23, 22], [17, 12, 17, 14]], [[7, 0, 29, 24], [29, 16, 13, 2], [27, 2, 27, 4], [25, 22, 7, 6], [19, 14, 15, 12]], [[7, 2, 27, 24], [25, 16, 13, 6], [19, 2, 27, 12], [25, 6, 23, 6], [19, 16, 13, 12]], [[7, 4, 25, 24], [21, 16, 13, 10], [11, 2, 27, 20], [25, 8, 21, 6], [19, 12, 17, 12]], [[9, 0, 29, 22], [29, 12, 17, 2], [27, 4, 25, 4], [23, 20, 9, 8], [15, 10, 19, 16]], [[9, 2, 27, 22], [25, 12, 17, 6], [19, 4, 25, 12], [21, 6, 23, 10], [17, 10, 19, 14]], [[9, 4, 25, 22], [21, 12, 17, 10], [11, 4, 25, 20], [21, 8, 21, 10], [13, 10, 19, 18]], [[11, 0, 29, 20], [29, 8, 21, 2], [27, 12, 17, 4], [23, 4, 25, 8], [21, 14, 15, 10]], [[11, 6, 23, 20], [17, 8, 21, 14], [13, 2, 27, 18], [25, 4, 25, 6], [21, 18, 11, 10]], [[11, 8, 21, 20], [13, 8, 21, 18], [13, 4, 25, 18], [21, 4, 25, 10], [21, 10, 19, 10]], [[13, 0, 29, 18], [29, 4, 25, 2], [27, 20, 9, 4], [23, 10, 19, 8], [15, 8, 21, 16]], [[13, 6, 23, 18], [17, 4, 25, 14], [21, 2, 27, 10], [25, 10, 19, 6], [19, 8, 21, 12]], [[15, 0, 29, 16], [29, 0, 29, 2], [29, 26, 3, 2], [27, 22, 7, 4], [23, 14, 15, 8]], [[15, 2, 27, 16], [25, 0, 29, 6], [29, 18, 11, 2], [27, 6, 23, 4], [23, 16, 13, 8]], [[15, 4, 25, 16], [21, 0, 29, 10], [29, 10, 19, 2], [27, 8, 21, 4], [23, 12, 17, 8]], [[15, 6, 23, 16], [17, 0, 29, 14], [29, 2, 27, 2], [27, 24, 5, 4], [23, 18, 11, 8]], [[17, 2, 27, 14], [25, 2, 27, 6], [25, 18, 11, 6], [19, 6, 23, 12], [17, 6, 23, 14]], [[19, 0, 29, 12], [29, 6, 23, 2], [27, 16, 13, 4], [23, 2, 27, 8], [25, 14, 15, 6]], [[23, 0, 29, 8], [29, 14, 15, 2], [27, 0, 29, 4], [29, 22, 7, 2], [27, 14, 15, 4]]}: bases[33] := {[[3, 0, 31, 30], [31, 26, 5, 2], [29, 20, 11, 4], [25, 8, 23, 8], [17, 14, 17, 16]], [[5, 0, 31, 28], [31, 22, 9, 2], [29, 12, 19, 4], [25, 6, 25, 8], [19, 16, 15, 14]], [[5, 2, 29, 28], [27, 22, 9, 6], [21, 12, 19, 12], [9, 6, 25, 24], [19, 14, 17, 14]], [[7, 0, 31, 26], [31, 18, 13, 2], [29, 4, 27, 4], [25, 22, 9, 8], [17, 12, 19, 16]], [[7, 2, 29, 26], [27, 18, 13, 6], [21, 4, 27, 12], [23, 8, 23, 10], [15, 12, 19, 18]], [[7, 4, 27, 26], [23, 18, 13, 10], [13, 4, 27, 20], [23, 6, 25, 10], [19, 12, 19, 14]], [[9, 0, 31, 24], [31, 14, 17, 2], [29, 2, 29, 4], [27, 24, 7, 6], [21, 16, 15, 12]], [[9, 2, 29, 24], [27, 14, 17, 6], [21, 2, 29, 12], [27, 8, 23, 6], [21, 14, 17, 12]], [[9, 4, 27, 24], [23, 14, 17, 10], [13, 2, 29, 20], [27, 6, 25, 6], [21, 18, 13, 12]], [[11, 0, 31, 22], [31, 10, 21, 2], [29, 10, 21, 4], [25, 10, 21, 8], [17, 10, 21, 16]], [[11, 2, 29, 22], [27, 10, 21, 6], [21, 10, 21, 12], [11, 8, 23, 22], [15, 10, 21, 18]], [[11, 4, 27, 22], [23, 10, 21, 10], [13, 10, 21, 20], [11, 6, 25, 22], [19, 10, 21, 14]], [[13, 0, 31, 20], [31, 6, 25, 2], [29, 18, 13, 4], [25, 4, 27, 8], [23, 16, 15, 10]], [[13, 6, 25, 20], [19, 6, 25, 14], [19, 4, 27, 14], [23, 4, 27, 10], [23, 12, 19, 10]], [[13, 8, 23, 20], [15, 6, 25, 18], [19, 2, 29, 14], [27, 4, 27, 6], [23, 20, 11, 10]], [[15, 0, 31, 18], [31, 2, 29, 2], [29, 26, 5, 4], [25, 20, 11, 8], [17, 8, 23, 16]], [[15, 2, 29, 18], [27, 2, 29, 6], [27, 20, 11, 6], [21, 8, 23, 12], [15, 8, 23, 18]], [[15, 4, 27, 18], [23, 2, 29, 10], [27, 12, 19, 6], [21, 6, 25, 12], [19, 8, 23, 14]], [[17, 0, 31, 16], [31, 0, 31, 2], [31, 28, 3, 2], [29, 24, 7, 4], [25, 16, 15, 8]], [[17, 2, 29, 16], [27, 0, 31, 6], [31, 20, 11, 2], [29, 8, 23, 4], [25, 14, 17, 8]], [[17, 4, 27, 16], [23, 0, 31, 10], [31, 12, 19, 2], [29, 6, 25, 4], [25, 18, 13, 8]], [[17, 6, 25, 16], [19, 0, 31, 14], [31, 4, 27, 2], [29, 22, 9, 4], [25, 12, 19, 8]], [[21, 0, 31, 12], [31, 8, 23, 2], [29, 14, 17, 4], [25, 2, 29, 8], [27, 16, 15, 6]], [[25, 0, 31, 8],[31, 16, 15, 2], [29, 0, 31, 4], [31, 24, 7, 2], [29, 16, 15, 4]]}: bases[35] := {[[21, 6, 27, 14]], [[15, 4, 29, 20], [25, 4, 29, 10], [25, 14, 19, 10]], [[7, 4, 29, 28], [25, 20, 13, 10], [15, 6, 27, 20], [21, 4, 29, 14], [25, 6, 27, 10], [21, 14, 19, 14]], [[17, 2, 31, 18], [29, 0, 33, 6], [33, 22, 11, 2], [31, 10, 23, 4], [27, 12, 21, 8], [19, 8, 25, 16]], [[3, 0, 33, 32], [33, 28, 5, 2], [31, 22, 11, 4], [27, 10, 23, 8], [19, 12, 21, 16], [9, 2, 31, 26], [29, 16, 17, 6], [23, 0, 33, 12], [33, 10, 23, 2], [31, 12, 21, 4], [27, 8, 25, 8], [19, 16, 17, 16]], [[5, 0, 33, 30], [33, 24, 9, 2], [31, 14, 19, 4], [27, 4, 29, 8], [25, 18, 15, 10], [15, 2, 31, 20], [29, 4, 29, 6], [25, 22, 11, 10], [15, 10, 23, 20], [13, 4, 29, 22], [25, 8, 25, 10], [17, 14, 19, 18]], [[5, 2, 31, 30], [29, 24, 9, 6], [23, 14, 19, 12], [11, 4, 29, 24], [25, 12, 21, 10], [15, 8, 25, 20], [17, 4, 29, 18], [25, 0, 33, 10], [33, 14, 19, 2], [31, 4, 29, 4], [27, 24, 9, 8], [19, 14, 19, 16]], [[7, 0, 33, 28], [33, 20, 13, 2], [31, 6, 27, 4], [27, 20, 13, 8], [19, 6, 27, 16], [21, 2, 31, 14], [29, 6, 27, 6], [23, 20, 13, 12], [11, 6, 27, 24], [21, 12, 21, 14], [9, 6, 27, 26], [21, 16, 17, 14]], [[7, 2, 31, 28], [29, 20, 13, 6], [23, 6, 27, 12], [21, 10, 23, 14], [13, 6, 27, 22], [21, 8, 25, 14], [17, 6, 27, 18],[21, 0, 33, 14], [33, 6, 27, 2], [31, 20, 13, 4], [27, 6, 27, 8], [21, 18, 15, 14]], [[9, 0, 33, 26], [33, 16, 17, 2], [31, 0, 33, 4], [33, 26, 7, 2], [31, 18, 15, 4], [27, 2, 31, 8], [29, 18, 15, 6], [23, 2, 31, 12], [29, 10, 23, 6], [23, 12, 21, 12], [11, 8, 25, 24], [17, 12, 21, 18]], [[9, 4, 29, 26], [25, 16, 17, 10], [15, 0, 33, 20], [33, 4, 29, 2], [31, 24, 9, 4], [27, 14, 19, 8], [19, 4, 29, 16], [25, 2, 31, 10], [29, 14, 19, 6], [23, 4, 29, 12], [25, 10, 23, 10], [15, 12, 21, 20]], [[11, 0, 33, 24], [33, 12, 21, 2], [31, 8, 25, 4], [27, 16, 17, 8], [19, 0, 33, 16], [33, 2, 31, 2], [31, 28, 5, 4], [27, 22, 11, 8], [19, 10, 23, 16], [13, 2, 31, 22], [29, 8, 25, 6], [23, 16, 17, 12]], [[11, 2, 31, 24], [29, 12, 21, 6], [23, 8, 25, 12], [17, 10, 23, 18], [13, 0, 33, 22], [33, 8, 25, 2], [31, 16, 17, 4], [27, 0, 33, 8], [33, 18, 15, 2], [31, 2, 31, 4], [29, 26, 7, 6], [23, 18, 15, 12]], [[13, 8, 25, 22], [17, 8, 25, 18], [17, 0, 33, 18], [33, 0, 33, 2], [33, 30, 3, 2], [31, 26, 7, 4], [27, 18, 15, 8], [19, 2, 31, 16], [29, 2, 31, 6], [29, 22, 11, 6], [23, 10, 23, 12], [13, 10, 23, 22]]}: bases[37] := {[[7, 4, 31, 30], [27, 22, 13, 10], [17, 8, 27, 20], [19, 2, 33, 18], [31, 0, 35, 6], [35, 24, 11, 2], [33, 12, 23, 4], [29, 10, 25, 8], [21, 14, 21, 16]], [[3, 0, 35, 34], [35, 30, 5, 2], [33, 24, 11, 4], [29, 12, 23, 8], [21, 10, 25, 16], [15, 4, 31, 22], [27, 6, 29, 10], [23, 16, 19, 14], [9, 2, 33, 28], [31, 18, 17, 6], [25, 0, 35, 12], [35, 12, 23, 2], [33, 10, 25, 4], [29, 14, 21, 8], [21, 6, 29, 16], [23, 4, 31, 14], [27, 8, 27, 10], [19, 16, 19, 18]], [[5, 0, 35, 32], [35, 26, 9, 2], [33, 16, 19, 4], [29, 2, 33, 8], [31, 20, 15, 6], [25, 4, 31, 12], [27, 12, 23, 10], [17, 10, 25, 20], [15, 2, 33, 22], [31, 6, 29, 6], [25, 22, 13, 12], [13, 8, 27, 24], [19, 10, 25, 18], [15, 0, 35, 22], [35, 6, 29, 2], [33, 22, 13, 4], [29, 8, 27, 8], [21, 18, 17, 16]], [[5, 2, 33, 32], [31, 26, 9, 6], [25, 16, 19, 12], [13, 2, 33, 24], [31, 10, 25, 6], [25, 14, 21, 12], [13, 6, 29, 24], [23, 10, 25, 14], [15, 8, 27, 22], [19, 6, 29, 18], [23, 0, 35, 14], [35, 8, 27, 2], [33, 18, 17, 4], [29, 0, 35, 8], [35, 20, 15, 2], [33, 4, 31, 4], [29, 26, 9, 8], [21, 16, 19, 16]], [[7, 0, 35, 30], [35, 22, 13, 2], [33, 8, 27, 4], [29, 18, 17, 8], [21, 0, 35, 16], [35, 4, 31, 2], [33, 26, 9, 4], [29, 16, 19, 8], [21, 2, 33, 16], [31, 4, 31, 6], [27, 24, 11, 10], [17, 12, 23, 20], [11, 2, 33, 26], [31, 14, 21, 6], [25, 6, 29, 12], [23, 12, 23, 14], [11, 8, 27, 26], [19, 14, 21, 18]], [[7, 2, 33, 30], [31, 22, 13, 6], [25, 8, 27, 12], [19, 12, 23, 18], [11, 0, 35, 26], [35, 14, 21, 2], [33, 6, 29, 4], [29, 22, 13, 8], [21, 8, 27, 16], [19, 4, 31, 18], [27, 0, 35, 10], [35, 16, 19, 2], [33, 2, 33, 4], [31, 28, 7, 6], [25, 20, 15, 12], [13, 4, 31, 24], [27, 10, 25, 10], [17, 14, 21, 20]], [[9, 0, 35, 28], [35, 18, 17, 2], [33, 0, 35, 4], [35, 28, 7, 2], [33, 20, 15, 4], [29, 4, 31, 8], [27, 20, 15, 10], [17, 4, 31, 20], [27, 2, 33, 10], [31, 16, 19, 6], [25, 2, 33, 12], [31, 12, 23, 6], [25, 10, 25, 12], [15, 12, 23, 22], [11, 6, 29, 26], [23, 14, 21, 14], [9, 6, 29, 28], [23, 18, 17, 14]], [[9, 4, 31, 28], [27, 18, 17, 10], [17, 0, 35, 20], [35, 2, 33, 2], [33, 30, 5, 4], [29, 24, 11, 8], [21, 12, 23, 16], [11, 4, 31, 26], [27, 14, 21, 10], [17, 6, 29, 20], [23, 2, 33, 14], [31, 8, 27, 6], [25, 18, 17, 12], [13, 0, 35, 24], [35, 10, 25, 2], [33, 14, 21, 4], [29, 6, 29, 8], [23, 20, 15, 14]], [[13, 10, 25, 24], [15, 10, 25, 22], [15, 6, 29, 22], [23, 6, 29, 14], [23, 8, 27, 14], [19, 8, 27, 18], [19, 0, 35, 18], [35, 0, 35, 2], [35, 32, 3, 2], [33, 28, 7, 4], [29, 20, 15, 8], [21, 4, 31, 16], [27, 4, 31, 10], [27, 16, 19, 10], [17, 2, 33, 20], [31, 2, 33, 6], [31, 24, 11, 6], [25, 12, 23, 12]]}: bases[39] := {[[15, 2, 35, 24], [33, 8, 29, 6], [27, 20, 17, 12]], [[9, 2, 35, 30], [33, 20, 17, 6], [27, 2, 35, 12], [33, 14, 23, 6], [27, 8, 29, 12], [21, 14, 23, 18]], [[13, 2, 35, 26], [33, 12, 25, 6], [27, 12, 25, 12], [15, 12, 25, 24], [13, 8, 29, 26], [21, 12, 25, 18]], [[15, 8, 29, 24], [21, 8, 29, 18], [21, 2, 35, 18], [33, 2, 35, 6], [33, 26, 11, 6], [27, 14, 23, 12]], [[19, 6, 31, 20], [25, 0, 37, 14], [37, 10, 27, 2], [35, 16, 21, 4], [31, 4, 33, 8], [29, 22, 15, 10]], [[3, 0, 37, 36], [37, 32, 5, 2], [35, 26, 11, 4], [31, 14, 23, 8], [23, 8, 29, 16], [21, 6, 31, 18], [25, 2, 35, 14], [33, 10, 27, 6], [27, 16, 21, 12], [15, 4, 33, 24], [29, 8, 29, 10], [21, 18, 19, 18]], [[5, 0, 37, 34], [37, 28, 9, 2], [35, 18, 19, 4], [31, 0, 37, 8], [37, 22, 15, 2], [35, 6, 31, 4], [31, 24, 13, 8], [23, 10, 27, 16], [17, 6, 31, 22], [25, 4, 33, 14], [29, 10, 27, 10], [19, 16, 21, 20]], [[5, 2, 35, 34], [33, 28, 9, 6], [27, 18, 19, 12], [15, 0, 37, 24], [37, 8, 29, 2], [35, 20, 17, 4], [31, 2, 35, 8], [33, 22, 15, 6], [27, 6, 31, 12], [25, 14, 23, 14], [11, 8, 29, 28], [21, 16, 21, 18]], [[7, 0, 37, 32], [37, 24, 13, 2], [35, 10, 27, 4], [31, 16, 21, 8], [23, 4, 33, 16], [29, 6, 31, 10], [25, 18, 19, 14], [11, 0, 37, 28], [37, 16, 21, 2], [35, 4, 33, 4], [31, 28, 9, 8], [23, 18, 19, 16]], [[7, 2, 35, 32], [33, 24, 13, 6], [27, 10, 27, 12], [17, 14, 23, 22], [9, 4, 33, 30], [29, 20, 17, 10], [19, 2, 35, 20], [33, 0, 37, 6], [37, 26, 11, 2], [35, 14, 23, 4], [31, 8, 29, 8], [23, 20, 17, 16]], [[7, 4, 33, 32], [29, 24, 13, 10], [19, 10, 27, 20], [17, 0, 37, 22], [37, 4, 33, 2], [35, 28, 9, 4], [31, 18, 19, 8], [23, 0, 37, 16], [37, 6, 31, 2], [35, 24, 13, 4], [31, 10, 27, 8], [23, 16, 21, 16]], [[9, 0, 37, 30], [37, 20, 17, 2], [35, 2, 35, 4], [33, 30, 7, 6], [27, 22, 15, 12], [15, 6, 31, 24], [25, 8, 29, 14], [21, 10, 27, 18], [17, 2, 35, 22], [33, 4, 33, 6], [29, 26, 11, 10], [19, 14, 23, 20]], [[9, 6, 31, 30], [25, 20, 17, 14], [11, 2, 35, 28], [33, 16, 21, 6], [27, 4, 33, 12], [29, 14, 23, 10], [19, 8, 29, 20], [21, 0, 37, 18], [37, 2, 35, 2], [35, 32, 5, 4], [31, 26, 11, 8], [23, 14, 23, 16]], [[11, 4, 33, 28], [29, 16, 21, 10], [19, 4, 33, 20], [29, 0, 37, 10], [37, 18, 19, 2], [35, 0, 37, 4], [37, 30, 7, 2], [35, 22, 15, 4], [31, 6, 31, 8], [25, 22, 15, 14], [11, 6, 31, 28], [25, 16, 21, 14]], [[13, 0, 37, 26], [37, 12, 25, 2], [35, 12, 25, 4], [31, 12, 25, 8], [23, 12, 25, 16], [13, 6, 31, 26], [25, 12, 25, 14], [13, 10, 27, 26], [17, 12, 25, 22], [13, 4, 33, 26], [29, 12, 25, 10], [19, 12, 25, 20]], [[15, 10, 27, 24], [17, 8, 29, 22], [21, 4, 33, 18], [29, 2, 35, 10], [33, 18, 19, 6], [27, 0, 37, 12], [37, 14, 23, 2], [35, 8, 29, 4], [31, 20, 17, 8], [23, 2, 35, 16], [33, 6, 31, 6], [27, 24, 13, 12]], [[17, 4, 33, 22], [29, 4, 33, 10], [29, 18, 19, 10], [19, 0, 37, 20], [37, 0, 37, 2], [37, 34, 3, 2], [35, 30, 7, 4], [31, 22, 15, 8], [23, 6, 31, 16], [25, 6, 31, 14], [25, 10, 27, 14], [17, 10, 27, 22]]}: bases[41] := {[[9, 0, 39, 32], [39, 22, 17, 2], [37, 4, 35, 4], [33, 30, 9, 8], [25, 20, 19, 16]], [[17, 10, 29, 24], [19, 6, 33, 22], [27, 2, 37, 14], [35, 12, 27, 6], [29, 14, 25, 12]], [[3, 0, 39, 38], [39, 34, 5, 2], [37, 28, 11, 4], [33, 16, 23, 8], [25, 6, 33, 16], [27, 8, 31, 14], [23, 12, 27, 18], [15, 4, 35, 26], [31, 10, 29, 10], [21, 18, 21, 20]], [[5, 0, 39, 36], [39, 30, 9, 2], [37, 20, 19, 4], [33, 0, 39, 8], [39, 24, 15, 2], [37, 8, 31, 4], [33, 22, 17, 8], [25, 4, 35, 16], [31, 8, 31, 10], [23, 20, 19, 18]], [[5, 2, 37, 36], [35, 30, 9, 6], [29, 20, 19, 12], [17, 0, 39, 24], [39, 6, 33, 2], [37, 26, 13, 4], [33, 12, 27, 8], [25, 14, 25, 16], [11, 8, 31, 30], [23, 18, 21, 18]], [[7, 0, 39, 34], [39, 26, 13, 2], [37, 12, 27, 4], [33, 14, 25, 8], [25, 10, 29, 16], [19, 8, 31, 22], [23, 2, 37, 18], [35, 4, 35, 6], [31, 28, 11, 10], [21, 16, 23, 20]], [[7, 2, 37, 34], [35, 26, 13, 6], [29, 12, 27, 12], [17, 14, 25, 24], [11, 6, 33, 30], [27, 18, 21, 14], [13, 2, 37, 28], [35, 14, 25, 6], [29, 10, 29, 12], [19, 16, 23, 22]], [[7, 4, 35, 34], [31, 26, 13, 10], [21, 12, 27, 20], [15, 0, 39, 26], [39, 10, 29, 2], [37, 18, 21, 4], [33, 2, 37, 8], [35, 24, 15, 6], [29, 8, 31, 12], [23, 16, 23, 18]], [[9, 2, 37, 32], [35, 22, 17, 6], [29, 4, 35, 12], [31, 16, 23, 10], [21, 6, 33, 20], [27, 0, 39, 14], [39, 12, 27, 2], [37, 14, 25, 4], [33, 10, 29, 8], [25, 18, 21, 16]], [[9, 4, 35, 32], [31, 22, 17, 10], [21, 4, 35, 20], [31, 0, 39, 10], [39, 20, 19, 2], [37, 0, 39, 4], [39, 32, 7, 2], [37, 24, 15, 4], [33, 8, 31, 8], [25, 22, 17, 16]], [[9, 6, 33, 32], [27, 22, 17, 14], [13, 4, 35, 28], [31, 14, 25, 10], [21, 10, 29, 20], [19, 0, 39, 22], [39, 2, 37, 2], [37, 34, 5, 4], [33, 28, 11, 8], [25, 16, 23, 16]], [[11, 0, 39, 30], [39, 18, 21, 2], [37, 2, 37, 4], [35, 32, 7, 6], [29, 24, 15, 12], [17, 8, 31, 24], [23, 6, 33, 18], [27, 4, 35, 14], [31, 12, 27, 10], [21, 14, 25, 20]], [[11, 2, 37, 30], [35, 18, 21, 6], [29, 2, 37, 12], [35, 16, 23, 6], [29, 6, 33, 12], [27, 16, 23, 14], [13, 6, 33, 28], [27, 14, 25, 14], [13, 10, 29, 28], [19, 14, 25, 22]], [[11, 4, 35, 30], [31, 18, 21, 10], [21, 2, 37, 20], [35, 0, 39, 6], [39, 28, 11, 2], [37, 16, 23, 4], [33, 6, 33, 8], [27, 24, 15, 14], [13, 8, 31, 28], [23, 14, 25, 18]], [[13, 0, 39, 28], [39, 14, 25, 2], [37, 10, 29, 4], [33, 18, 21, 8], [25, 2, 37, 16], [35, 8, 31, 6], [29, 22, 17, 12], [17, 4, 35, 24], [31, 6, 33, 10], [27, 20, 19, 14]], [[15, 2, 37, 26], [35, 10, 29, 6], [29, 18, 21, 12], [17, 2, 37, 24], [35, 6, 33, 6], [29, 26, 13, 12], [17, 12, 27, 24], [15, 6, 33, 26], [27, 10, 29, 14], [19, 12, 27, 22]], [[15, 8, 31, 26], [23, 10, 29, 18], [19, 4, 35, 22], [31, 2, 37, 10], [35, 20, 19, 6], [29, 0, 39, 12], [39, 16, 23, 2], [37, 6, 33, 4], [33, 26, 13, 8], [25, 12, 27, 16]], [[15, 10, 29, 26], [19, 10, 29, 22], [19, 2, 37, 22], [35, 2, 37, 6], [35, 28, 11, 6], [29, 16, 23, 12], [17, 6, 33, 24], [27, 6, 33, 14], [27, 12, 27, 14], [15, 12, 27, 26]], [[21, 0, 39, 20], [39, 0, 39, 2], [39, 36, 3, 2], [37, 32, 7, 4], [33, 24, 15, 8], [25, 8, 31, 16], [23, 8, 31, 18], [23, 4, 35, 18], [31, 4, 35, 10], [31, 20, 19, 10]], [[21, 8, 31, 20], [23, 0, 39, 18], [39, 4, 35, 2], [37, 30, 9, 4], [33, 20, 19, 8], [25, 0, 39, 16], [39, 8, 31, 2], [37, 22, 17, 4], [33, 4, 35, 8], [31, 24, 15, 10]]}: bases[43] := {[[3, 0, 41, 40], [41, 36, 5, 2], [39, 30, 11, 4], [35, 18, 23, 8], [27, 4, 37, 16], [33, 10, 31, 10], [23, 20, 21, 20]], [[5, 0, 41, 38], [41, 32, 9, 2], [39, 22, 19, 4], [35, 2, 39, 8], [37, 26, 15, 6], [31, 10, 31, 12], [21, 18, 23, 22]], [[5, 2, 39, 38], [37, 32, 9, 6], [31, 22, 19, 12], [19, 2, 39, 24], [37, 4, 37, 6], [33, 30, 11, 10], [23, 18, 23, 20]], [[7, 0, 41, 36], [41, 28, 13, 2], [39, 14, 27, 4], [35, 12, 29, 8], [27, 16, 25, 16], [11, 8, 33, 32], [25, 20, 21, 18]], [[7, 2, 39, 36], [37, 28, 13, 6], [31, 14, 27, 12], [19, 12, 29, 24], [17, 4, 37, 26], [33, 8, 33, 10], [25, 22, 19, 18]], [[7, 4, 37, 36], [33, 28, 13, 10], [23, 14, 27, 20], [13, 2, 39, 30], [37, 16, 25, 6], [31, 8, 33, 12], [25, 18, 23, 18]], [[9, 0, 41, 34], [41, 24, 17, 2], [39, 6, 35, 4], [35, 28, 13, 8], [27, 14, 27, 16], [13, 10, 31, 30], [21, 16, 25, 22]], [[9, 2, 39, 34], [37, 24, 17, 6], [31, 6, 35, 12], [29, 18, 23, 14], [15, 4, 37, 28], [33, 12, 29, 10], [23, 16, 25, 20]], [[9, 4, 37, 34], [33, 24, 17, 10], [23, 6, 35, 20], [29, 2, 39, 14], [37, 14, 27, 6], [31, 12, 29, 12], [19, 16, 25, 24]], [[9, 6, 35, 34], [29, 24, 17, 14], [15, 6, 35, 28], [29, 12, 29, 14], [17, 14, 27, 26], [13, 8, 33, 30], [25, 16, 25, 18]], [[11, 0, 41, 32], [41, 20, 21, 2], [39, 0, 41, 4], [41, 34, 7, 2], [39, 26, 15, 4], [35, 10, 31, 8], [27, 20, 21, 16]], [[11, 2, 39, 32], [37, 20, 21, 6], [31, 0, 41, 12], [41, 18, 23, 2], [39, 4, 37, 4], [35, 32, 9, 8], [27, 22, 19, 16]], [[11, 4, 37, 32], [33, 20, 21, 10], [23, 0, 41, 20], [41, 2, 39, 2], [39, 36, 5, 4], [35, 30, 11, 8], [27, 18, 23, 16]], [[11, 6, 35, 32], [29, 20, 21, 14], [15, 0, 41, 28], [41, 12, 29, 2], [39, 16, 25, 4], [35, 8, 33, 8], [27, 24, 17, 16]], [[13, 0, 41, 30], [41, 16, 25, 2], [39, 8, 33, 4], [35, 24, 17, 8], [27, 6, 35, 16], [29, 10, 31, 14], [21, 14, 27, 22]], [[13, 4, 37, 30], [33, 16, 25, 10], [23, 8, 33, 20], [25, 2, 39, 18], [37, 6, 35, 6], [31, 28, 13, 12], [19, 14, 27, 24]], [[13, 6, 35, 30], [29, 16, 25, 14], [15, 8, 33, 28], [25, 12, 29, 18], [17, 6, 35, 26], [29, 8, 33, 14], [25, 14, 27, 18]], [[15, 2, 39, 28], [37, 12, 29, 6], [31, 16, 25, 12], [19, 8, 33, 24], [25, 4, 37, 18], [33, 6, 35, 10], [29, 22, 19, 14]], [[15, 10, 31, 28], [21, 12, 29, 22], [17, 0, 41, 26], [41, 8, 33, 2], [39, 24, 17, 4], [35, 6, 35, 8], [29, 26, 15, 14]], [[15, 12, 29, 28], [17, 12, 29, 26], [17, 8, 33, 26], [25, 8, 33, 18], [25, 6, 35, 18], [29, 6, 35, 14], [29, 14, 27, 14]], [[17, 2, 39, 26], [37, 8, 33, 6], [31, 24, 17, 12], [19, 6, 35, 24], [29, 4, 37, 14], [33, 14, 27, 10], [23, 12, 29, 20]], [[17, 10, 31, 26], [21, 8, 33, 22], [25, 0, 41, 18], [41, 6, 35, 2], [39, 28, 13, 4], [35, 14, 27, 8], [27, 12, 29, 16]], [[19, 0, 41, 24], [41, 4, 37, 2], [39, 32, 9, 4], [35, 22, 19, 8], [27, 2, 39, 16], [37, 10, 31, 6], [31, 20, 21, 12]], [[19, 4, 37, 24], [33, 4, 37, 10], [33, 22, 19, 10], [23, 2, 39, 20], [37, 2, 39, 6], [37, 30, 11, 6], [31, 18, 23, 12]], [[19, 10, 31, 24], [21, 4, 37, 22], [33, 0, 41, 10], [41, 22, 19, 2], [39, 2, 39, 4], [37, 34, 7, 6], [31, 26, 15, 12]], [[21, 0, 41, 22], [41, 0, 41, 2], [41, 38, 3, 2], [39, 34, 7, 4], [35, 26, 15, 8], [27, 10, 31, 16], [21, 10, 31, 22]], [[21, 2, 39, 22], [37, 0, 41, 6], [41, 30, 11, 2], [39, 18, 23, 4], [35, 4, 37, 8], [33, 26, 15, 10], [23, 10, 31, 20]], [[21, 6, 35, 22], [29, 0, 41, 14], [41, 14, 27, 2], [39, 12, 29, 4], [35, 16, 25, 8], [27, 8, 33, 16], [25, 10, 31, 18]], [[23, 4, 37, 20], [33, 2, 39, 10], [37, 22, 19, 6], [31, 2, 39, 12], [37, 18, 23, 6], [31, 4, 37, 12], [33, 18, 23, 10]], [[27, 0, 41, 16], [41, 10, 31, 2], [39, 20, 21, 4], [35, 0, 41, 8], [41, 26, 15, 2], [39, 10, 31, 4], [35, 20, 21, 8]]}: bases[45] := {[[27, 8, 35, 18]], [[15, 8, 35, 30], [27, 14, 29, 18]], [[33, 2, 41, 12], [39, 20, 23, 6]], [[15, 4, 39, 30], [35, 14, 29, 10], [25, 14, 29, 20]], [[25, 4, 39, 20], [35, 4, 39, 10], [35, 24, 19, 10]], [[9, 2, 41, 36], [39, 26, 17, 6], [33, 8, 35, 12], [27, 20, 23, 18]], [[15, 2, 41, 30], [39, 14, 29, 6], [33, 14, 29, 12], [21, 14, 29, 24]], [[21, 2, 41, 24], [39, 2, 41, 6], [39, 32, 11, 6], [33, 20, 23, 12]], [[21, 8, 35, 24], [27, 2, 41, 18], [39, 8, 35, 6], [33, 26, 17, 12]], [[9, 4, 39, 36], [35, 26, 17, 10], [25, 8, 35, 20], [27, 4, 39, 18], [35, 8, 35, 10], [27, 24, 19, 18]], [[19, 0, 43, 26], [43, 6, 37, 2], [41, 30, 13, 4], [37, 16, 27, 8], [29, 10, 33, 16], [23, 12, 31, 22]], [[3, 0, 43, 42], [43, 38, 5, 2], [41, 32, 11, 4], [37, 20, 23, 8], [29, 2, 41, 16], [39, 12, 31, 6], [33, 18, 25, 12], [21, 6, 37, 24], [31, 2, 41, 14], [39, 16, 27, 6], [33, 10, 33, 12], [23, 20, 23, 22]], [[5, 0, 43, 40], [43, 34, 9, 2], [41, 24, 19, 4], [37, 4, 39, 8], [35, 28, 15, 10], [25, 12, 31, 20], [19, 4, 39, 26], [35, 6, 37, 10], [31, 24, 19, 14], [17, 4, 39, 28], [35, 10, 33, 10], [25, 22, 21, 20]], [[5, 2, 41, 40], [39, 34, 9, 6], [33, 24, 19, 12], [21, 4, 39, 24], [35, 2, 41, 10], [39, 24, 19, 6], [33, 4, 39, 12], [35, 20, 23, 10], [25, 2, 41, 20], [39, 4, 39, 6], [35, 32, 11, 10], [25, 20, 23, 20]], [[7, 0, 43, 38], [43, 30, 13, 2], [41, 16, 27, 4], [37, 10, 33, 8], [29, 22, 21, 16], [13, 0, 43, 32], [43, 18, 25, 2], [41, 6, 37, 4], [37, 30, 13, 8], [29, 16, 27, 16], [13, 10, 33, 32], [23, 18, 25, 22]], [[7, 2, 41, 38], [39, 30, 13, 6], [33, 16, 27, 12], [21, 10, 33, 24], [23, 2, 41, 22], [39, 0, 43, 6], [43, 32, 11, 2], [41, 20, 23, 4], [37, 2, 41, 8], [39, 28, 15, 6], [33, 12, 31, 12], [21, 18, 25, 24]], [[7, 4, 39, 38], [35, 30, 13, 10], [25, 16, 27, 20], [11, 4, 39, 34], [35, 22, 21, 10], [25, 0, 43, 20], [43, 4, 39, 2], [41, 34, 9, 4], [37, 24, 19, 8], [29, 4, 39, 16], [35, 12, 31, 10], [25, 18, 25, 20]], [[9, 0, 43, 36], [43, 26, 17, 2], [41, 8, 35, 4], [37, 26, 17, 8], [29, 8, 35, 16], [27, 12, 31, 18], [19, 8, 35, 26], [27, 6, 37, 18], [31, 8, 35, 14], [27, 16, 27, 18], [11, 8, 35, 34], [27, 22, 21, 18]], [[9, 6, 37, 36], [31, 26, 17, 14], [17, 8, 35, 28], [27, 10, 33, 18], [23, 8, 35, 22], [27, 0, 43, 18], [43, 8, 35, 2], [41, 26, 17, 4], [37, 8, 35, 8], [29, 26, 17, 16], [13, 8, 35, 32], [27, 18, 25, 18]], [[11, 0, 43, 34], [43, 22, 21, 2], [41, 0, 43, 4], [43, 36, 7, 2], [41, 28, 15, 4], [37, 12, 31, 8], [29, 18, 25, 16], [13, 6, 37, 32], [31, 18, 25, 14], [17, 6, 37, 28], [31, 10, 33, 14], [23, 16, 27, 22]], [[11, 2, 41, 34], [39, 22, 21, 6], [33, 0, 43, 12], [43, 20, 23, 2], [41, 2, 41, 4], [39, 36, 7, 6], [33, 28, 15, 12], [21, 12, 31, 24], [19, 2, 41, 26], [39, 6, 37, 6], [33, 30, 13, 12], [21, 16, 27, 24]], [[11, 6, 37, 34], [31, 22, 21, 14], [17, 0, 43, 28], [43, 10, 33, 2], [41, 22, 21, 4], [37, 0, 43, 8], [43, 28, 15, 2], [41, 12, 31, 4], [37, 18, 25, 8], [29, 6, 37, 16], [31, 12, 31, 14], [19, 16, 27, 26]], [[13, 2, 41, 32], [39, 18, 25, 6], [33, 6, 37, 12], [31, 20, 23, 14], [17, 2, 41, 28], [39, 10, 33, 6], [33, 22, 21, 12], [21, 0, 43, 24], [43, 2, 41, 2], [41, 38, 5, 4], [37, 32, 11, 8], [29, 20, 23, 16]], [[13, 4, 39, 32], [35, 18, 25, 10], [25, 6, 37, 20], [31, 4, 39, 14], [35, 16, 27, 10], [25, 10, 33, 20], [23, 4, 39, 22], [35, 0, 43, 10], [43, 24, 19, 2], [41, 4, 39, 4], [37, 34, 9, 8], [29, 24, 19, 16]], [[15, 0, 43, 30], [43, 14, 29, 2], [41, 14, 29, 4], [37, 14, 29, 8], [29, 14, 29, 16], [15, 12, 31, 30], [19, 14, 29, 26], [15, 6, 37, 30], [31, 14, 29, 14], [17, 14, 29, 28], [15, 10, 33, 30], [23, 14, 29, 22]], [[17, 10, 33, 28], [23, 10, 33, 22], [23, 0, 43, 22], [43, 0, 43, 2], [43, 40, 3, 2], [41, 36, 7, 4], [37, 28, 15, 8], [29, 12, 31, 16], [19, 12, 31, 26], [19, 6, 37, 26], [31, 6, 37, 14], [31, 16, 27, 14]], [[17, 12, 31, 28], [19, 10, 33, 26], [23, 6, 37, 22], [31, 0, 43, 14], [43, 16, 27, 2], [41, 10, 33, 4], [37, 22, 21, 8], [29, 0, 43, 16], [43, 12, 31, 2], [41, 18, 25, 4], [37, 6, 37, 8], [31, 28, 15, 14]]}: bases[47] := {[[3, 0, 45, 44], [45, 40, 5, 2], [43, 34, 11, 4], [39, 22, 23, 8], [31, 0, 45, 16], [45, 14, 31, 2], [43, 16, 29, 4], [39, 12, 33, 8], [31, 20, 25, 16], [15, 4, 41, 32], [37, 16, 29, 10], [27, 12, 33, 20], [21, 6, 39, 26], [33, 4, 41, 14], [37, 18, 27, 10], [27, 8, 37, 20], [29, 6, 39, 18], [33, 10, 35, 14], [25, 18, 27, 22], [9, 2, 43, 38], [41, 28, 17, 6], [35, 10, 35, 12], [25, 22, 23, 22]], [[5, 0, 45, 42], [45, 36, 9, 2], [43, 26, 19, 4], [39, 6, 39, 8], [33, 30, 15, 14], [19, 14, 31, 28], [17, 8, 37, 30], [29, 12, 33, 18], [21, 10, 35, 26], [25, 4, 41, 22], [37, 2, 43, 10], [41, 26, 19, 6], [35, 6, 39, 12], [33, 22, 23, 14], [19, 0, 45, 28], [45, 8, 37, 2], [43, 28, 17, 4], [39, 10, 35, 8], [31, 24, 21, 16], [15, 2, 43, 32], [41, 16, 29, 6], [35, 12, 33, 12], [23, 20, 25, 24]], [[5, 2, 43, 42], [41, 36, 9, 6], [35, 26, 19, 12], [23, 6, 39, 24], [33, 0, 45, 14], [45, 18, 27, 2], [43, 8, 37, 4], [39, 28, 17, 8], [31, 10, 35, 16], [25, 14, 31, 22], [17, 2, 43, 30], [41, 12, 33, 6], [35, 20, 25, 12], [23, 4, 41, 24], [37, 0, 45, 10], [45, 26, 19, 2], [43, 6, 39, 4], [39, 32, 13, 8], [31, 18, 27, 16], [15, 8, 37, 32], [29, 16, 29, 18], [13, 10, 35, 34], [25, 20, 25, 22]], [[7, 0, 45, 40], [45, 32, 13, 2], [43, 18, 27, 4], [39, 8, 37, 8], [31, 28, 17, 16], [15, 10, 35, 32], [25, 16, 29, 22], [13, 2, 43, 34], [41, 20, 25, 6], [35, 4, 41, 12], [37, 22, 23, 10], [27, 0, 45, 20], [45, 6, 39, 2], [43, 32, 13, 4], [39, 18, 27, 8], [31, 8, 37, 16], [29, 14, 31, 18], [17, 10, 35, 30], [25, 12, 33, 22], [21, 2, 43, 26], [41, 4, 41, 6], [37, 34, 11, 10], [27, 22, 23, 20]], [[7, 2, 43, 40], [41, 32, 13, 6], [35, 18, 27, 12], [23, 8, 37, 24], [29, 0, 45, 18], [45, 10, 35, 2], [43, 24, 21, 4], [39, 2, 43, 8], [41, 30, 15, 6], [35, 14, 31, 12], [23, 16, 29, 24], [13, 0, 45, 34], [45, 20, 25, 2], [43, 4, 41, 4], [39, 36, 9, 8], [31, 26, 19, 16], [15, 6, 39, 32], [33, 16, 29, 14], [19, 12, 33, 28], [21, 8, 37, 26], [29, 4, 41, 18], [37, 10, 35, 10], [27, 24, 21, 20]], [[7, 4, 41, 40], [37, 32, 13, 10], [27, 18, 27, 20], [9, 6, 39, 38], [33, 28, 17, 14], [19, 10, 35, 28], [25, 8, 37, 22], [29, 2, 43, 18], [41, 10, 35, 6], [35, 24, 21, 12], [23, 2, 43, 24], [41, 0, 45, 6], [45, 34, 11, 2], [43, 22, 23, 4], [39, 0, 45, 8], [45, 30, 15, 2], [43, 14, 31, 4], [39, 16, 29, 8], [31, 12, 33, 16], [21, 14, 31, 26], [17, 4, 41, 30], [37, 12, 33, 10], [27, 20, 25, 20]], [[9, 0, 45, 38], [45, 28, 17, 2], [43, 10, 35, 4], [39, 24, 21, 8], [31, 2, 43, 16], [41, 14, 31, 6], [35, 16, 29, 12], [23, 12, 33, 24], [21, 0, 45, 26], [45, 4, 41, 2], [43, 36, 9, 4], [39, 26, 19, 8], [31, 6, 39, 16], [33, 14, 31, 14], [19, 16, 29, 28], [13, 8, 37, 34], [29, 20, 25, 18], [11, 4, 41, 36], [37, 24, 21, 10], [27, 2, 43, 20], [41, 6, 39, 6], [35, 32, 13, 12], [23, 18, 27, 24]], [[9, 4, 41, 38], [37, 28, 17, 10], [27, 10, 35, 20], [25, 6, 39, 22], [33, 2, 43, 14], [41, 18, 27, 6], [35, 8, 37, 12], [29, 22, 23, 18], [11, 0, 45, 36], [45, 24, 21, 2], [43, 2, 43, 4], [41, 38, 7, 6], [35, 30, 15, 12], [23, 14, 31, 24], [17, 0, 45, 30], [45, 12, 33, 2], [43, 20, 25, 4], [39, 4, 41, 8], [37, 30, 15, 10], [27, 14, 31, 20], [17, 6, 39, 30], [33, 12, 33, 14], [21, 18, 27, 26]], [[11, 2, 43, 36], [41, 24, 21, 6], [35, 2, 43, 12], [41, 22, 23, 6], [35, 0, 45, 12], [45, 22, 23, 2], [43, 0, 45, 4], [45, 38, 7, 2], [43, 30, 15, 4], [39, 14, 31, 8], [31, 16, 29, 16], [15, 12, 33, 32], [21, 16, 29, 26], [13, 4, 41, 34], [37, 20, 25, 10], [27, 4, 41, 20], [37, 6, 39, 10], [33, 26, 19, 14], [19, 6, 39, 28], [33, 8, 37, 14], [29, 18, 27, 18], [11, 8, 37, 36], [29, 24, 21, 18]], [[11, 6, 39, 36], [33, 24, 21, 14], [19, 2, 43, 28], [41, 8, 37, 6], [35, 28, 17, 12], [23, 10, 35, 24], [25, 0, 45, 22], [45, 2, 43, 2], [43, 40, 5, 4], [39, 34, 11, 8], [31, 22, 23, 16], [15, 0, 45, 32], [45, 16, 29, 2], [43, 12, 33, 4], [39, 20, 25, 8], [31, 4, 41, 16], [37, 14, 31, 10], [27, 16, 29, 20], [13, 6, 39, 34], [33, 20, 25, 14], [19, 4, 41, 28], [37, 8, 37, 10], [29, 26, 19, 18]], [[17, 12, 33, 30], [21, 12, 33, 26], [21, 4, 41, 26], [37, 4, 41, 10], [37, 26, 19, 10], [27, 6, 39, 20], [33, 6, 39, 14], [33, 18, 27, 14], [19, 8, 37, 28], [29, 8, 37, 18], [29, 10, 35, 18], [25, 10, 35, 22], [25, 2, 43, 22], [41, 2, 43, 6], [41, 34, 11, 6], [35, 22, 23, 12], [23, 0, 45, 24], [45, 0, 45, 2], [45, 42, 3, 2], [43, 38, 7, 4], [39, 30, 15, 8], [31, 14, 31, 16], [17, 14, 31, 30]]}: bases[49] := {[[21, 6, 41, 28], [35, 6, 41, 14], [35, 20, 27, 14]], [[3, 0, 47, 46], [47, 42, 5, 2],[45, 36, 11, 4], [41, 24, 23, 8], [33, 0, 47, 16], [47, 16, 31, 2], [45, 14, 33, 4], [41, 18, 29, 8],[33, 10, 37, 16], [27, 16, 31, 22], [15, 4, 43, 34], [39, 18, 29, 10], [29, 10, 37, 20], [27, 8, 39, 22],[31, 4, 43, 18], [39, 12, 35, 10], [29, 22, 25, 20], [9, 2, 45, 40], [43, 30, 17, 6], [37, 12, 35, 12],[25, 22, 25, 24]], [[5, 0, 47, 44], [47, 38, 9, 2], [45, 28, 19, 4], [41, 8, 39, 8], [33, 30, 17, 16], [17, 12, 35, 32], [23, 14, 33, 26], [19, 2, 45, 30], [43, 10, 37, 6], [37, 26, 21, 12], [25, 4, 43, 24], [39, 0, 47, 10], [47, 28, 19, 2], [45, 8, 39, 4], [41, 30, 17, 8], [33, 12, 35, 16], [23, 16, 31, 26], [15, 2, 45, 34], [43, 18, 29, 6], [37, 10, 37, 12], [27, 24, 23, 22]], [[5, 2, 45, 44], [43, 38, 9, 6], [37, 28, 19, 12], [25, 8, 39, 24], [31, 0, 47, 18], [47, 12, 35, 2], [45, 22, 25, 4], [41, 2, 45, 8], [43, 32, 15, 6], [37, 16, 31, 12], [25, 14, 33, 24], [19, 0, 47, 30], [47, 10, 37, 2], [45, 26, 21, 4], [41, 4, 43, 8], [39, 32, 15, 10], [29, 16, 31, 20], [15, 8, 39, 34], [31, 18, 29, 18], [13, 10, 37, 36], [27, 22, 25, 22]], [[7, 0, 47, 42], [47, 34, 13, 2], [45, 20, 27, 4], [41, 6, 41, 8], [35, 32, 15, 14], [21, 16, 31, 28], [15, 6, 41, 34], [35, 18, 29, 14], [21, 10, 37, 28], [27, 6, 41, 22], [35, 4, 43, 14], [39, 20, 27, 10], [29, 6, 41, 20], [35, 8, 39, 14], [31, 20, 27, 18], [13, 6, 41, 36], [35, 22, 25, 14], [21, 2, 45, 28], [43, 6, 41, 6], [37, 34, 13, 12], [25, 20, 27, 24]], [[7, 2, 45, 42], [43, 34, 13, 6], [37, 20, 27, 12], [25, 6, 41, 24], [35, 0, 47, 14], [47, 20, 27, 2], [45, 6, 41, 4], [41, 34, 13, 8], [33, 20, 27, 16], [17, 6, 41, 32], [35, 14, 33, 14], [21, 18, 29, 28], [11, 6, 41, 38], [35, 26, 21, 14], [21, 4, 43, 28], [39, 6, 41, 10], [35, 28, 19, 14], [21, 8, 39, 28], [31, 6, 41, 18], [35, 12, 35, 14], [23, 20, 27, 26]], [[7, 4, 43, 42], [39, 34, 13, 10], [29, 20, 27, 20], [9, 6, 41, 40], [35, 30, 17, 14], [21, 12, 35, 28], [23, 6, 41, 26], [35, 2, 45, 14], [43, 20, 27, 6], [37, 6, 41, 12], [35, 24, 23, 14], [21, 0, 47, 28], [47, 6, 41, 2], [45, 34, 13, 4], [41, 20, 27, 8], [33, 6, 41, 16], [35, 16, 31, 14], [21, 14, 33, 28], [19, 6, 41, 30], [35, 10, 37, 14], [27, 20, 27, 22]], [[9, 0, 47, 40], [47, 30, 17, 2], [45, 12, 35, 4], [41, 22, 25, 8], [33, 2, 45, 16], [43, 16, 31, 6], [37, 14, 33, 12], [25, 18, 29, 24], [11, 0, 47, 38], [47, 26, 21, 2], [45, 4, 43, 4], [41, 38, 9, 8], [33, 28, 19, 16], [17, 8, 39, 32], [31, 14, 33, 18], [19, 12, 35, 30], [23, 10, 37, 26], [27, 2, 45, 22], [43, 4, 43, 6], [39, 36, 11, 10], [29, 24, 23, 20]], [[9, 4, 43, 40], [39, 30, 17, 10], [29, 12, 35, 20], [23, 8, 39, 26], [31, 2, 45, 18], [43, 12, 35, 6], [37, 22, 25, 12], [25, 2, 45, 24], [43, 0, 47, 6], [47, 36, 11, 2], [45, 24, 23, 4], [41, 0, 47, 8], [47, 32, 15, 2], [45, 16, 31, 4], [41, 14, 33, 8], [33, 18, 29, 16], [17, 10, 37, 32], [27, 14, 33, 22], [19, 4, 43, 30], [39, 10, 37, 10], [29, 26, 21, 20]], [[11, 2, 45, 38], [43, 26, 21, 6], [37, 4, 43, 12], [39, 24, 23, 10], [29, 0, 47, 20], [47, 8, 39, 2], [45, 30, 17, 4], [41, 12, 35, 8], [33, 22, 25, 16], [17, 2, 45, 32], [43, 14, 33, 6], [37, 18, 29, 12], [25, 10, 37, 24], [27, 0, 47, 22], [47, 4, 43, 2], [45, 38, 9, 4], [41, 28, 19, 8], [33, 8, 39, 16], [31, 16, 31, 18], [15, 12, 35, 34], [23, 18, 29, 26]], [[11, 4, 43, 38], [39, 26, 21, 10], [29, 4, 43, 20],[39, 8, 39, 10], [31, 28, 19, 18], [13, 8, 39, 36], [31, 22, 25, 18], [13, 2, 45, 36], [43, 22, 25, 6], [37, 2, 45, 12], [43, 24, 23, 6], [37, 0, 47, 12], [47, 24, 23, 2], [45, 0, 47, 4], [47, 40, 7, 2], [45, 32, 15, 4], [41, 16, 31, 8], [33, 14, 33, 16], [19, 16, 31, 30], [15, 10, 37, 34], [27, 18, 29, 22]], [[11, 8, 39, 38], [31, 26, 21, 18], [13, 4, 43, 36], [39, 22, 25, 10], [29, 2, 45, 20], [43, 8, 39, 6], [37, 30, 17, 12], [25, 12, 35, 24], [23, 0, 47, 26], [47, 2, 45, 2], [45, 42, 5, 4], [41, 36, 11, 8], [33, 24, 23, 16], [17, 0, 47, 32], [47, 14, 33, 2], [45, 18, 29, 4], [41, 10, 37, 8], [33, 26, 21, 16], [17, 4, 43, 32], [39, 14, 33, 10], [29, 18, 29, 20]], [[13, 0, 47, 36], [47, 22, 25, 2], [45, 2, 45, 4], [43, 40, 7, 6], [37, 32, 15, 12], [25, 16, 31, 24], [15, 0, 47, 34], [47, 18, 29, 2], [45, 10, 37, 4], [41, 26, 21, 8], [33, 4, 43, 16], [39, 16, 31, 10], [29, 14, 33, 20], [19, 8, 39, 30], [31, 10, 37, 18], [27, 12, 35, 22], [23, 4, 43, 26], [39, 2, 45, 10], [43, 28, 19, 6], [37, 8, 39, 12], [31, 24, 23, 18]], [[17, 14, 33, 32], [19, 14, 33, 30], [19, 10, 37, 30], [27, 10, 37, 22], [27, 4, 43, 22], [39, 4, 43, 10], [39, 28, 19, 10], [29, 8, 39, 20], [31, 8, 39, 18], [31, 12, 35, 18], [23, 12, 35, 26], [23, 2, 45, 26], [43, 2, 45, 6], [43, 36, 11, 6], [37, 24, 23, 12], [25, 0, 47, 24], [47, 0, 47, 2], [47, 44, 3, 2], [45, 40, 7, 4], [41, 32, 15, 8], [33, 16, 31, 16]]}: bases[51] := {[[15, 8, 41, 36], [33, 20, 29, 18]], [[39, 2, 47, 12], [45, 26, 23, 6]], [[9, 2, 47, 42], [45, 32, 17, 6], [39, 14, 35, 12], [27, 20, 29, 24]], [[15, 2, 47, 36], [45, 20, 29, 6], [39, 8, 41, 12], [33, 26, 23, 18]], [[17, 2, 47, 34], [45, 16, 33, 6], [39, 16, 33, 12], [27, 16, 33, 24]], [[17, 8, 41, 34], [33, 16, 33, 18], [17, 14, 35, 34], [21, 16, 33, 30]], [[21, 2, 47, 30], [45, 8, 41, 6], [39, 32, 17, 12], [27, 14, 35, 24]], [[21, 8, 41, 30], [33, 8, 41, 18], [33, 14, 35, 18], [21, 14, 35, 30]], [[23, 10, 39, 28], [29, 4, 45, 22], [41, 6, 43, 10], [37, 30, 19, 14]], [[27, 2, 47, 24], [45, 2, 47, 6], [45, 38, 11, 6], [39, 26, 23, 12]], [[27, 8, 41, 24], [33, 2, 47, 18], [45, 14, 35, 6], [39, 20, 29, 12]], [[35, 0, 49, 16], [49, 18, 31, 2], [47, 12, 37, 4], [43, 24, 25, 8]], [[3, 0, 49, 48], [49, 44, 5, 2], [47, 38, 11, 4], [43, 26, 23, 8], [35, 2, 47, 16], [45, 18, 31, 6], [39, 12, 37, 12], [27, 24, 25, 24]], [[5, 0, 49, 46], [49, 40, 9, 2], [47, 30, 19, 4], [43, 10, 39, 8], [35, 28, 21, 16], [19, 6, 43, 32], [37, 12, 37, 14], [25, 22, 27, 26]], [[5, 2, 47, 46], [45, 40, 9, 6], [39, 30, 19, 12], [27, 10, 39, 24], [29, 2, 47, 22], [45, 6, 43, 6], [39, 36, 13, 12], [27, 22, 27, 24]], [[7, 0, 49, 44], [49, 36, 13, 2], [47, 22, 27, 4], [43, 4, 45, 8], [41, 34, 15, 10], [31, 18, 31, 20], [13, 10, 39, 38], [29, 24, 25, 22]], [[7, 2, 47, 44], [45, 36, 13, 6], [39, 22, 27, 12], [27, 4, 45, 24], [41, 2, 47, 10], [45, 30, 19, 6], [39, 10, 39, 12], [29, 26, 23, 22]], [[7, 4, 45, 44], [41, 36, 13, 10], [31, 22, 27, 20], [11, 4, 45, 40], [41, 28, 21, 10], [31, 6, 43, 20], [37, 10, 39, 14], [29, 22, 27, 22]], [[9, 0, 49, 42], [49, 32, 17, 2], [47, 14, 35, 4], [43, 20, 29, 8], [35, 8, 41, 16], [33, 18, 31, 18], [15, 12, 37, 36], [25, 20, 29, 26]], [[9, 4, 45, 42], [41, 32, 17, 10], [31, 14, 35, 20], [21, 10, 39, 30], [29, 8, 41, 22], [33, 6, 43, 18], [37, 14, 35, 14], [23, 20, 29, 28]], [[9, 6, 43, 42], [37, 32, 17, 14], [23, 14, 35, 28], [21, 4, 45, 30], [41, 8, 41, 10], [33, 30, 19, 18], [15, 10, 39, 36], [29, 20, 29, 22]], [[11, 0, 49, 40], [49, 28, 21, 2], [47, 6, 43, 4], [43, 36, 13, 8], [35, 22, 27, 16], [19, 4, 45, 32], [41, 12, 37, 10], [31, 24, 25, 20]], [[11, 2, 47, 40], [45, 28, 21, 6], [39, 6, 43, 12], [37, 26, 23, 14], [23, 2, 47, 28], [45, 4, 45, 6], [41, 38, 11, 10], [31, 26, 23, 20]], [[11, 6, 43, 40], [37, 28, 21, 14], [23, 6, 43, 28], [37, 4, 45, 14], [41, 22, 27, 10], [31, 4, 45, 20], [41, 10, 39, 10], [31, 28, 21, 20]], [[11, 8, 41, 40], [33, 28, 21, 18], [15, 6, 43, 36], [37, 20, 29, 14], [23, 8, 41, 28], [33, 4, 45, 18], [41, 14, 35, 10], [31, 20, 29, 20]], [[13, 0, 49, 38], [49, 24, 25, 2], [47, 0, 49, 4], [49, 42, 7, 2], [47, 34, 15, 4], [43, 18, 31, 8], [35, 12, 37, 16], [25, 18, 31, 26]], [[13, 2, 47, 38], [45, 24, 25, 6], [39, 0, 49, 12], [49, 26, 23, 2], [47, 2, 47, 4], [45, 42, 7, 6], [39, 34, 15, 12], [27, 18, 31, 24]], [[13, 4, 45, 38], [41, 24, 25, 10], [31, 0, 49, 20], [49, 10, 39, 2], [47, 28, 21, 4], [43, 6, 43, 8], [37, 34, 15, 14], [23, 18, 31, 28]], [[13, 6, 43, 38], [37, 24, 25, 14], [23, 0, 49, 28], [49, 4, 45, 2], [47, 40, 9, 4], [43, 30, 19, 8], [35, 10, 39, 16], [29, 18, 31, 22]], [[13, 8, 41, 38], [33, 24, 25, 18], [15, 0, 49, 36], [49, 20, 29, 2], [47, 8, 41, 4], [43, 32, 17, 8], [35, 14, 35, 16], [21, 18, 31, 30]], [[15, 4, 45, 36], [41, 20, 29, 10], [31, 8, 41, 20], [33, 10, 39, 18], [29, 14, 35, 22], [21, 6, 43, 30], [37, 8, 41, 14], [33, 22, 27, 18]], [[17, 0, 49, 34], [49, 16, 33, 2], [47, 16, 33, 4], [43, 16, 33, 8], [35, 16, 33, 16], [19, 16, 33, 32], [17, 12, 37, 34], [25, 16, 33, 26]], [[17, 4, 45, 34], [41, 16, 33, 10], [31, 16, 33, 20], [17, 10, 39, 34], [29, 16, 33, 22], [17, 6, 43, 34], [37, 16, 33, 14], [23, 16, 33, 28]], [[19, 0, 49, 32], [49, 12, 37, 2], [47, 24, 25, 4], [43, 0, 49, 8], [49, 34, 15, 2], [47, 18, 31, 4], [43, 12, 37, 8], [35, 24, 25, 16]], [[19, 2, 47, 32], [45, 12, 37, 6], [39, 24, 25, 12], [27, 0, 49, 24], [49, 2, 47, 2], [47, 44, 5, 4], [43, 38, 11, 8], [35, 26, 23, 16]], [[19, 8, 41, 32], [33, 12, 37, 18], [25, 14, 35, 26], [21, 0, 49, 30], [49, 8, 41, 2], [47, 32, 17, 4], [43, 14, 35, 8], [35, 20, 29, 16]], [[19, 10, 39, 32], [29, 12, 37, 22], [25, 6, 43, 26], [37, 0, 49, 14], [49, 22, 27, 2], [47, 4, 45, 4], [43, 40, 9, 8], [35, 30, 19, 16]], [[19, 12, 37, 32], [25, 12, 37, 26], [25, 0, 49, 26], [49, 0, 49, 2], [49, 46, 3, 2], [47, 42, 7, 4], [43, 34, 15, 8], [35, 18, 31, 16]], [[19, 14, 35, 32], [21, 12, 37, 30], [25, 8, 41, 26], [33, 0, 49, 18], [49, 14, 35, 2], [47, 20, 29, 4], [43, 8, 41, 8], [35, 32, 17, 16]], [[23, 4, 45, 28], [41, 4, 45, 10], [41, 30, 19, 10], [31, 10, 39, 20], [29, 10, 39, 22], [29, 6, 43, 22], [37, 6, 43, 14], [37, 22, 27, 14]], [[23, 12, 37, 28], [25, 4, 45, 26], [41, 0, 49, 10], [49, 30, 19, 2], [47, 10, 39, 4], [43, 28, 21, 8], [35, 6, 43, 16], [37, 18, 31, 14]], [[25, 2, 47, 26], [45, 0, 49, 6], [49, 38, 11, 2], [47, 26, 23, 4], [43, 2, 47, 8], [45, 34, 15, 6], [39, 18, 31, 12], [27, 12, 37, 24]], [[25, 10, 39, 26], [29, 0, 49, 22], [49, 6, 43, 2], [47, 36, 13, 4], [43, 22, 27, 8], [35, 4, 45, 16], [41, 18, 31, 10], [31, 12, 37, 20]], [[27, 6, 43, 24], [37, 2, 47, 14], [45, 22, 27, 6], [39, 4, 45, 12], [41, 26, 23, 10], [31, 2, 47, 20], [45, 10, 39, 6], [39, 28, 21, 12]]}: return(bases[b]): end: #******************************************************************************* length7Orbits:=proc(b) local bases: bases[2] := {[[0, 1, 1, 1, 1, 1, 1]], [[1, 0, 1, 1, 1, 0, 1]],[[1, 1, 0, 1, 0, 0, 1]]}: bases[4] := {[[3, 2, 0, 3, 2, 1, 1]]}: bases[6] := {[[4, 4, 0, 5, 4, 1, 2], [5, 3, 1, 5, 3, 2, 1]]}: bases[8] := {[[6, 4, 1, 7, 5, 3, 2]], [[6, 4, 0, 7, 6, 3, 2],[7, 4, 2, 7, 4, 3, 1], [6, 5, 0, 7, 6, 2, 2], [7, 4, 3, 7, 3, 3, 1]], [[5, 4, 0, 7, 6, 3, 3], [7, 3, 1, 7, 5, 4, 1], [6, 6, 1, 7, 5, 1, 2], [6, 5, 3, 7, 3, 2, 2], [5, 4, 1, 7, 5, 3, 3], [6, 2, 1, 7, 5, 5, 2], [6, 4, 2, 7, 4, 3, 2]]}: bases[10] := {[[7, 5, 0, 9, 8, 4, 3], [9, 5, 2, 9, 6, 4, 1], [8, 7, 1, 9, 7, 2, 2], [8, 6, 4, 9, 4, 3, 2],[7, 5, 1, 9, 7, 4, 3], [8, 4, 2, 9, 6, 5, 2], [7, 6, 1, 9, 7, 3, 3], [8, 4, 3, 9, 5, 5, 2]]}: bases[12] := {[[9, 6, 2, 11, 8, 5, 3]], [[8, 4, 1, 11, 9, 7, 4], [10, 5, 3, 11, 7, 6, 2], [9, 7, 1, 11, 9, 4, 3], [10, 6, 4, 11, 6, 5, 2], [9, 6, 0, 11, 10, 5, 3], [11, 7, 3, 11, 7, 4, 1], [10, 8, 2, 11, 8, 3, 2], [9, 8, 4, 11, 6, 3, 3], [8, 6, 3, 11, 7, 5, 4]]}: bases[14] := {[[10, 6, 2, 13, 10, 7, 4], [11, 6, 3, 13, 9, 7, 3], [10, 8, 2, 13, 10, 5, 4], [11, 6, 4, 13, 8, 7, 3], [10, 7, 1, 13, 11, 6, 4], [12, 7, 3, 13, 9, 6, 2], [11, 9, 2, 13, 10, 4, 3], [11, 8, 5, 13, 7, 5, 3]]}: bases[16] := {[[12, 8, 3, 15, 11, 7, 4]], [[11, 6, 2, 15, 12, 9, 5], [13, 7, 4, 15, 10, 8, 3], [12, 9, 2, 15, 12, 6, 4], [13, 8, 5, 15, 9, 7, 3], [12, 8, 1, 15, 13, 7, 4], [14, 9, 4, 15, 10, 6, 2], [13, 10, 3, 15, 11, 5, 3], [12, 10, 5, 15, 9, 5, 4], [11, 7, 4, 15, 10, 8, 5]], [[11, 7, 1, 15, 13, 8, 5], [14, 8, 3, 15, 11, 7, 2], [13, 11, 3, 15, 11, 4, 3], [12, 10, 6, 15, 8, 5, 4], [11, 7, 3, 15, 11, 8, 5], [12, 6, 3, 15, 11, 9, 4], [12, 8, 4, 15, 10, 7, 4], [11, 8, 2, 15, 12, 7, 5], [13, 7, 3, 15, 11, 8, 3], [12, 10, 3, 15, 11, 5, 4], [12, 8, 5, 15, 9, 7, 4]]}: bases[18] := {[[13, 8, 2, 17, 14, 9, 5], [15, 9, 4, 17, 12, 8, 3], [14, 11, 3, 17, 13, 6, 4], [14, 10, 6, 17, 10, 7, 4]]}: bases[3] := {[[2, 2, 0, 2, 1, 0, 1]], [[2, 0, 2, 2, 2, 1, 1], [2, 1, 0, 2, 1, 1, 1]]}: bases[5] := {[[3, 2, 0, 4, 3, 2, 2], [4, 1, 0, 4, 3, 3, 1], [4, 3, 1, 4, 2, 1, 1], [3, 3, 1, 4, 2, 1, 2]]}: bases[7] := {[[5, 3, 0, 6, 5, 3, 2], [6, 3, 1, 6, 4, 3, 1], [5, 5, 0, 6, 5, 1, 2], [6, 4, 2, 6, 3, 2, 1],[5, 4, 1, 6, 4, 2, 2], [5, 3, 1, 6, 4, 3, 2]]}: bases[9] := {[[6, 5, 1, 8, 6, 3, 3], [7, 3, 2, 8, 5, 5, 2]]}: bases[11] := {[[7, 5, 1, 10, 8, 5, 4], [9, 4, 1, 10, 8, 6, 2], [9, 7, 3, 10, 6, 3, 2], [8, 6, 3, 10, 6, 4, 3]], [[6, 3, 1, 10, 8, 7, 5], [9, 5, 1, 10, 8, 5, 2], [9, 7, 2, 10, 7, 3, 2], [8, 7, 3, 10, 6, 3, 3], [7, 5, 3, 10, 6, 5, 4], [7, 3, 0, 10, 9, 7, 4], [10, 6, 2, 10, 7, 4, 1], [9, 8, 2, 10, 7, 2, 2], [8, 7, 5, 10, 4, 3, 3], [7, 5, 2, 10, 7, 5, 4], [8, 3, 1, 10, 8, 7, 3], [9, 5, 4, 10, 5, 5, 2], [8, 4, 10, 10, 10, 5, 3], [7, 6, 4, 10, 5, 4, 4]]}: bases[13] := {[[9, 7, 2, 12, 9, 5, 4], [10, 5, 3, 12, 8, 7, 3]], [[10, 7, 1, 12, 10, 5, 3], [11, 7, 4, 12, 7, 5, 2]], [[9, 5, 1, 12, 10, 7, 4], [11, 6, 3, 12, 8, 6, 2], [10, 8, 1, 12, 10, 4, 3], [11, 7, 5, 12, 6, 5, 2], [10, 6, 1, 12, 10, 6, 3], [11, 7, 3, 12, 8, 5, 2], [10, 8, 2, 12, 9, 4, 3], [10, 7, 4, 12, 7, 5, 3], [9, 6, 1, 12, 10, 6, 4], [11, 6, 2, 12, 9, 6, 2], [10, 9, 2, 12, 9, 3, 3], [10, 7, 5, 12, 6, 5, 3]]}: bases[15] := {[[10, 6, 2, 14, 11, 8, 5], [12, 6, 3, 14, 10, 8, 3], [11, 9, 3, 14, 10, 5, 4], [11, 7, 4, 14, 9, 7, 4], [10, 7, 1, 14, 12, 7, 5], [13, 7, 2, 14, 11, 7, 2], [12, 11, 3, 14, 10, 3, 3], [11, 9, 7, 14, 6, 5, 4]], [[11, 7, 0, 14, 13, 7, 4], [14, 9, 3, 14, 10, 5, 1], [13, 11, 4, 14, 9, 3, 2], [12, 10, 6, 14, 7, 4, 3], [11, 8, 3, 14, 10, 6, 4], [11, 7, 3, 14, 10, 7, 4], [11, 7, 2, 14, 11, 7, 4], [12, 7, 3, 14, 10, 7, 3], [11, 9, 2, 14, 11, 5, 4], [12, 7, 5, 14, 8, 7, 3]]}: bases[17] := {[[12, 9, 3, 16, 12, 7, 5], [13, 7, 4, 16, 11, 9, 4]], [[13, 9, 2, 16, 13, 7, 4], [14, 9, 5, 16, 10, 7, 3]], [[11, 7, 2, 16, 13, 9, 6], [14, 7, 3, 16, 12, 9, 3], [13, 11, 4, 16, 11, 5, 4], [12, 9, 5, 16, 10, 7, 5]]}: return(bases[b]): end: #******************************************************************************* rangeAllOrbits := proc(minLength, maxLength, lengthStep, minBase, maxBase, baseStep) local curLength, curBase, cur, res: res:=[]: for curBase from minBase to maxBase by baseStep do for curLength from minLength to maxLength by lengthStep do cur := [curLength, curBase, allOrbits(curLength, curBase, "list")]: print(cur): res := [op(res), cur]: od: od: return(res): end: #******************************************************************************* allListNums := proc(theLength, theBase) local i, allNums, parts, prev: parts:=[seq(0, i=1..theBase)]: if theLength = 1 then allNums:={seq([i], i=0..theBase-1)}: else for i from 1 to theBase do prev := allListNums(theLength-1, theBase): parts[i]:= {seq([i-1, op(prev[j])], j=1..nops(prev))}: od: allNums := `union`(seq(parts[i], i = 1 .. theBase)) fi: return(allNums): end: #******************************************************************************* getStringOrbit:=proc(listOrbit, digitLength) local temp, i, stringOrbitList: stringOrbitList := listOrbit: for i from 1 to nops(listOrbit) do stringOrbitList[i] := inputListToString(listOrbit[i], digitLength) od: return(stringOrbitList): end: #******************************************************************************* getCanonOrbit:=proc(orbit) local smallestElement, canonOrbit, firstIndex: smallestElement := sort(orbit)[1]: firstIndex := Search(smallestElement, orbit): canonOrbit := shiftList(orbit, firstIndex): return(canonOrbit): end: #******************************************************************************* extendList:=proc(theList, theLength) local correctedList, shift, i: shift := theLength - nops(theList): correctedList := [seq(0, i=1..theLength)]: for i from 1 to nops(theList) do correctedList[i + shift] := theList[i]: od: return(correctedList): end: #******************************************************************************* getNumList:=proc(num, myBase) local theLength, singleNumList, temp, numList, i, numLength: singleNumList := convert(num, list): theLength := nops(singleNumList)/length(myBase - 1): if not whattype(theLength) = integer then return(FAIL, "number not input properly") fi: temp := [LengthSplit(singleNumList, length(myBase - 1))]: numList := [seq(0, i=1..theLength)]: for i from 1 to theLength do numList[i] := cat(op(temp[i])): od: return(numList): end: #******************************************************************************* getOrbitsGF:=proc(orbits, x) local gf, n, i: n := nops(orbits): gf := 0: for i from 1 to n do gf := gf + x^nops(orbits[i]): od: return(gf): end: #******************************************************************************* randomNum := proc(theLength, myBase) local ra, numList, i: ra := rand(0..myBase-1): numList := [seq(0, i=1..theLength)]: for i from 1 to theLength do numList[i] := ra(): od: return(numList): end: #******************************************************************************* baseSubtract := proc(num1List, num2List, myBase) local base10res, baseListRes: base10res := toBase10(num1List, myBase)-toBase10(num2List, myBase): baseListRes := Reverse(convert(base10res, base, myBase)): return(baseListRes): end: #******************************************************************************* baseSubtractSmallBase := proc(num1, num2, myBase) local base10res, baseListRes: base10res := toBase10(num1, myBase)-toBase10(num2, myBase): baseListRes := Reverse(convert(base10res, base, myBase)): return(FromDigits(baseListRes)): end: #******************************************************************************* toBase10:=proc(numList, aBase) local s, n, res: s := [seq(convert(numList[i], string), i = 1 .. nops(numList))]: n:=nops(s); res := add(parse(s[n-i+1])*aBase^(i-1), i=1..n); return(res): end: #******************************************************************************* toBase10SmallBase:=proc(num, aBase) local s, n, res: s:=convert(num, string); n:=length(s); res := add(parse(s[n-i+1])*aBase^(i-1), i=1..n); return(res): end: #******************************************************************************* getBase10orbits:=proc(orbits, theBase) local orbitsBase10, orb: orbitsBase10 := {}: for orb in orbits do orbitsBase10 := {op(orbitsBase10), getBase10orb(orb, theBase)}: od: return(orbitsBase10): end: #******************************************************************************* getBase10orb:=proc(orbit, theBase) return([seq(toBase10(orbit[i], theBase), i=1..nops(orbit))]): end: #******************************************************************************* checkTriv := proc(numList) local numSet, setSize, isTrivial: numSet := convert(numList, set): setSize := nops(numSet): if setSize = 1 then isTrivial := true: else isTrivial := false: fi: return(isTrivial): end: #******************************************************************************* inputsValid := proc(numList, myBase) local isValid, validSet, i: isValid := true: validSet := {seq(i, i = 0..myBase - 1)}: for i from 1 to nops(numList) do if not numList[i] in validSet then isValid := false: fi: od: return(isValid): end: #******************************************************************************* inputListToString:=proc(listNum, digitLength) local curNum, stringList, curStringNum, outputString, i: stringList := listNum: for i from 1 to nops(listNum) do curStringNum := convert(listNum[i], string): if length(listNum[i]) < digitLength then stringList[i]:= getCorrectLengthNum(curStringNum, digitLength): else stringList[i]:= curStringNum: fi: od: return(cat(op(stringList))): end: #******************************************************************************* listToString:=proc(numList, digitLength) #specifically for total numList local temp, numString, i: temp := numList: for i from 1 to nops(numList) do temp[i] := getCorrectLengthNum(convert(numList[i], string), digitLength): od: numString := cat(op(temp)): return(numString): end: #******************************************************************************* #L = [n1, n2, ..., nN] where ni = [a1, a2, a3, a4] diffSequence := proc(L) local n, cur, a, outerDiff, innerDiff, S, i: a:=[seq(0, k=1..4)]: n:=nops(L): S:=[]: for i from 1 to n do cur := sort(L[i]): #so max cur[4], min cur[1] outerDiff := cur[4] - cur[1]: innerDiff := cur[3] - cur[2]: S:=[op(S), [outerDiff, innerDiff]]: od: return(S): end: #******************************************************************************* getCorrectLengthNum:=proc(num, digitLength) local correctList, numList, i, startIndex: correctList:=[seq("0", i=1..digitLength)]: numList := convert(num, list): startIndex := digitLength - nops(List) + 1: for i from 1 to nops(numStringList) do correctList[startIndex + i - 1] := convert(numList[i],string): od: return(cat(op(correctList))): end: #******************************************************************************* randomStringEG := proc(theLength, myBase) local numList, numString, res, isTrivial, digitLength: if myBase <= 1 or theLength <= 1 then return(FAIL, "base and length must both be integers greater than 2"): fi: digitLength := length(myBase - 1): numList := randomNum(theLength, myBase): isTrivial := checkTriv(numList): if not isTrivial then numString := listToString(numList, digitLength): res := stringPhenom(numString, myBase): else res := randomEGstring(theLength, myBase): #run again fi: return(res): end: #******************************************************************************* iterateBase10:=proc(number) local numList, increasingList, decreasingList, minNum, maxNum, res: numList := convert(number, base, 10): increasingList := sort(numList): minNum := FromDigits(increasingList): decreasingList := sort(numList, `>`): maxNum := FromDigits(decreasingList): res := maxNum - minNum: return(res): end: #******************************************************************************* subListOld := proc(aList, begIndex, finalIndex) local theLength, newList, i: theLength := finalIndex-begIndex + 1: newList := [seq(0, i=1..theLength)]: for i from 1 to theLength do newList[i] := aList[begIndex + i - 1]: od: return(newList): end: #******************************************************************************* subList := proc(aList, begIndex, finalIndex) local theLength, newArray, i: theLength := finalIndex-begIndex + 1: newArray := Array([seq(0, i=1..theLength)]): for i from 1 to theLength do newArray[i] := aList[begIndex + i - 1]: od: return(newArray): end: #******************************************************************************* numDistinctParts := proc(aPartition): #eg [1,2,2,5] should return 4 return(nops(aPartition)): end: #******************************************************************************* isFixedPoint:=proc(numList, myBase) local isFixed, res: res := iterate(numList, myBase): if res = numList then isFixed := true: else isFixed := false: fi: return(isFixed): end: #******************************************************************************* getPartitionType := proc(numList) #e.g. [1,1,3,5] should be [2,1,1] local i, num, parts, partitionType: parts:=convert({op(numList)}, list): partitionType := [seq(0, j = 1..nops(parts))]: for i from 1 to nops(parts) do partitionType[i] := numboccur(numList, parts[i]): od: return(partitionType): end: #******************************************************************************* getNumPerms := proc(numList) local partType, numPerms, theLength, i, res: partType := getPartitionType(numList): theLength := nops(numList): res := theLength!: for i from 1 to nops(partType) do res := res/(partType[i]!): od: return(res): end: #******************************************************************************* # this one will make PGF over ALL numbers using the fact that except for fixed points # (and the first number in fullList) e.g. listPhenom([1,2,3,4],10) = listPhenom([3,1,2,4],10): # ? allow for "trivial" list e.g. [1,1,1,1] ? getPGFandOrbits:=proc(theLength, theBase, x) local pgf, curNumIter, maxNumList, maxNum, seenNums, curNum, curNumList, isTrivial, counter, isFixedPoint, numPerms, cur, curOrbits, curOrbit, orbits, orbitList, orb, i, j, elt: if not whattype(theLength) = integer or not whattype(theBase) = integer then return(FAIL, "inputs must all be integers"): fi: pgf := 0: counter := 0: maxNumList := [seq(theBase-1, i=1..theLength)]: maxNum := toBase10(maxNumList, theBase): seenNums := {}: orbits := {}: for curNum from 0 to maxNum do curNumList := convert(curNum, base, theBase): #may not be full length, also in reverse order if nops(curNumList) < theLength then curNumList := extendList(curNumList, theLength): #adds any necessary beginning 0's fi: curNumList:=sort(curNumList): #wlog order doesnt matter if not fixed point isTrivial := checkTriv(curNumList): if not isTrivial then if not curNumList in seenNums then numPerms := getNumPerms(curNumList): counter := counter + numPerms: cur := listPhenom(curNumList, theBase): curNumIter := cur[1]: curOrbit := cur[3]: pgf := pgf + (numPerms * x^curNumIter): seenNums := {op(seenNums), curNumList}: orbits := {op(orbits), curOrbit}: fi: fi: od: orbitList := [op(orbits)]: for i from 1 to nops(orbitList) do orb := orbitList[i]: for j from 1 to nops(orb) do elt := orb[j]: if elt in seenNums then #so it was counted accurately, but all its permutations were counted with complexity 1 instead of 2 numPerms := getNumPerms(elt): pgf := pgf - (numPerms - 1) * x + (numPerms - 1) * x^2: else #so elt not in seenNums, so a perm of it is in seenNums, and so elt itself should have been #complexity 1, but instead counted as 2 pgf := pgf - x^2 + x: fi: od: od: pgf := (1/counter) * pgf: return([pgf, orbits]): end: ################################################################################ LookupProc:=proc(procName) local f: if procName = Help then print(`Help(): The primary help procedure.`): elif procName = Help1 then print(`Help1(): The secondary help procedure.`): elif procName = LookupProc then print(`LookupProc(procName): The lookup procedure.`): elif procName = stringPhenom then print(): print(`stringPhenom(stringNum, myBase) takes as inputs a string (stringNum) representing a positive`): print(`integer, and a base (myBase) in which to perform the procedure on. The "units" of stringNum`): print(`should all be in the range 0 <= unit <= myBase - 1. It is assumed that the stringNum is input`): print(`in such a way that if the maximum digit smaller than myBase has length m (e.g. 12 has length 2)`): print(`then the first m digits of the stringNum represent the first unit, the m+1-st to 2m-th the second`): print(`unit, and so on. Thus in particular the number of digits in stringNum must be a multiple of m, or`): print(`or otherwise an error will be returned. The procedure then does the following:`): print(): print(`Let n denote the length of the number input and S denote the n digits represented by the stringNum.`): print(`Then the minimum possible integer of length n that can be formed from S is subtracted from`): print(`the maximum possible integer, and the result is a new n-digit number. This new number `): print(`then takes the place of the original number, and the process repeats until repetition is encountered.`): print(): print(`The outputs to stringPhenom are [m, orbitSize, orbit, fullList], where m is the number of `): print(`iterations needed until the first element of the terminating orbit is hit, orbit is that orbit ,`): print(`orbit, NumList is a list of all numbers accounted throughout the m iterations, and `): print(`orbitSize is the size of the orbit and fullList is the entire sequence of integers that.`): print(`take place over the course of the procedure.`): print(): print(`For example, stringPhenom("1024", 10) =`): print([8, 1, ["6174"], ["1024", "4086", "8172", "7443", "3996", "6264", "4176", "6174", "6174"]]): print(): elif procName = listPhenom then print(): print(`listPhenom(numList, b) takes as inputs a list numList representing a positive`): print(`integer, and a base (b) in which to perform the procedure on.`): print(`numList represents the input number by giving the coefficients of the`): print(`base b expansion of the number. E.g. the set of inputs ([10,2,1], 11)`): print(`means that the number 10 * 11^2 + 2 * 11 + 1 = 1433 is being input.`): print(`Thus the entries of the list should all be in the range 0 <= unit <= myBase - 1.`): print(): print(`Let l denote the length of the number input (e.g l=nops(numList)), and S denote the mlutiset of `): print(`l digits given in the numList. Then the minimum possible integer of length l`): print(`that can be formed from S is subtracted from the maximum possible integer,`): print(`and the result is a new n-digit number. This new number then takes the place of the original number, `): print(`and the process repeats until repetition is encountered.`): print(): print(`The outputs to listPhenom are [m, orbitSize, orbit, fullList], where m is the number of `): print(`iterations needed until the first element of the terminating orbit is hit, orbit is that orbit ,`): print(`orbit, orbitSize is the size of the orbit and fullList is the entire sequence of integers that.`): print(`take place over the course of the procedure.`): print(): print(`The numbers involved in the output lists orbit and fullList are also represented as lists of`): print(`positive integers which give the coefficients in the base b expansion. `): print(): print(`For example, listPhenom([12,2], 14) =`): print([3, 1, [[4, 9]], [[12, 2], [9, 4], [4, 9], [4, 9]]]): print(): elif procName = phenom then print(): print(`phenom(number, myBase) performs just as listsPhenom(stringNum, myBase) except for that` ): print(`the format of the input number is in this procedure actually just a normal positive integer,`): print(`though the output lists still represent their numbers as lists. `): print(`However, due to the handling of integers which are input with leading zeros, if one `): print(`wants to investigate the phenomenon for an n-digit number using this procedure, `): print(`then the first digit must not be a zero. For this reason, using the procedures`): print(`listPhenom and stringPhenom is preferred (most preferred is listPhenom), and all`): print(`analysis procedures use these versions of the method.`): print(): print(`For example, phenom(972, 10) =`): print([4, 1, [[4, 9, 5]], [[9, 7, 2], [6, 9, 3], [5, 9, 4], [4, 9, 5], [4, 9, 5]]]): print(): elif procName = randomEG then print(): print(`randomEG(l, myBase) outputs the result of listPhenom(numList, myBase)`): print(`where numList is a random l-unit positive integer in base myBase.`): print(): print(`For example, one run of randomEG(4,10) outputs: `): print(randomEG(4,10)): print(): elif procName = allOrbits then print(): print(`allOrbits(l, b, format) outputs a set of all of the terminating orbits`): print(`which numbers written in base b with length l encounter under the 6174 phenomenon.`): print(`format is a string which is either "string" or "list". If it is list, then the positive`): print(`numbers in the orbits are output in the list form of listPhenom, and likewise if it is`): print(`string then the numbers in the orbit are output in string form as in stringPhenom`): print(): print(`For example:`): print(`allOrbits(4, 4, "string")`= {["3021"], ["1332", "2022"]}): print(`allOrbits(4, 4, "list")` = {[[3, 0, 2, 1]], [[1, 3, 3, 2], [2, 0, 2, 2]]}): print(): elif procName = maxOrbitLength then print(): print(`maxOrbitLength(l,b) gives the maximum length of any terminating orbit encountered`): print(`by a positive number input into stringPhenom or listPhenom of length l and base b.`): print(): print(`For example, since allOrbits(4, 4, "string")`= {["3021"], ["1332", "2022"]}): print(`maxOrbitLength(4,4)` = 2): print(): elif procName = moms then print(): print(`moms(f, x, i) takes as an input f a probability generating function/expression`): print(`in the variable x, i.e. of the form `): print('f' = Sum(c[m]*x^m, m=1..n), Sum(c[m], m=1..n) = 1, c[m] in [0,1]): print(`For example, let f = getIterationPGF(b,l,x) for some base b and length l. moms(f,x,i) then `): print(`outputs the i-th standard moment (1 <= i <= 6) of the underlying data set corresponding to f, i.e.`): print(`the average of the underlying data set f'(1) is output by moms(f, x, 1). `): print(): f := getIterationPGF(3,5,x): print(`For example, if f ` = f): print(`Then [seq( moms(f ,x ,i), i = 1..6)]` = [seq(moms(f,x,i), i=1..6)]): print(): elif procName = getIterationPGF then print(): print(`getIterationPGF(l, b, x) outputs a probability generating function f(x) ` = Sum(c[m]*x^m, m=1..n)): print(): print(): print(`where c__m`.` is the fraction of possible non-trivial input numbers to stringPhenom or listPhenom`): print(`which took m iterations to reach a terminating orbit, i.e. such that stringPhenom(numString, b)[1] = m`): print(): print(`By 'non-trivial' it is meant that the input number is a list corresponding to an l-multisest from`): print(`the set S = {0,...,b-1}, which contains at least 2 distinct elements of S. Since there are `): print(`exact b ways of choosing a multiset with exactly 1 distinct element of S, there are a total of `): print(`b^l-b such non-trivial inputs.`): print(): print(`For example: `): print(`getIterationPGF(6, 3, x)` = getIterationPGF(6, 3, x)): print(): elif procName = getSampleIterationPGF then print(): print(`getIterationPGF(l, b, x, n) outputs a sample probability generating function f(x) ` = Sum(c[m]*x^m, m=1..n)): print(): print(): print(`where c__m`.` is the fraction of n random inputs to stringPhenom or listPhenom`): print(`which took m iterations to reach a terminating orbit, i.e. such that stringPhenom(numString, b)[1] = m`): print(): print(`For example: `): print(`getIterationPGF(6, 3, x, 200)` = getSampleIterationPGF(6, 3, x, 200)): print(): elif procName = getPCconjecturesPaperLength4 then print(): print(`For the bases={b1, ..., bN} input to getPCconjecturesPaperLength4(bases) (input can be a set or list`): print(`of bases), the procedure prints the details of the length 4 conjectures which apply`): print(`to those specific bases, and if a given input base is` <= getMaxBasePC(4)): print(`then the conjectures are tested by referring to the length4 database (see Help(length4orbits)).`): print(): print(`In particular for length 4 there are conjectures for the following families of bases:`): print(): print(`-odd bases b >= 5.`): print(`-bases b >= 2^2 which are powers of 2.`): print(`-bases b >= 3*2 which are of the form 3*2^n.`): print(`-bases b >= 5*2 which are of the form 5*2^n.`): print(`-bases b >= 7*2 which are of the form 7*2^n.`): print(`-bases b >= 3^2 which are powers of 3.`): print(): print(`For example, try getPCconjecturesPaperLength4({5,8,16}) and getPCconjecturesPaperLength4({4,10,64})`): print(): elif procName = getPCconjecturesPaperLength3 then print(): print(`For the bases={b1, ..., bN} input to getPCconjecturesPaperLength3(bases) (input can be a set or list`): print(`of bases), the procedure prints the details ofthe length 3 conjectures which apply`): print(`to those specific bases, and if the input base is` <= getMaxBasePC(3)): print(`then the conjectures are tested by referring to the length3 database (see Help(length3orbits)).`): print(): print(`In particular for length 3 there are conjectures for the following families of bases:`): print(): print(`-odd bases.`): print(`-even bases.`): print(): print(`For example, try getPCconjecturesPaperLength3({2,6,12})`): print(): elif procName = getPCconjecturesPaper then print(): print(`Let B be a set or list of bases and let L be a set or list of lengths, or L = "all" if`): print(`the user wishes to see/test the conjectures for all of the lengths for which there are`): print(`conjectures in this program. Then:`): print(): print(`getPCconjecturesPaper(L, B) prints the details of the conjectures which apply`): print(`to the specific bases input for all of the lengths in L, and if`): print(`a given base is small enough such that there is pre-computed data available in the`): print(`databases for each length (for example in the length3orbits database for length 3, then`): print(`the conjectures are tested for that base by referring to the corresponding databases.`): print(): print(`See Help(getPCconjecturesPaperLength3) and Help(getPCconjecturesPaperLength4)`): print(`for more information about which bases there are conjectures for.`): print(): print(`For example, try getPCconjecturesPaper("all", {4,7,10,13,16})`): print(): elif procName = getNPCconjecturesPaperLength4 then print(): print(`prints the same 'paper' as getPCconjecturesPaperLength4, except for that it computes`): print(`the data on which to test the conjectures for the input bases from scratch,`): print(`using the allOrbits procedure.`): print(): print(`See Help(getPCconjecturesPaperLength4) for more details.`): print(): print(`For example, try getNPCconjecturesPaperLength4({5,8,12})`): print(): elif procName = getNPCconjecturesPaperLength3 then print(): print(`prints the same 'paper' as getPCconjecturesPaperLength3, except for that it computes`): print(`the data on which to test the conjectures for the input bases from scratch,`): print(`using the allOrbits procedure.`): print(): print(`See Help(getPCconjecturesPaperLength3) for more details.`): print(): print(`For example, try getNPCconjecturesPaperLength3({7,8,9})`): print(): elif procName = getNPCconjecturesPaper then print(): print(`prints the same 'paper' as getPCconjecturesPaper, except for that it computes`): print(`the data on which to test the conjectures for the input bases from scratch,`): print(`using the allOrbits procedure.`): print(): print(`See Help(getPCconjecturesPaper) for more details.`): print(): print(`For example, try getNPCconjecturesPaper("all", {4,7,10,13,16})`): print(): elif procName = verifyOddBaseLength3Theorems then print(): print(`For the odd base b input to verifyOddBaseLength3Theorems(b, isPreComputed), this `): print(`procedure verifies that the Odd Base length 3 theorems are true. `): print(`See Help(theOddBaseLength3Theorems) for a description of the theorems.`): print(`Upon verifying the theorems the procedure returns 'true'; if they were to fail it would return 'false'.`): print(`If the boolean value isPrecomputed = true, the procedure uses the internal database `): print(`length3Orbits(b) to determine the truth of the theorem. Otherwise (if isPreComputed = false)`): print(`the procedure verifies the theorem "from scratch" using the allOrbits method.`): print(): print(`For example, verifyOddBaseLength3Theorems(11, true)` = verifyOddBaseLength3Theorems(13, true)): print(): elif procName = verifyEvenBaseLength3Theorems then print(): print(`For the even base b input to verifyEvenBaseLength3Theorems(b, isPreComputed), this `): print(`procedure verifies that the Even Base length 3 conjectures are true. `): print(`See Help(theEvenBaseLength3Theorems) for a description of the theorems.`): print(`Upon verifying the theorems the procedure returns 'true'; if they were to fail it would return 'false'.`): print(`If the boolean value isPrecomputed = true, the procedure uses the internal database `): print(`length3Orbits(b) to determine the truth of the theorem. Otherwise (if isPreComputed = false)`): print(`the procedure verifies the theorem "from scratch" using the allOrbits method.`): print(): print(`For example, verifyEvenBaseLength3Theorems(14, true)` = verifyEvenBaseLength3Theorems(14, true)): print(): elif procName = verify2PowerLength4Conjectures then print(): print(`For the base b >= 2^2 which is a power of 2 input to verify2PowerLength4Conjectures(b, isPreComputed),`): print(`this procedure determines whether or not all of the base 2-Power, length 4 conjectures are true. `): print(`See Help(the2PowerLength4Conjectures) for a description of the conjectures.`): print(`If they are all true then the procedure returns 'true'; otherwise it returns 'false'.`): print(`If the boolean value isPrecomputed = true, the procedure uses the internal database `): print(`length4Orbits(b) to determine the truth of the conjecture. Otherwise (if isPreComputed = false)`): print(`the procedure verifies the conjecture "from scratch" using the allOrbits method.`): print(): print(`For example, verify2PowerLength4Conjectures(8, true)` = verify2PowerLength4Conjectures(8, true)): print(): elif procName = verify3x2PowerLength4Conjectures then print(): print(`For the base b >= 3*2 which is of the form 3*2^n input to verify3x2PowerLength4Conjectures(b, isPreComputed),`): print(`this procedure determines whether or not all of the base 3x2-Power, length 4 conjectures are true. `): print(`See Help(the3x2PowerLength4Conjectures) for a description of the conjectures.`): print(`If they are all true then the procedure returns 'true'; otherwise it returns 'false'.`): print(`If the boolean value isPrecomputed = true, the procedure uses the internal database `): print(`length4Orbits(b) to determine the truth of the conjecture. Otherwise (if isPreComputed = false)`): print(`the procedure verifies the conjecture "from scratch" using the allOrbits method.`): print(): print(`For example, verify3x2PowerLength4Conjectures(12, true)` = verify3x2PowerLength4Conjectures(12, true)): print(): elif procName = verify5x2PowerLength4Theorems then print(): print(`For the base b >= 5*2 which is of the form 5*2^n input to verify5x2PowerLength4Theorems(b, isPreComputed),`): print(`this procedure verifies that thee base 5x2-Power, length 4 Theorems are true. `): print(`See Help(the5x2PowerLength4Theorems) for a description of the theorems.`): print(`Upon verifying the theorems the procedure returns 'true'; if they were to fail it would return 'false'.`): print(`If the boolean value isPrecomputed = true, the procedure uses the internal database `): print(`length4Orbits(b) to determine the truth of the theorem. Otherwise (if isPreComputed = false)`): print(`the procedure verifies the theorem "from scratch" using the allOrbits method.`): print(): print(`For example, verify5x2PowerLength4Theorems(10, true)` = verify5x2PowerLength4Theorems(10, true)): print(): elif procName = verify7x2PowerLength4Conjectures then print(): print(`For the base b >= 7*2 which is of the form 7*2^n input to verify7x2PowerLength4Conjectures(b, isPreComputed),`): print(`this procedure determines whether or not all of the base 7x2-Power, length 4 conjectures are true. `): print(`See Help(the7x2PowerLength4Conjectures) for a description of the conjectures.`): print(`If they are all true then the procedure returns 'true'; otherwise it returns 'false'.`): print(`If the boolean value isPrecomputed = true, the procedure uses the internal database `): print(`length4Orbits(b) to determine the truth of the conjecture. Otherwise (if isPreComputed = false)`): print(`the procedure verifies the conjecture "from scratch" using the allOrbits method.`): print(): print(`For example, verify7x2PowerLength4Conjectures(14, true)` = verify7x2PowerLength4Conjectures(14, true)): print(): elif procName = verify3PowerLength4Conjectures then print(): print(`For the base b >= 3^2 which is a power of 3 input to verify3PowerLength4Conjectures(b, isPreComputed),`): print(`this procedure determines whether or not all of the base 3-Power, length 4 conjectures are true. `): print(`See Help(the3PowerLength4Conjectures) for a description of the conjectures.`): print(`If they are all true then the procedure returns 'true'; otherwise it returns 'false'.`): print(`If the boolean value isPrecomputed = true, the procedure uses the internal database `): print(`length4Orbits(b) to determine the truth of the conjecture. Otherwise (if isPreComputed = false)`): print(`the procedure verifies the conjecture "from scratch" using the allOrbits method.`): print(): print(`For example, verify3PowerLength4Conjectures(9, true)` = verify3PowerLength4Conjectures(9, true)): print(): elif procName = verifyOddBaseLength4Conjectures then print(): print(`For the odd base b (>= 5) input to verifyOddBaseLength4Conjectures(b, isPreComputed), this `): print(`procedure determines whether or not all of the Odd Base length 4 conjectures are true. `): print(`See Help(theOddBaseLength4Conjectures) for a description of the conjectures.`): print(`If they are all true then the procedure returns 'true'; otherwise it returns 'false'.`): print(`If the boolean value isPrecomputed = true, the procedure uses the internal database `): print(`length4Orbits(b) to determine the truth of the conjecture. Otherwise (if isPreComputed = false)`): print(`the procedure verifies the conjecture "from scratch" using the allOrbits method.`): print(): print(`For example, verifyOddBaseLength4Conjectures(15, true)` = verifyOddBaseLength4Conjectures(15, true)): print(): elif procName = verifyElementsConjecture then print(): print(`For the odd base b (>= 5) input to verifyElementsConjecture(b, isPreComputed), this `): print(`procedure determines whether or not the Elements Conjecture is true (and returns 'true' if it is, `): print(`'false' if it is not.) If the boolean value isPrecomputed = true, the procedure uses the internal database `): print(`length4Orbits(b) to determine the truth of the conjecture. Otherwise (if isPreComputed = false)`): print(`the procedure verifies the conjecture "from scratch" using the allOrbits method.`): print(): print(`For a detailed descriptions of this conjecture, type Help(theOddBaseLength4Conjectures) and refer`): print(`to Conjecture C (Elements Conjecture).`): print(): print(`For example, verifyElementsConjecture(15, true)` = `true`): print(): elif procName = conjecturedOddBaseLength4Elements then print(): print(`For the odd base b (>= 5) input to conjecturedOddBaseLength4Elements(b), this procedure returns the set`): print(`UConj which is conjectured to equal the set U of the union of all of the 4 digit numbers`): print(`which occur in some limiting orbit of the iterative procedure listPhenom for base b and length 4.`): print(`Specifically UCon = {seq(seq([2*k+1, 2*i, 2*(n-i)-1, 2*(n-k)], i=0..k-1), k=1..n-1)}, where n`): print(`is the integer s.t. b = 2*n + 1.`): print(): print(`For example, conjecturedOddBaseLength4Elements(9)` = {[3, 0, 7, 6], [5, 0, 7, 4], [5, 2, 5, 4], [7, 0, 7, 2], [7, 2, 5, 2], [7, 4, 3, 2]} ): print(): elif procName = verifyParityConjecture then print(): print(`For the odd base b (>= 5) input to verifyParityConjecture(b, isPreComputed), this procedure`): print(` determines whether or not the Parity Conjecture is true (and returns 'true' if it is, 'false'`): print(`if it is not.) If the boolean value isPrecomputed = true, the procedure uses the internal database`): print(`length4Orbits(b) to determine the truth of the conjecture. Otherwise (if isPreComputed = false)`): print(`the procedure verifies the conjecture "from scratch" using the allOrbits method.`): print(): print(`For a detailed descriptions of this conjecture, type Help(theOddBaseLength4Conjectures) and refer`): print(`to Conjecture A (Parity Conjecture).`): print(): print(`For example, verifyParityConjecture(15, true)` = `true`): print(): elif procName = verifyOrbitLengthsDivConjecture then print(): print(`For the odd base b (>= 5) input to verifyOrbitLengthsDivConjecture(b, isPreComputed), this procedure`): print(`determines whether or not the Orbit Lengths Division Conjecture is true (and returns 'true' if it is, 'false'`): print(`if it is not). If the boolean value isPrecomputed = true, the procedure uses the internal database`): print(`length4Orbits(b) to determine the truth of the conjecture. Otherwise (if isPreComputed = false)`): print(`the procedure verifies the conjecture "from scratch" using the allOrbits method.`): print(): print(`For a detailed descriptions of this conjecture, type Help(theOddBaseLength4Conjectures) and refer`): print(`to Conjecture B (Orbit Lengths Division Conjecture).`): print(): print(`For example, verifyOrbitLengthsDivConjecture(15, true)` = `true`): print(): elif procName = verifyEvenBaseLength7Conjectures then print(): print(`For the even base b input to verifyEvenBaseLength7Conjectures(b, isPreComputed), this `): print(`procedure determines whether or not the Even Base length 7 conjectures are true for this base. `): print(`See Help(theEvenBaseLength7Conjectures) for a description of the conjectures.`): print(`If they are all true then the procedure returns 'true'; otherwise it returns 'false'.`): print(`If the boolean value isPrecomputed = true, the procedure uses the internal database `): print(`length7Orbits(b) to determine the truth of the conjectures. Otherwise (if isPreComputed = false)`): print(`the procedure verifies the conjectures "from scratch" using the allOrbits method.`): print(): print(`For example, verifyEvenBaseLength7Conjectures(18, true)` = verifyEvenBaseLength7Conjectures(18, true)): print(): elif procName = verifyEvenBaseLength6Proposition then print(): print(`For the even base b input to verifyEvenBaseLength6Proposition(b), this `): print(`procedure determines whether or not the Even Base length 6 proposition is true for this base. `): print(`See Help(theEvenBaseLength6Proposition) for a description of the proposition.`): print(`Upon verification of the proposition the procedure returns true; if it were to fail it wouold return 'false'.`): print(): print(`For example, verifyEvenBaseLength6Proposition(18)` = verifyEvenBaseLength6Proposition(18)): print(): elif procName = randomAnalysis then print(): print(`Given a digit length l and a base b, randomAnalysis(l, b, n) returns`): print(`the set of all limiting orbits encountered through n trials of randomEG(l, b), i.e.`): print(`all limiting orbits encountered by running the listPhenom method n times on a .`): print(`random base b number with l digits.`): print(): print(`For example, randomAnalysis(4, 7*2^3, 100)` = {[[24, 7, 47, 32], [40, 7, 47, 16], [40, 23, 31, 16]], [[7, 55, 55, 48], [48, 6, 48, 8], [42, 39, 15, 14], [28, 23, 31, 28]]}): print(): elif procName = checkOddBaseLength4ConjecturesForRS then print(): print(`For an odd minBase b>=5, checkOddBaseLength4Conjectures(minBase, maxBase, n)`): print(`first runs randomAnalysis(4, b, n) for all odd bases b from minBase to maxBase, producing`): print(`a list s of the results for each b. Then the procedure returns 3 lists.`): print(`The first list corresponds to the Parity Conjecture, the second`): print(`to the Orbit Lengths Division Conjecture, and the third to the Elements Conjecture.`): print(`Each list is itself a list composed of the elements [b, check(o, b)]`): print(`where check(o,b) is true if the corresponding checking procedure`): print(`for o and b is true and false if it is false. For example since the first list `): print(`corresponds to the Parity Conjecture, the elements are [b, checkParityConjecture(o, b)]`): print(`where o is the element (a set of orbits) of s corresponding to base b.`): print(): print(`See Help(theOddBaseLength4Conjectures) for more details on all three conjectures)`): print(): print(`For example, try checkOddBaseLength4ConjecturesForRS(5, 9, 100)`): print(): elif procName = checkOrbitLengthsDivConjecture then print(): print(`Given a set of limiting orbits o corresponding to an odd base b>=5`): print(`checkOrbitLengthsDivConjecture(o) returns true if this set of orbits agrees with the`): print(`Orbit Lengths Division Conjecture and false otherwise.`): print(`See Help(theOddBaseLength4Conjectures) and refer to Conjecture B`): print(`(Orbit Lengths Division Conjecture) for more details on this conjecture)`): print(): print(`For example, try checkOrbitLengthsDivConjecture(randomAnalysis(4, 55, 500), 55)`): print(): elif procName = checkParityConjecture then print(): print(`Given a set of orbits o produced by randomAnalysis(l, b, n), for an odd base b>=5,`): print(`checkParityConjecture(o, b) returns true if this set of orbits agrees with the`): print(`Parity Conjecture and false otherwise.`): print(`For a detailed descriptions of this conjecture, type Help(theOddBaseLength4Conjectures) and refer`): print(`to Conjecture A (Parity Conjecture).`): print(): print(`For example, try checkParityConjecture(randomAnalysis(4, 55, 500), 55)`): print(): elif procName = checkElementsConjecture then print(): print(`Given a set of limiting orbits o corresponding to an odd base b>=5,`): print(`checkElementsConjecture(o, b) returns true if this set of orbits agrees with the`): print(`Elements Conjecture and false otherwise.`): print(`See Help(theOddBaseLength4Conjectures) and refer to Conjecture C (Elements Conjecture)`): print(`for more details on this conjecture.`): print(): print(`For example, try checkElementsConjecture(randomAnalysis(4, 55, 500), 55)`): print(): elif procName = checkOddBaseLength4Conjectures then print(): print(`Given a set of limiting orbits o corresponding to an odd base b>=5,`): print(`checkOddBaseLength4Conjectures(o, b) returns true if this set of orbits agrees with all of the`): print(`odd base length 4 conjectures and false otherwise. See Help(theOddBaseLength4Conjectures) for`): print(`more details on these conjectures.`): print(): print(`For example, try checkOddBaseLength4Conjectures(randomAnalysis(4, 55, 500), 55)`): print(): elif procName = checkOddBaseLength3Theorems then print(): print(`Given a set of limiting orbits o corresponding to an odd base,`): print(`checkOddBaseLength3Theorems(o, b) returns true if this set of orbits agrees with`): print(`the odd base length 3 conjectures and false otherwise. See Help(theOddBaseLength3Theorems) for`): print(`more details on these conjectures.`): print(): print(`For example, try checkOddBaseLength3Theorems({[[21, 44, 23], [22, 44, 22]]}, 45)`): print(): elif procName = checkEvenBaseLength3Theorems then print(): print(`Given a set of limiting orbits o corresponding to an even base,`): print(`checkEvenBaseLength3Theorems(o, b) returns true if this set of orbits agrees with`): print(`the even base length 3 conjectures and false otherwise. See Help(theEvenBaseLength3Theorems) for`): print(`more details on these conjectures.`): print(): print(`For example, try checkEvenBaseLength3Theorems({[[11, 23, 12]]}, 24)`): print(): elif procName = check2PowerLength4Conjectures then print(): print(`Given a set of limiting orbits o corresponding to a base b >= 2^2 which is a power`): print(`of 2, check2PowerLength4Conjectures(o, b) returns true if this set of orbits agrees with the`): print(`2-Power length-4 conjectures and false otherwise.`): print(`See Help(the2PowerLength4Conjectures) for details on this conjecture.`): print(): print(`For example, try check2PowerLength4Conjectures(randomAnalysis(4, 2^4, 200), 2^4)`): print(): elif procName = check3x2PowerLength4Conjectures then print(): print(`Given a set of limiting orbits o corresponding to a base b >= 3*2 which is of the`): print(`form 3*2^k, check3x2PowerLength4Conjectures(o, b) returns true if this set of orbits agrees`): print(`with the 3x2-Power length-4 conjectures and false otherwise.`): print(`Type Help(the3x2PowerLength4Conjectures) for details on this conjecture.`): print(): print(`For example, try check3x2PowerConjecture(randomAnalysis(4, 3*2^3, 200), 3*2^3)`): print(): elif procName = check5x2PowerLength4Theorems then print(): print(`Given a set of limiting orbits o corresponding to a base b >= 5*2 which is of the`): print(`form 5*2^k, check5x2PowerLength4Theorems(o, b) returns true if this set of orbits agrees`): print(`with the 5x2-Power theorems and false otherwise.`): print(`Help(the5x2PowerLength4Theorems) for details on this conjecture.`): print(): print(`For example, try check5x2PowerConjecture(randomAnalysis(4, 5*2^3, 250), 5*2^3)`): print(): elif procName = check7x2PowerLength4Conjectures then print(): print(`Given a set of limiting orbits o corresponding to a base b >= 7*2 which is of the`): print(`form 7*2^k, check7x2PowerLength4Conjectures(o, b) returns true if this set of orbits agrees`): print(`with the 7x2-Power length-4 conjecture and false otherwise.`): print(`Type Help(the7x2PowerLength4Conjectures) for details on this conjecture.`): print(): print(`For example, try check7x2PowerConjecture(randomAnalysis(4, 7*2^2, 200), 7*2^2)`): print(): elif procName = check3PowerLength4Conjectures then print(): print(`Given a set of limiting orbits o corresponding to a base b >= 3^2 which is a power`): print(`of 3, check3PowerLength4Conjectures(o, b) returns true if this set of orbits agrees with the`): print(`3-Power length-4 conjecture and false otherwise.`): print(`Type Help(the3PowerLength4Conjectures) for details on this conjecture.`): print(): print(`For example, try check3PowerLength4Conjectures(randomAnalysis(4, 3^3, 300), 3^3)`): print(): elif procName = checkEvenBaseLength7Conjectures then print(): print(`Given a set of limiting orbits o corresponding to an even base b >= 18`): print(`if b mod 4 = 2 and b >= 24 if b mod 4 = 0, `): print(`checkEvenBaseLength7Conjectures(o, b) returns true if this set of orbits agrees with the`): print(`Even base length 7 conjectures and false otherwise.`): print(`Type Help(theEvenBaseLength7Conjectures) for details on these conjectures.`): print(): print(`For example, try checkEvenBaseLength7Conjectures(randomAnalysis(7, 4*8+2, 300), 4*8+2)`): print(): elif procName = getAllConjectures then print(): print(`States all of the conjectures and theorems contained in the program.`): print(`Type getAllConjectures() to see the contents of this program.`): print(): elif procName = theOddBaseLength4Conjectures then print(): print(`theOddBaseLength4Conjectures(bool) states the conjectures for odd bases and length 4.`): print(`If bool = true the statement includes information about the notation used`): print(`otherwise, it skips this part of the statement.`): print(): print(`To see the conjectures in full, try theOddBaseLength4Conjectures(true)`): print(): elif procName = the2PowerLength4Conjectures then print(): print(`the2PowerLength4Conjectures(bool) states the conjectures for bases which are`): print(`powers of 2 and length 4. If bool = true the statement includes information about the notation used`): print(`otherwise, it skips this part of the statement.`): print(): print(`To see the conjectures in full, try the2PowerLength4Conjectures(true)`): print(): elif procName = the3x2PowerLength4Conjectures then print(): print(`the3x2PowerLength4Conjectures(bool) states the conjectures for bases which are`): print(`of the form 3*2^n and length 4. If bool = true the statement includes information about the notation used`): print(`otherwise, it skips this part of the statement.`): print(): print(`To see the conjectures in full, try the3x2PowerLength4Conjectures(true)`): print(): elif procName = the5x2PowerLength4Theorems then print(): print(`the5x2PowerLength4Theorems(bool) states the conjectures for bases which are`): print(`of the form 5*2^n and length 4. If bool = true the statement includes information about the notation used`): print(`otherwise, it skips this part of the statement.`): print(): print(`To see the conjectures in full, try the5x2PowerLength4Theorems(true)`): print(): elif procName = the7x2PowerLength4Conjectures then print(): print(`the7x2PowerLength4Conjectures(bool) states the conjectures for bases which are`): print(`of the form 7*2^n and length 4. If bool = true the statement includes information about the notation used`): print(`otherwise, it skips this part of the statement.`): print(): print(`To see the conjectures in full, try the7x2PowerLength4Conjectures(true)`): print(): elif procName = the3PowerLength4Conjectures then print(): print(`the3PowerLength4Conjectures(bool) states the conjectures for bases which are`): print(`powers of 3 and length 4. If bool = true the statement includes information about the notation used`): print(`otherwise, it skips this part of the statement.`): print(): print(`To see the conjectures in full, try the3PowerLength4Conjectures(true)`): print(): elif procName = theOddBaseLength3Theorems then print(): print(`theOddBaseLength3Conjectures(bool) states the conjectures for odd bases and length 3.`): print(`If bool = true the statement includes information about the notation used`): print(`otherwise, it skips this part of the statement.`): print(): print(`To see the theorems in full, try theOddBaseLength3Theorems(true)`): print(): elif procName = theEvenBaseLength3Theorems then print(): print(`theEvenBaseLength3Conjectures(bool) states the conjectures for even bases and length 3.`): print(`If bool = true the statement includes information about the notation used`): print(`otherwise, it skips this part of the statement.`): print(): print(`To see the theorems in full, try theEvenBaseLength3Theorems(true)`): print(): elif procName = theEvenBaseLength6Proposition then print(): print(`theEvenBaseLength6Proposition(bool) states the proposition for even bases and length 6.`): print(`If bool = true the statement includes information about general notation used for `): print(`all the conjectures and theorems, otherwise, it skips this part of the statement.`): print(): print(`To see the theorems in full, try theEvenBaseLength6Proposition(false)`): print(): elif procName = theEvenBaseLength7Conjectures then print(): print(`theEvenBaseLength7Conjectures(bool) states the conjectures for even bases and length 7.`): print(`If bool = true the statement includes information about the notation used`): print(`otherwise, it skips this part of the statement.`): print(): print(`To see the theorems in full, try theEvenBaseLength7Proposition(true)`): print(): elif procName = correspondence then #n, t1, t2 print(): print(`As a result of the conjecture that the set U of the union of all of the 4 digit`): print(`numbers which occur in some limiting orbit for base b and length 4 is equal to`): print(`UCon = {seq(seq([2*k+1, 2*i, 2*(n-i)-1, 2*(n-k)], i=0..k-1), k=1..n-1)}, where n is the`): print(` integer s.t. b = 2*n + 1, it falls out that the conjectured size of this set is binomial(n,2).`): print(): print(`In fact, there is an explicit bijection between the 2-subsets of [n] and the elements of UCon`): print(`which is given by the correspondence procedure. In particular correspondence(n,k,m)`): print(`gives the bijective counterpart of the 2-subset of n (k,m). For example:`): print(): print(`correspondence(6,5,3)` = [11, 8, 3, 2]): print(): print(`and one can check that for any integer n >= 2:`): print(`{seq(seq(correspondence(n, k, j), j = 1 .. k-1), k = 1 .. n)} = conjecturedOddBaseLength4Elements(2*n+1)`): print(): elif procName = createStatsPaper then print(): print(`createStatsPaper(filePath) sets up a new statistical summary paper with the given filePath.`): print(`After creating paper, type addStats(, , ) to add the stats for`): print(`the specified length and base to the created file.`): print(): elif procName = singleStatsPaper then print(): print(`singleStatsPaper(theLength, theBase, filePath) creates a file path and the summary `): print(`statistics related to the length and base pair (theLength, theBase).`): print(): print(`If filePath = "null" then it generates a file in the current directory with the file path `): print(`/lengthLbaseB.txt, where L = theLength and B = theBase, and returns the path name.`): print(): print(`In particular, the summary includes the number of limiting orbits, the maximum length orbit,`): print(`the iteration pgf, and the moments corresponding to this pgf.`): print(): elif procName = getSingleStats then print(): print(`getSingleStats(theLength, theBase) performs just as singleStatsPaper, except it outputs`): print(`the stats summary to the maple window.`): print(): print(`For example, try: getSingleStats(3, 10)`): print(): elif procName = addStats then print(): print(`addStats(theLength, theBase, filePath) adds a stats summary of the specified length and base`): print(`pair to the paper located at the specified filePath. `): print(): elif procName = iterate then print(): print(`iterate(numList, myBase) performs one iteration of listPhenom(numList, myBase)`): print(): print(`For example:`): print(`iterate([1,0,7,5],10) ` = iterate([1,0,7,5],10)): print(`because 7510 - 0157 ` = 7510 - 0157): print(): elif procName = getAllElements then #list of lists print(): print(`Given a list of lists L, getAllElements returns the set of all of the `): print(`entries ocurring in some component list, i.e. the union of {op(L[i])} `): print(`for i from 1 to nops(L). For example:`): print(): print(`getAllElements([[1, 2, 3], [5, 7], [22, 5, 3]])` = {1,2,3,5,7,22}): print(): elif procName = length3Orbits then print(): print(`length3Orbits(b) returns the set of all of the limiting orbits possible for the iterative`): print(`method listPhenom for base b and length 3 (pre-computed). Currently this method supports only`): print(`the bases b such that 2 <= b <= 51. For example:`): print(): print(`length3Orbits(32) ` = {[[15,31,16]]}): print(`length3Orbits(15) ` = {[[6, 14, 8], [7, 14, 7]]}): print(): elif procName = length4Orbits then print(): print(`length4Orbits(b) returns the set of all of the limiting orbits possible for the iterative`): print(`method listPhenom for base b and length 4 (pre-computed). Currently this method supports only`): print(`the bases b such that 2 <= b <=51. For example:`): print(): print(`length4Orbits(11) ` = {[[3, 0, 9, 8], [9, 4, 5, 2], [7, 0, 9, 4], [9, 2, 7, 2], [7, 4, 5, 4]], [[5, 0, 9, 6], [9, 0, 9, 2], [9, 6, 3, 2], [7, 2, 7, 4], [5, 2, 7, 6]]}): print(): elif procName = length4Orbits then print(): print(`length7Orbits(b) returns the set of all of the limiting orbits possible for the iterative`): print(`method listPhenom for base b and length 7 (pre-computed). Currently this method supports only`): print(`the bases b such that 2 <= b <=18. For example:`): print(): print(`length7Orbits(9) ` = {[[6, 5, 1, 8, 6, 3, 3], [7, 3, 2, 8, 5, 5, 2]]}): print(): elif procName = lengthsWithConjectures then print(): print(`lengthsWithConjectures() returns the set of all lengths for which there are conjectures`): print(`in this program. Currently, lengthsWithConjectures` = lengthsWithConjectures()): print(): elif procName = getMaxBasePC then print(): print(`getMaxBasePC(length) returns the maximum base for the given length for which the`): print(`limiting orbits have been pre-computed and stored in the corresponding database`): print(`e.g. for length 3 this database is contained in the length3Orbits procecure.`): print(): print(`Currently, these values are: `): print(`Length 3`, getMaxBasePC(3)): print(`Length 4`, getMaxBasePC(4)): print(): elif procName = getOrbitLengths then #getOrbitLengths := proc(orbits) print(): print(`Given a set of orbits o = {o1, o2, ...., oN}, getOrbitLengths(o) returns a`): print(`list of the orbit lengths in increasing order. i.e. if {o_i1, ... , o_iN} = {o1, ..., oN}`): print(`and o_i1 <= ... <= o_iN, then getOrbitLengths(o) = [nops(o_i1), ..., nops(o_iN)].`): print(): print(`For example, getOrbitLengths({[[3, 0, 6, 5], [6, 1, 5, 2], [5, 2, 4, 3]], [[1, 7, 7, 6], [6, 0, 6, 2], [6, 3, 3, 2], [3, 7, 7, 4], [4, 2, 4, 4]]})` = [3,5]): print(`and getOrbitLengths(length4Orbits(16))` = [2,3,4,6]): print(): elif procName = getData then print(): print(`getData(theLength, theBase) returns a list of two elements. The first is the number of distinct`): print(`limiting orbits in A = allOrbits((theLength, theBase, "list"), and the second is the length of the`): print(`longest orbit in that A. For example, since allOrbits(4,4,"list") = {[[3, 0, 2, 1]], [[1, 3, 3, 2], [2, 0, 2, 2]]}`): print(): print(`getData(4,4) = [2,2]`): print(): elif procName = freqList then print(): print(`freqList(L) takes a list as an input and returns a list of pairs`): print(`[n, nF] which ranges over each distinct element n in L, and nF is the ` ): print(`number of times n occurs in L. `): print(): print(`For example:`): print(`freqList([1, 1, 5, 5, 5, -4, -4, 5])` = [[-4, 2], [1, 2], [5, 4]]): print(): elif procName = randomNum then print(): print(`randomNum(l, b) generates a random l-digit number (in list form) in base b.`): print(): print(`For example:`): print(`randomNum(4,10)` = randomNum(4,10)): print(`randomNum(5, 2)` = randomNum(5, 2)): print(): elif procName = baseSubtract then print(): print(`baseSubtract(numList1, numList2, b) performs the subtraction s := num1 - num2, where`): print(`num1 and num2 are the underlying integers represented by the numLists and`): print(`the output result are all in base b`): print(): print(`For example:`): print(`baseSubtract([1,1,1,0],[0,0,1,1],2)` = baseSubtract([1,1,1,0],[0,0,1,1],2)): print(`baseSubtract([2,4,1],[0,3,4],10)` = baseSubtract([2,4,1],[0,3,4],10)): print(): elif procName = toBase10 then print(): print(`toBase10(numList, b) outputs the base 10 equivalent of the number numList input in base b`): print(): print(`For example:`): print(`toBase10([1,0,1,1],2)` = 11): print(`toBase10([2,0,1],3)` = 19): print(): elif procName = rangeAllOrbits then print(): print(`rangeAllOrbits(minLen, maxLen, lenStep, minBase, maxBase, baseStep) outputs (as well as printing on the screen) a list`): print(`where the entries are themselves lists of the form [l, b, allOrbits(l,b, "list")], where l ranges`): print(`over all lengths minLen <= l <= maxLen in steps of lenStep and b ranges over all bases minBase <= b <= maxBase.` ): print(`in steps of baseStep. See Help(allOrbits) for more information.`): print(): print(`For example:`): print(`rangeAllOrbits(2, 4, 1, 3, 5, 1) =`): print(rangeAllOrbits(2, 4, 1, 3, 5, 1)): print(): elif procName = getOrbitsGF then print(): print(`getOrbitsGF(orbs, x) outputs an ordinary generating function g(x) ` = Sum(c[m]*x^m, m=1..n)): print(): print(): print(`where c__m`.` is the possible number of orbits in orbs which have a length of m, `): print(`For example, since orbs := allOrbits(4,4,"list") = {[[3, 0, 2, 1]], [[1, 3, 3, 2], [2, 0, 2, 2]]},`): print(): print(`getOrbitsGF(orbs,x)` = x^2 + x): print(): elif procName = isFixedPoint then print(): print(`isFixedPoint(numList, theBase) returns true if the number represented by numList is a `): print(`fixed point of the Kaprekar routine in base theBase. For example:`): print(): print(`isFixedPoint([4,9,5], 10) = true and isFixedPoint([5,4,3], 10) = false`): print(): else print(`No such procedure exists.`): fi: end: ################################################################################ ### Important Notes / To Do: # ------------------------------ ### Suplementary procedures not yet included in Help (include?) # getNumPerms # getPGFandOrbits:=proc(theLength, theBase, x) # inputsValid := proc(numList, myBase) # randomStringEG # getCanonOrbit # shiftList # checkTriv := proc(numList) # listToString:=proc(numList) # iterateBase10:=proc(number) # subList := proc(aList, begIndex, finalIndex) # checkDivList(list, maxElt) # diffSequence := proc(L) (L = [n1, n2, ..., nN] where ni = [a1, a2, a3, a4]) # print2PowerLength4Conjectures(theBase, verifiable, isPC): # print3x2PowerLength4Conjectures(theBase, verifiable, isPC): # print5x2PowerLength4Theorems(theBase, verifiable, isPC): # print7x2PowerLength4Conjectures(theBase, verifiable, isPC): # print3PowerLength4Conjectures(theBase, verifiable, isPC): # printOddBaseLength4Conjectures(theBase, verifiable, isPC): # printOddBaseLength3Theorems(theBase, verifiable, isPC): # printEvenBaseLength3Theorems(theBase, verifiable, isPC): ################################################################################ #End 6174phenom.txt # ################################################################################