> #There are 4 Attendance Problems ; > ; > #Q1 ; > #Let K be the 3-digit number consisting of your 3rd, 4th, 5th RUID digits, what is g(K) ; > ; > #K = 900 ; > #g(K) = g(899)+g(897)+g(896) = g(898)+g(896)+g(895)+g(986)+g(894)+g(893)+g(985)+g(893)+g(892) =... ; > ; > #Q2 ; > #Is {g(n)} in the OEIS? IF YES WHAT IS THE A-number IF NOT ; > #Should be? ; > > #we know g(n) = 1, 1, 0, 1 (n = 0, 1, 2, 3) ; > #g(4) = g(3)+g(1)+g(0) = 3 ; > #g(5) = g(4)+g(2)+g(1) = 4 ; > #g(6) = g(5)+g(3)+g(2) = 5 ; > #g(7) = g(6)+g(4)+g(3) = 9 ; > #g(8) = g(7)+g(5)+g(4) = 16... ; > #Search 1,1,0,1,3,4,5,9,16 found no result on OEIS ; > #It should be. ; > ; > #Q3 ; > #For i=3,4,5... ; > #Compute SeqRec([[1$i],[0$(i-1),1]],30); > #Find whether these sequences are in the oeis ; > #Find their A-numbers ; > #What is the smallest i for which this sequence is not in the oeis? ; > #Should it be? ; > ; > Rec:=proc(P,n) local L, INI,k,i: > option remember: > > #We first unpack P > L:=P[1]: > INI:=P[2]: > > k:=nops(L): > > if nops(INI)<>k then > print(INI, `should have`, k, `entries `): > RETURN(FAIL): > fi: > > > if n #For this case we use the initial condition, since list in Maple start at index 1, we need to access INI[n+1] > RETURN(INI[n+1]): > else > #We use the definig recurrence > add(L[i]*Rec(P,n-i),i=1..k): > fi: > > end: > SeqRec:=proc(P,N) local n: > [seq(Rec(P,n),n=0..N)]: > end: > SeqRec([[1$3],[0$(3-1),1]],30) [0, 0, 1, 1, 2, 4, 7, 13, 24, 44, 81, 149, 274, 504, 927, 1705, 3136, 5768, 10609, 19513, 35890, 66012, 121415, 223317, 410744, 755476, 1389537, 2555757, 4700770, 8646064, 15902591] ; > #IN THE OEIS, A-NUMBER IS A000073 ; > ; > SeqRec([[1$4],[0$(4-1),1]],30) [0, 0, 0, 1, 1, 2, 4, 8, 15, 29, 56, 108, 208, 401, 773, 1490, 2872, 5536, 10671, 20569, 39648, 76424, 147312, 283953, 547337, 1055026, 2033628, 3919944, 7555935, 14564533, 28074040] ; > #IN THE OEIS, A-NUMBER IS A000078 ; > SeqRec([[1$5],[0$(5-1),1]],30) [0, 0, 0, 0, 1, 1, 2, 4, 8, 16, 31, 61, 120, 236, 464, 912, 1793, 3525, 6930, 13624, 26784, 52656, 103519, 203513, 400096, 786568, 1546352, 3040048, 5976577, 11749641, 23099186] ; > #IN THE OEIS, A-NUMBER IS A001591 ; > SeqRec([[1$14],[0$(14-1),1]],30) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16383, 32765, 65528] ; > #the smallest i for this sequence is not in the oeis is 14, it should be ; > ; > #Q4 ; > #Let a := 2nd digit of your ruid (0->1) b := 7th digit ; > #What is the 100th term of #GFseq(1/1-x^a-x^b) ; > ; > GFseq:=proc(f,x,N) local f1,i: > f1:=taylor(f,x=0,N+1): > [seq(coeff(f1,x,i),i=0..N)]: > end: > GFseq(x/(1-x^7-x^5),x,100); [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 2, 0, 1, 1, 0, 3, 0, 3, 1, 1, 4, 0, 6, 1, 4, 5, 1, 10, 1, 10, 6, 5, 15, 2, 20, 7, 15, 21, 7, 35, 9, 35, 28, 22, 56, 16, 70, 37, 57, 84, 38, 126, 53, 127, 121, 95, 210, 91, 253, 174, 222, 331, 186, 463, 265, 475, 505, 408, 794, 451, 938, 770, 883, 1299, 859, 1732, 1221, 1821, 2069, 1742, 3031, 2080, 3553, 3290, 3563, 5100, 3822, 6584, 5370, 7116, 8390, 7385, 11684, 9192, 13700, 13760, 14501, 20074] ; > #So the 100th term is 14501 ;