#OK to post #Homework 26, Rebecca Embar #OK to post #Homework 26, Rebecca Embar read `C26.txt`: #3 SGwyt:=proc(a,b) local C,x,c: option remember: C := {seq([x,b],x=0..a-1),seq([a,x],x=0..b-1),seq([a-x,b-x],x=1..min(a,b))}: mex({seq(SGwyt(op(c)),c in C)}): end: #4 FindUP:=proc(L) local n,LCut,L1,p,i,L2: for n from 1 to nops(L) do LCut:=[seq(L[i],i=n..nops(L))]: L1:=[seq(L[i],i=1..n-1)]: for p from 1 to trunc(nops(LCut)/2) do L2:=[seq(LCut[i],i=1..p)]: if LCut=[seq(op(L2),i=1..trunc(nops(LCut)/p)),seq(L2[i],i=1..(nops(LCut) mod p))] then return(L1,L2): fi: od: od: FAIL: end: #5 #First 10 terms of seq(FindUP([seq(SGwyt(i,b)-b,b=0..50)])[2],i=0..10) #i=0 [0] #i=1 [1,1,-2] #i=2 [2,-1,-1] #i=3 [2,3,-2,-4,3,-2] #i=4 [-1,3,1,-1,3,1,-5,3,1,-1,-5,1] #i=5 [-2,2,3,-2,2,3,-2,2,-6,-2,2,3,-2,2,3,-2,2,3,-7,2,3,-2,2,-7] #i=6 [4,4,4,4,4,-8,-8,4,4,4,-8,-8] #i=7 [5,-3,-8], #i=8 [6,-4,-4,5,5,-3,4,6,-5,5,-3,5,5,5,-9,-11,-4,6,6,6,-5,-10,-3,-3], #i=9 [-3,-6,-4,6,-5,5,7,-3,6,6,-5,-5,6,-6,-6,-3,4,-6,7,-3,6,6,2,-6] #6 #FindUP([seq(SGwyt(5,b)-b,b=0..300)]) outputs #L1=[5, 2, 2, -3, 2, 3, 4, -6, -6, -2, 2, 3, -3, 2, 3, -2, 2, -6, -2, 2, 3, -2, 2, 3, -2, 2, -6] #L2=[-2, 2, 3, -2, 2, 3, -2, 2, -6, -2, 2, 3, -2, 2, 3, -2, 2, 3, -7, 2, 3, -2, 2, -7] #So conjecturally, after the first 27 entries for b from 0 to 26, #SGwyt(5,b)-b follows the pattern given in L2, which has 24 entries #(10^100-26) mod 24 = 14, and L2[14]=2 #So SGwyt(5,10^100)=2+10^100