Skip to main content
added 386 characters in body
Source Link
Artes
  • 57.9k
  • 13
  • 159
  • 247

Implicitly assumingAssuming that one deals with series expansion around $(s,t)=(0,0)$ we can define

cf[k_, n_] := 
  Series[1/Sqrt[(1 - t^2) (1 - s^2 t^2)], {s, 0, 2 k}, {t, 0, 2 n}] // 
  Normal // Coefficient[#, s^(2 k) t^(2 n)] &

We have defined cf to get only even coefficients (2k), (2n), since the others do vanish.

e.g.

cf[4, 6]
105/1024
Table[cf[k, n], {k, 6}, {n, 6}] // MatrixForm

enter image description here

One can get the same with Array as well

Array[cf[#1, #2]Array[ &cf, {6, 6}] == Table[cf[kTable[ cf[k, n], {k, 6}, {n, 6}]
True

This appraoch would be satisfactory for small {n, k}. For bigger ones there is SeriesCoefficient (as another answer recalled).

sf[k_, n_]:= SeriesCoefficient[ 1/Sqrt[(1 - t^2) (1 - s^2 t^2)], {s, 0, 2k}, {t, 0, 2n}]

Array[ cf, {6, 6}] == Array[ sf, {6, 6}]
True

And sf is much better than cf:

AbsoluteTiming[sf[350, 400];]
{0.0015182, Null}
AbsoluteTiming[cf[350, 400];]
{10.2873, Null}

Implicitly assuming that one deals with series expansion around $(s,t)=(0,0)$ we can define

cf[k_, n_] := 
  Series[1/Sqrt[(1 - t^2) (1 - s^2 t^2)], {s, 0, 2 k}, {t, 0, 2 n}] // 
  Normal // Coefficient[#, s^(2 k) t^(2 n)] &

We have defined cf to get only even coefficients (2k), (2n), since the others do vanish.

e.g.

cf[4, 6]
105/1024
Table[cf[k, n], {k, 6}, {n, 6}] // MatrixForm

enter image description here

One can get the same with Array as well

Array[cf[#1, #2] &, {6, 6}] == Table[cf[k, n], {k, 6}, {n, 6}]
True

Assuming that one deals with series expansion around $(s,t)=(0,0)$ we can define

cf[k_, n_] := 
  Series[1/Sqrt[(1 - t^2) (1 - s^2 t^2)], {s, 0, 2 k}, {t, 0, 2 n}] // 
  Normal // Coefficient[#, s^(2 k) t^(2 n)] &

We have defined cf to get only even coefficients (2k,2n), since the others do vanish.

Table[cf[k, n], {k, 6}, {n, 6}] // MatrixForm

enter image description here

One can get the same with Array as well

Array[ cf, {6, 6}] == Table[ cf[k, n], {k, 6}, {n, 6}]
True

This appraoch would be satisfactory for small {n, k}. For bigger ones there is SeriesCoefficient (as another answer recalled).

sf[k_, n_]:= SeriesCoefficient[ 1/Sqrt[(1 - t^2) (1 - s^2 t^2)], {s, 0, 2k}, {t, 0, 2n}]

Array[ cf, {6, 6}] == Array[ sf, {6, 6}]
True

And sf is much better than cf:

AbsoluteTiming[sf[350, 400];]
{0.0015182, Null}
AbsoluteTiming[cf[350, 400];]
{10.2873, Null}
deleted 66 characters in body
Source Link
Artes
  • 57.9k
  • 13
  • 159
  • 247

Implicitly assuming that one deals with series expansion around $(s,t)=(0,0)$ we can define

cf[k_, n_] := 
  Series[1/Sqrt[(1 - t^2) (1 - s^2 t^2)], {s, 0, 2 k}, {t, 0, 2 n}] // 
  Normal // Coefficient[#, s^(2 k) t^(2 n)] &

We have defined cf to get only even coefficients (2k), (2n), since the others do vanish.

e.g.

cf[4, 6]
105/1024
Table[ cf[kTable[cf[k, n], {k, 6}, {n, 6}] // MatrixForm
{{1/2, 1/4, 3/16, 5/32, 35/256, 63/512}, 
 {0, 3/8, 3/16, 9/64, 15/128, 105/1024}, 
 {0, 0, 5/16, 5/32, 15/128, 25/256}, 
 {0, 0, 0, 35/128, 35/256, 105/1024}, 
 {0, 0, 0, 0, 63/256, 63/512},
 {0, 0, 0, 0, 0, 231/1024}}

enter image description here

One can get the same with Array as well

Array[cf[#1, #2] &, {6, 6}] == Table[cf[k, n], {k, 6}, {n, 6}]
True

Implicitly assuming that one deals with series expansion around $(s,t)=(0,0)$ we can define

cf[k_, n_] := 
  Series[1/Sqrt[(1 - t^2) (1 - s^2 t^2)], {s, 0, 2 k}, {t, 0, 2 n}] // 
  Normal // Coefficient[#, s^(2 k) t^(2 n)] &

e.g.

cf[4, 6]
105/1024
Table[ cf[k, n], {k, 6}, {n, 6}]
{{1/2, 1/4, 3/16, 5/32, 35/256, 63/512}, 
 {0, 3/8, 3/16, 9/64, 15/128, 105/1024}, 
 {0, 0, 5/16, 5/32, 15/128, 25/256}, 
 {0, 0, 0, 35/128, 35/256, 105/1024}, 
 {0, 0, 0, 0, 63/256, 63/512},
 {0, 0, 0, 0, 0, 231/1024}}

One can get the same with Array as well

Array[cf[#1, #2] &, {6, 6}] == Table[cf[k, n], {k, 6}, {n, 6}]
True

Implicitly assuming that one deals with series expansion around $(s,t)=(0,0)$ we can define

cf[k_, n_] := 
  Series[1/Sqrt[(1 - t^2) (1 - s^2 t^2)], {s, 0, 2 k}, {t, 0, 2 n}] // 
  Normal // Coefficient[#, s^(2 k) t^(2 n)] &

We have defined cf to get only even coefficients (2k), (2n), since the others do vanish.

e.g.

cf[4, 6]
105/1024
Table[cf[k, n], {k, 6}, {n, 6}] // MatrixForm

enter image description here

One can get the same with Array as well

Array[cf[#1, #2] &, {6, 6}] == Table[cf[k, n], {k, 6}, {n, 6}]
True
deleted 6 characters in body
Source Link
Artes
  • 57.9k
  • 13
  • 159
  • 247

Implicitly assuming that one deals with series expansion around $(s,t)=(0,0)$ we can define

cf[k_, n_] := Series[Sqrt[
  Series[1/Sqrt[(1 - t^2) (1 - s^2 t^2)], {s, 0, 2 k}, {t, 0, 2 n}] // 
                Normal // Coefficient[#, s^(2 k) t^(2 n)] &

e.g.

cf[4, 6]
5105/1024
Table[ cf[k, n], {k, 6}, {n, 6}]
{{-(1/2), 1/4, 13/16, 15/32, 535/256, 763/512}, 
 {0, -(13/8), 13/16, 19/64, 115/128, 5105/1024}, 
 {0, 0, -(15/16), 15/32, 115/128, 125/256}, 
 {0, 0, 0, -(535/128), 535/256, 5105/1024}, 
 {0, 0, 0, 0, -(763/256), 763/512}, 
 {0, 0, 0, 0, 0, -(21231/1024)}} 

One can get the same with Array as well

Array[cf[#1, #2] &, {6, 6}] == Table[cf[k, n], {k, 6}, {n, 6}]
True

Implicitly assuming that one deals with series expansion around $(s,t)=(0,0)$ we can define

cf[k_, n_] := Series[Sqrt[(1 - t^2) (1 - s^2 t^2)], {s, 0, 2 k}, {t, 0, 2 n}] // 
                Normal // Coefficient[#, s^(2 k) t^(2 n)] &

e.g.

cf[4, 6]
5/1024
Table[ cf[k, n], {k, 6}, {n, 6}]
{{-(1/2), 1/4, 1/16, 1/32, 5/256, 7/512}, 
 {0, -(1/8), 1/16, 1/64, 1/128, 5/1024}, 
 {0, 0, -(1/16), 1/32, 1/128, 1/256}, 
 {0, 0, 0, -(5/128), 5/256, 5/1024}, 
 {0, 0, 0, 0, -(7/256), 7/512}, 
 {0, 0, 0, 0, 0, -(21/1024)}} 

One can get the same with Array as well

Array[cf[#1, #2] &, {6, 6}] == Table[cf[k, n], {k, 6}, {n, 6}]
True

Implicitly assuming that one deals with series expansion around $(s,t)=(0,0)$ we can define

cf[k_, n_] := 
  Series[1/Sqrt[(1 - t^2) (1 - s^2 t^2)], {s, 0, 2 k}, {t, 0, 2 n}] // 
  Normal // Coefficient[#, s^(2 k) t^(2 n)] &

e.g.

cf[4, 6]
105/1024
Table[ cf[k, n], {k, 6}, {n, 6}]
{{1/2, 1/4, 3/16, 5/32, 35/256, 63/512}, 
 {0, 3/8, 3/16, 9/64, 15/128, 105/1024}, 
 {0, 0, 5/16, 5/32, 15/128, 25/256}, 
 {0, 0, 0, 35/128, 35/256, 105/1024}, 
 {0, 0, 0, 0, 63/256, 63/512},
 {0, 0, 0, 0, 0, 231/1024}}

One can get the same with Array as well

Array[cf[#1, #2] &, {6, 6}] == Table[cf[k, n], {k, 6}, {n, 6}]
True
Source Link
Artes
  • 57.9k
  • 13
  • 159
  • 247
Loading