#============================================================================ # Daniel J. Greenhoe # b-file to support the sequence A289358, # "The sequence a(n,m) of the m polynomial coefficients # of the n-th order B-spline scaled by n!, # read by rows, with n in {0,1,2,...} and m in {1,2,3,...,(n+1)^2}". # # The n-th order B-spline N_n(x) may be calculated with the expression # N_n(x) = (1/n!) Sum_{k=0..n+1} (-1)^k binomial(n+1,k) (x-k)^n step(x-k) # where # * n! is n factorial defined as n! = n(n-1)(n-2)...(1) # * binomial(n,k) is the binomial coefficient and may be defined as # binomial(n,k)=n!/[(n-k)!k!] # * step(x) is the step function defined as step(x) = {1 for x>= 0 # {0 otherwise # # From these definitions, it is apparent that the coefficients of # of the polynomials induced by n!N_n(x) are integers and can be "flattened" # (as in the Pascal triangle sequence https://oeis.org/A007318) # to form an integer sequence, part of which is listed below. # # Example: # -------- # The (n+1)^2 coefficients for the n-th order B-spline N_n(x) # begin at the sequence index value p=Sum_{k=0..n}k^2=(1/6)n(n+1)(2n+1) # and end at index value p+(n+1)^2-1. # Each set of (n+1)^2 coefficients for n=0,1,2,... can be written as an # (n+1)x(n+1) square matrix A_n such that ... # # A_0 = [1] for n=0 (index values 0 to 0) # # A_1 = [ 1 0] for n=1 (index values 1 to 4) # [-1 2] # # [ 1 0 0 ] # A_2 = [-2 6 -3 ] for n=2 (index values 5 to 13) # [ 1 -6 9 ] # # [ 1 0 0 0] # A_3 = [ -3 12 -12 4] for n=3 (index values 14 to 29) # [ 3 -24 60 -44] # [ -1 12 -48 64] # # That is, the sequence of integers induces a sequence of # (n+1)x(n+1) sequare matrices (A_0,A_1,A_2,...). # Taking the n=3 case for example, the coefficients for N_3(x) # begin at index value p=0+1+4+9=14 # and end at index value p+4^2-1=29. # Using these coefficients yields the following expression for N_3(x): # # [ 1 0 0 0 : for 0 <= x < 1] [x^3] # 3!N_3(x) = [-3 12 -12 4 : for 1 <= x < 2] [x^2] # [ 3 -24 60 -44 : for 2 <= x < 3] [ x ] # [-1 12 -48 64 : for 3 <= x < 4] [ 1 ] # [ 0 0 0 0 : otherwise ] # # { x^3 :for 0 <= x < 1 # {-3x^3 +12x^2 -12x + 4 :for 1 <= x < 2 # = { 3x^3 -24x^2 +60x -44 :for 2 <= x < 3 # {- x^3 +12x^2 -48x +64 :for 3 <= x < 4 # { 0 :otherwise # # # Maxima script: # ------------- # n:2; # Nnx:(1/n!)*sum((-1)^k*binomial(n+1,k)*(x-k)^n*unit_step(x-k),k,0,n+1); # assume(x<=0); print(n!,"N(x)= ",expand(n!*Nnx)," for x<=0"); forget(x<=0); # for i:0 thru n step 1 do( # assume(x>i,x<(i+1)), # print(n!,"N(x)= ",expand(n!*Nnx)," for ",i,"i,x<(i+1)) # ); # assume(x>(n+1)); print(n!,"N(x)= ",expand(n!*Nnx)," for x>",n+1); forget(x>(n+1)); # # Key-words: # --------- # sign, B-splines, polynomial coefficients, binomial coefficient, step function # # References: # ----------- # (1) Ole Christensen, Frames and bases: An Introductory Course, 2008, # isbn13:9780817646776, page 142, Theorem 6.1.3. # (2) Charles K. Chui, An Introduction to Wavelets, 1992, # isbn13: 9780121745844, page 84, equation (4.1.12), # http://books.google.com/books?vid=ISBN0121745848&pg=PA84 # (3) Daniel J. Greenhoe, Wavelet Structure and Design, 2013, # isbn13: 9780983801139, page 318, Theorem H.1 # (4) Daniel J. Greenhoe, # B-splines and B-spline wavelets; Technical Report [version 0.20], # July 2017, https://www.researchgate.net/publication/318110604 #============================================================================ #---------------------------------------------------------------------------- # (0+1)^2=1 coefficients for scaled n=0 order B-spline # 0! N_0(x) = N_0(x) = { 1 for 0 <= x < 1 # { 0 otherwise # k=n # index values start at p = SUM k^2 = n(n+1)(2n+1)/6 = 0 # k=0 # and end at p+(n+1)^2 -1 = 0 #---------------------------------------------------------------------------- 0 1 #---------------------------------------------------------------------------- # (1+1)^2 = 4 coefficients for scaled n=1 order B-spline # 1! N_1(x) = N_1(x) = { x + 0 for 0 <= x < 1 # { -x + 2 for 1 <= x < 2 # { 0 otherwise # k=n # index values start at p = SUM k^2 = n(n+1)(2n+1)/6 = 1 # k=0 # and end at p+(n+1)^2 -1 = 4 #---------------------------------------------------------------------------- 1 1 2 0 3 -1 4 2 #---------------------------------------------------------------------------- # (1+2)^2 = 9 coefficients for scaled n=2 order B-spline # 2! N_2(x) = 2N_2(x) = { x^2 + 0x + 0 for 0 <= x < 1 # { -2x^2 + 6x - 3 for 1 <= x < 2 # { x^2 - 6x + 9 for 2 <= x < 3 # { 0 otherwise # k=n # index values start at p = SUM k^2 = n(n+1)(2n+1)/6 = 5 # k=0 # and end at p+(n+1)^2 -1 = 13 #---------------------------------------------------------------------------- 5 1 6 0 7 0 8 -2 9 6 10 -3 11 1 12 -6 13 9 #---------------------------------------------------------------------------- # (1+3)^2 = 16 coefficients for scaled n=3 order B-spline # 3! N_3(x) = 6N_3(x) = { x^3 + 0x^2 + 0x + 0 for 0 <= x < 1 # { -3x^3 + 12x^2 - 12x + 4 for 1 <= x < 2 # { 3x^3 - 24x^2 + 60x -44 for 2 <= x < 3 # { -x^3 + 12x^2 - 48x +64 for 3 <= x < 4 # { 0 otherwise # k=n # index values start at p = SUM k^2 = n(n+1)(2n+1)/6 = 14 # k=0 # and end at p+(n+1)^2 -1 = 29 #---------------------------------------------------------------------------- 14 1 15 0 16 0 17 0 18 -3 19 12 20 -12 21 4 22 3 23 -24 24 60 25 -44 26 -1 27 12 28 -48 29 64 #---------------------------------------------------------------------------- # (1+4)^2 = 25 coefficients for scaled n=4 order B-spline # 4! N_4(x) =24N_4(x) = { x^4 + 0x^3 + 0x^2 + 0x + 0 for 0 <= x < 1 # {-4x^4 + 20x^3 - 30x^2 + 20x - 5 for 1 <= x < 2 # { 6x^4 - 60x^3 +210x^2 -300x + 155 for 2 <= x < 3 # {-4x^4 + 60x^3 -330x^2 +780x - 655 for 3 <= x < 4 # { x^4 - 20x^3 +150x^2 -500x + 625 for 4 <= x < 5 # { 0 otherwise # k=n # index values start at p = SUM k^2 = n(n+1)(2n+1)/6 = 30 # k=0 # and end at p+(n+1)^2 -1 = 54 #---------------------------------------------------------------------------- 30 1 31 0 32 0 33 0 34 0 35 -4 36 20 37 -30 38 20 39 -5 40 6 41 -60 42 210 43 -300 44 155 45 -4 46 60 47 -330 48 780 49 -655 50 1 51 -20 52 150 53 -500 54 625 #---------------------------------------------------------------------------- # (1+5)^2 = 36 coefficients for scaled n=5 order B-spline # 5! N_5(x) =120N_5(x) # k=n # index values start at p = SUM k^2 = n(n+1)(2n+1)/6 = 55 # k=0 # and end at p+(n+1)^2 -1 = 90 #---------------------------------------------------------------------------- 55 1 56 0 57 0 58 0 59 0 60 0 61 -5 62 30 63 -60 64 60 65 -30 66 6 67 10 68 -120 69 540 70 -1140 71 1170 72 -474 73 -10 74 180 75 -1260 76 4260 77 -6930 78 4386 79 5 80 -120 81 1140 82 -5340 83 12270 84 -10974 85 -1 86 30 87 -360 88 2160 89 -6480 90 7776 #---------------------------------------------------------------------------- # (1+6)^2 = 49 coefficients for scaled n=6 order B-spline # 6! N_6(x) =720N_6(x) # k=n # index values start at p = SUM k^2 = n(n+1)(2n+1)/6 = 91 # k=0 # and end at p+(n+1)^2 -1 = 139 #---------------------------------------------------------------------------- 91 1 92 0 93 0 94 0 95 0 96 0 97 0 98 -6 99 42 100 -105 101 140 102 -105 103 42 104 -7 105 15 106 -210 107 1155 108 -3220 109 4935 110 -3990 111 1337 112 -20 113 420 114 -3570 115 15680 116 -37590 117 47040 118 -24178 119 15 120 -420 121 4830 122 -29120 123 96810 124 -168000 125 119182 126 -6 127 210 128 -3045 129 23380 130 -100065 131 225750 132 -208943 133 1 134 -42 135 735 136 -6860 137 36015 138 -100842 139 117649 #---------------------------------------------------------------------------- # (1+7)^2 = 64 coefficients for scaled n=7 order B-spline # 7! N_7(x) =5040N_7(x) # k=n # index values start at p = SUM k^2 = n(n+1)(2n+1)/6 = 140 # k=0 # and end at p+(n+1)^2 -1 = 203 #---------------------------------------------------------------------------- 140 1 141 0 142 0 143 0 144 0 145 0 146 0 147 0 148 -7 149 56 150 -168 151 280 152 -280 153 168 154 -56 155 8 156 21 157 -336 158 2184 159 -7560 160 15400 161 -18648 162 12488 163 -3576 164 -35 165 840 166 -8400 167 45360 168 -143360 169 267120 170 -273280 171 118896 172 35 173 -1120 174 15120 175 -111440 176 483840 177 -1238160 178 1733760 179 -1027984 180 -21 181 840 182 -14280 183 133560 184 -741160 185 2436840 186 -4391240 187 3347016 188 7 189 -336 190 6888 191 -78120 192 528920 193 -2135448 194 4753336 195 -4491192 196 -1 197 56 198 -1344 199 17920 200 -143360 201 688128 202 -1835008 203 2097152 #---------------------------------------------------------------------------- # (1+8)^2 = 81 coefficients for scaled n=8 order B-spline # 8! N_8(x) =40320 N_8(x) # k=n # index values start at p = SUM k^2 = n(n+1)(2n+1)/6 = 204 # k=0 # and end at p+(n+1)^2 -1 = 284 #---------------------------------------------------------------------------- 204 1 205 0 206 0 207 0 208 0 209 0 210 0 211 0 212 0 213 -8 214 72 215 -252 216 504 217 -630 218 504 219 -252 220 72 221 -9 222 28 223 -504 224 3780 225 -15624 226 39690 227 -64008 228 64260 229 -36792 230 9207 231 -56 232 1512 233 -17388 234 111384 235 -436590 236 1079064 237 -1650348 238 1432872 239 -541917 240 70 241 -2520 242 39060 243 -340200 244 1821330 245 -6146280 246 12800340 247 -15082200 248 7715619 249 -56 250 2520 251 -49140 252 541800 253 -3691170 254 15903720 255 -42324660 256 63667800 257 -41503131 258 28 259 -1512 260 35532 261 -474264 262 3929310 263 -20674584 264 67410252 265 -124449192 266 99584613 267 -8 268 504 269 -13860 270 217224 271 -2121210 272 13208328 273 -51179940 274 112731192 275 -107948223 276 1 277 -72 278 2268 279 -40824 280 459270 281 -3306744 282 14880348 283 -38263752 284 43046721