cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-8 of 8 results.

A292476 Number of solutions to +-1 +- 3 +- 5 +- 7 +- ... +- (4*n-1) = 0.

Original entry on oeis.org

1, 0, 2, 2, 8, 20, 68, 206, 692, 2306, 7930, 27492, 96792, 343670, 1231932, 4447510, 16164914, 59086618, 217091832, 801247614, 2969432270, 11045446688, 41224168020, 154329373022, 579377940390, 2180684278698, 8227240466520, 31107755899600
Offset: 0

Views

Author

Seiichi Manyama, Sep 17 2017

Keywords

Examples

			For n=2 the 2 solutions are +1-3-5+7 = 0 and -1+3+5-7 = 0.
For n=3 the 2 solutions are +1+3+5-7+9-11 = 0 and -1-3-5+7-9+11 = 0.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := SeriesCoefficient[Product[x^(2k - 1) + 1/x^(2k - 1), {k, 1, 2n}], {x, 0, 0}];
    Table[a[n], {n, 0, 27}] (* Jean-François Alcover, Mar 10 2023 *)
  • PARI
    {a(n) = polcoeff(prod(k=1, 2*n, x^(2*k-1)+1/x^(2*k-1)), 0)}

Formula

Constant term in the expansion of Product_{k=1..2*n} (x^(2*k-1)+1/x^(2*k-1)).
a(n) = 2*A156700(n) for n > 0.

A290889 Number of partitions of the set of odd numbers {1, 3, ..., 2*n-1} into two subsets such that the absolute difference of the sums of the two subsets is minimized.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 5, 4, 13, 10, 38, 34, 118, 103, 380, 346, 1262, 1153, 4277, 3965, 14745, 13746, 51541, 48396, 182182, 171835, 650095, 615966, 2338706, 2223755, 8472697, 8082457, 30884150, 29543309, 113189168, 108545916, 416839177, 400623807, 1541726967
Offset: 1

Views

Author

Hugo Pfoertner, Aug 13 2017

Keywords

Comments

Partitioning in equal sums is only possible for n = 4*k-1, k > 1, and the number of such partitions is given by A156700. For the set {1,3} and the other values of n, i.e., for the sets {1,3,5}, {1,3,5,7,9}, {1,3,5,7,9,11,13}, one can use the criterion to split the sets "as well as possible" by choosing those partitions for which the absolute value of the difference of the respective sums of the subset members achieves its minimum.

Examples

			a(1) = 1: {}U{1} with difference 1.
a(2) = 1: {1}U{3} with difference 2.
a(3) = 1: {1,3}U{5} with difference 1.
a(4) = 1 = A156700(2): {1,7}U{3,5} with difference 0.
a(5) = 2: {1,3,9}U{5,7} and {1,5,7}U{3,9} with |difference|=1.
a(6) = 1 = A156700(3): {1,3,5,9}U{7,11} with difference 0.
a(7) = 5: {1,3,5,7,9}U{11,13}, {1,3,9,11}U{5,7,13}, {1,5,7,11}U{3,9,13},
          {1,11,13}U{3,5,7,9}, {1,3,7,13}U{5,9,11} with |difference|=1.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n>i^2, 0,
          `if`(n=i^2, 1, b(abs(n-2*i+1), i-1)+b(n+2*i-1, i-1)))
        end:
    a:= n-> `if`(n<5, 1, (t-> b(t, n)/(2-t))(irem(n, 2))):
    seq(a(n), n=1..50);  # Alois P. Heinz, Aug 14 2017
  • Mathematica
    b[n_, i_] := b[n, i] = If[n > i^2, 0, If[n == i^2, 1, b[Abs[n - 2i + 1], i - 1] + b[n + 2i - 1, i - 1]]];
    a[n_] := If[n < 5, 1, b[#, n]/(2-#)&[Mod[n, 2]]];
    Array[a, 50] (* Jean-François Alcover, Nov 14 2020, after Alois P. Heinz *)

Formula

a(n) ~ (3 - (-1)^n) * sqrt(3) * 2^(n - 5/2) / (sqrt(Pi) * n^(3/2)). - Vaclav Kotesovec, Sep 18 2017

A292497 Number of solutions to 1^2 +- 3^2 +- 5^2 +- 7^2 +- ... +- (4*n-1)^2 = 0.

Original entry on oeis.org

1, 0, 0, 0, 1, 0, 6, 0, 20, 5, 258, 62, 2510, 914, 24285, 16403, 263945, 222240, 3068971, 3241157, 35286928, 46638022, 426740187, 650095127, 5330192371, 9185814630, 67064945191, 129902075662, 864443143567, 1833530501143, 11336065334984, 25990268638322
Offset: 0

Views

Author

Seiichi Manyama, Sep 17 2017

Keywords

Crossrefs

Formula

For n>0 constant term in the expansion of 1/2 * Product_{k=1..2*n} (x^(2*k-1)^2+1/x^(2*k-1)^2).
a(n) = A292496(n)/2 for n>0.

A300218 Number of solutions to 1 +- 3 +- 5 +- ... +- (2*n-1) == 0 mod n.

Original entry on oeis.org

1, 2, 2, 4, 4, 12, 10, 36, 30, 104, 94, 344, 316, 1172, 1096, 4132, 3856, 14572, 13798, 52432, 49940, 190652, 182362, 699416, 671092, 2581112, 2485534, 9586984, 9256396, 35791472, 34636834, 134221860, 130150588, 505290272, 490853416, 1908874584, 1857283156
Offset: 1

Views

Author

Seiichi Manyama, Feb 28 2018

Keywords

Examples

			Solutions for n = 7:
----------------------------
1 +3 +5 +7 +9 +11 +13 =  49.
1 +3 +5 -7 +9 +11 +13 =  35.
1 +3 -5 +7 -9 +11 +13 =  21.
1 +3 -5 -7 -9 +11 +13 =   7.
1 -3 +5 +7 +9 -11 +13 =  21.
1 -3 +5 -7 +9 -11 +13 =   7.
1 -3 -5 +7 +9 +11 -13 =   7.
1 -3 -5 +7 -9 -11 +13 =  -7.
1 -3 -5 -7 +9 +11 -13 =  -7.
1 -3 -5 -7 -9 -11 +13 = -21.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, m) option remember; `if`(i<1, `if`(n=0, 1, 0),
          add(b(irem(n+j, m), i-2, m), j=[i, m-i]))
        end:
    a:= n-> b(n-1, 2*n-3, n):
    seq(a(n), n=1..40);  # Alois P. Heinz, Mar 01 2018
  • Mathematica
    Table[With[{s = Range[1, (2 n - 1), 2]}, Count[Map[Total[s #] &, Take[Tuples[{-1, 1}, Length@ s], -2^(n - 1)]], ?(Divisible[#, n] &)]], {n, 22}] (* _Michael De Vlieger, Mar 01 2018 *)

A369343 a(n) is the constant term in expansion of Product_{k=1..n} (x^(2*k-1) + 1 + 1/x^(2*k-1)).

Original entry on oeis.org

1, 1, 1, 1, 3, 9, 21, 49, 117, 295, 761, 1993, 5261, 14025, 37699, 102151, 278587, 764145, 2106433, 5832863, 16217191, 45255167, 126708863, 355848715, 1002145705, 2829479797, 8007670701, 22711890561, 64547494347, 183790615881, 524239904367, 1497786769295
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 20 2024

Keywords

Comments

All terms are odd.

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n>i^2, 0, `if`(i=0, 1,
          b(n, i-1)+b(n+2*i-1, i-1)+b(abs(n-2*i+1), i-1)))
        end:
    a:= n-> b(0, n):
    seq(a(n), n=0..33);  # Alois P. Heinz, Jan 21 2024
  • Mathematica
    Table[Coefficient[Product[x^(2 k - 1) + 1 + 1/x^(2 k - 1), {k, 1, n}], x, 0], {n, 0, 30}]

Formula

a(n) ~ 3^(n+1) / (4*sqrt(Pi)*n^(3/2)). - Vaclav Kotesovec, Jan 21 2024

A367087 Number of solutions to +- 1 +- 3 +- 5 +- 7 +- ... +- (2*n-1) = 0 or 1.

Original entry on oeis.org

1, 1, 0, 1, 2, 2, 2, 5, 8, 13, 20, 38, 68, 118, 206, 380, 692, 1262, 2306, 4277, 7930, 14745, 27492, 51541, 96792, 182182, 343670, 650095, 1231932, 2338706, 4447510, 8472697, 16164914, 30884150, 59086618, 113189168, 217091832, 416839177, 801247614, 1541726967, 2969432270
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 26 2024

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n>i^2, 0,
          `if`(i=0, 1, b(n+2*i-1, i-1)+b(abs(n-2*i+1), i-1)))
        end:
    a:=n-> b(irem(n, 2), n):
    seq(a(n), n=0..40);  # Alois P. Heinz, Jan 26 2024
  • Mathematica
    b[n_, i_] := b[n, i] = If[n > i^2, 0,
       If[i == 0, 1, b[n+2*i-1, i-1] + b[Abs[n-2*i+1], i-1]]];
    a[n_] := b[Mod[n, 2], n];
    Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Feb 03 2025, after Alois P. Heinz *)

A369386 a(n) is the constant term in expansion of Product_{k=1..n} (x^(2*k-1) + 1/x^(2*k-1))^2.

Original entry on oeis.org

1, 2, 4, 8, 18, 48, 138, 428, 1392, 4652, 15884, 55124, 193724, 688008, 2465134, 8899700, 32342236, 118215780, 434314138, 1602935104, 5940303754, 22095769648, 82464791420, 308715131744, 1158949678600, 4362040367048, 16456820491806, 62223707844096
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 22 2024

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Coefficient[Product[(x^(2 k - 1) + 1/x^(2 k - 1))^2, {k, 1, n}], x, 0], {n, 0, 27}]

A369729 Number of solutions to +- 1 +- 3 +- 5 +- 7 +- ... +- (4*n-3) = 1.

Original entry on oeis.org

0, 1, 1, 2, 5, 13, 38, 118, 380, 1262, 4277, 14745, 51541, 182182, 650095, 2338706, 8472697, 30884150, 113189168, 416839177, 1541726967, 5724470097, 21330062502, 79733319862, 298922247363, 1123678419818, 4234465089737, 15993581636893, 60535561889465
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 30 2024

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Coefficient[Product[(x^(2 k - 1) + 1/x^(2 k - 1)), {k, 1, 2 n - 1}], x, 1], {n, 0, 27}]

Formula

a(n) = [x^1] Product_{k=1..2*n-1} (x^(2*k-1) + 1/x^(2*k-1)).
Showing 1-8 of 8 results.