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-4 of 4 results.

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

Original entry on oeis.org

1, 0, 2, 4, 4, 0, 10, 32, 30, 0, 94, 344, 316, 0, 1096, 4096, 3856, 0, 13798, 52432, 49940, 0, 182362, 699072, 671092, 0, 2485534, 9586984, 9256396, 0, 34636834, 134217728, 130150588, 0, 490853416, 1908874584, 1857283156, 0, 7048151672, 27487790720
Offset: 1

Views

Author

Seiichi Manyama, Feb 28 2018

Keywords

Comments

Apparently a(2*n + 1) = A053656(2*n + 1) for n >= 0. - Georg Fischer, Mar 26 2019

Examples

			Solutions for n = 7:
--------------------------
1 +2 +3 +4 +5 +6 +7 =  28.
1 +2 +3 +4 +5 +6 -7 =  14.
1 +2 -3 +4 -5 -6 +7 =   0.
1 +2 -3 +4 -5 -6 -7 = -14.
1 +2 -3 -4 +5 +6 +7 =  14.
1 +2 -3 -4 +5 +6 -7 =   0.
1 -2 +3 +4 -5 +6 +7 =  14.
1 -2 +3 +4 -5 +6 -7 =   0.
1 -2 -3 -4 -5 +6 +7 =   0.
1 -2 -3 -4 -5 +6 -7 = -14.
		

Crossrefs

Number of solutions to 1 +- 2^k +- 3^k +- ... +- n^k == 0 (mod n): this sequence (k=1), A300268 (k=2), A300269 (k=3).
Cf. A016825 (4n+2).

Programs

  • Maple
    b:= proc(n, i, m) option remember; `if`(i=0, `if`(n=0, 1, 0),
          add(b(irem(n+j, m), i-1, m), j=[i, m-i]))
        end:
    a:= n-> b(0, n-1, n):
    seq(a(n), n=1..60);  # Alois P. Heinz, Mar 01 2018
  • Mathematica
    b[n_, i_, m_] := b[n, i, m] = If[i == 0, If[n == 0, 1, 0], Sum[b[Mod[n + j, m], i - 1, m], {j, {i, m - i}}]];
    a[n_] := b[0, n - 1, n];
    Array[a, 60] (* Jean-François Alcover, Apr 29 2020, after Alois P. Heinz *)
  • Ruby
    def A(n)
      ary = [1] + Array.new(n - 1, 0)
      (1..n).each{|i|
        i1 = 2 * i
        a = ary.clone
        (0..n - 1).each{|j| a[(j + i1) % n] += ary[j]}
        ary = a
      }
      ary[(n * (n + 1) / 2) % n] / 2
    end
    def A300190(n)
      (1..n).map{|i| A(i)}
    end
    p A300190(100)

Formula

a(4*n+1) = A000016(n), a(4*n+2) = 0, a(4*n+3) = A000016(n), a(4*n+4) = 2 * A000016(n) for n > 0.
a(2^n) = 2^A000325(n) for n > 1.

A053633 Triangular array T(n,k) giving coefficients in expansion of Product_{j=1..n} (1+x^j) mod x^(n+1)-1.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 2, 2, 2, 2, 4, 3, 3, 3, 3, 6, 5, 5, 6, 5, 5, 10, 9, 9, 9, 9, 9, 9, 16, 16, 16, 16, 16, 16, 16, 16, 30, 28, 28, 29, 28, 28, 29, 28, 28, 52, 51, 51, 51, 51, 52, 51, 51, 51, 51, 94, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 172, 170, 170, 172, 170, 170, 172
Offset: 0

Views

Author

N. J. A. Sloane, Mar 22 2000

Keywords

Comments

T(n,k) = number of binary vectors (x_1,...,x_n) satisfying Sum_{i=1..n} i*x_i = k (mod n+1) = size of Varshamov-Tenengolts code VT_k(n).

Examples

			Triangle begins:
  k  0    1    2    3    4    5    6    7    8    9
n
0    1;
1    1,   1;
2    2,   1,   1;
3    2,   2,   2,   2;
4    4,   3,   3,   3,   3;
5    6,   5,   5,   6,   5,   5;
6   10,   9,   9,   9,   9,   9,   9;
7   16,  16,  16,  16,  16,  16,  16,  16;
8   30,  28,  28,  29,  28,  28,  29,  28,  28;
9   52,  51,  51,  51,  51,  52,  51,  51,  51,  51;
    ...
[Edited by _Seiichi Manyama_, Mar 11 2018]
		

References

  • B. D. Ginsburg, On a number theory function applicable in coding theory, Problemy Kibernetiki, No. 19 (1967), pp. 249-252.

Crossrefs

Cf. A053632, A063776, A300328, A300628. Leading coefficients give A000016, next column gives A000048.

Programs

  • Maple
    with(numtheory): A053633 := proc(n,k) local t1,d; t1 := 0; for d from 1 to n do if n mod d = 0 and d mod 2 = 1 then t1 := t1+(1/(2*n))*2^(n/d)*phi(d)*mobius(d/gcd(d,k))/phi(d/gcd(d,k)); fi; od; t1; end;
  • Mathematica
    Flatten[ Table[ CoefficientList[ PolynomialMod[ Product[1+x^j, {j,1,n}], x^(n+1)-1], x], {n,0,11}]] (* Jean-François Alcover, May 04 2011 *)

Formula

The Maple code gives an explicit formula.

A300324 Triangle read by rows: row n gives the number of solutions to +-1 +- 3 +- 6 +- ... +- n*(n+1)/2 == k (mod n).

Original entry on oeis.org

2, 4, 0, 0, 4, 4, 8, 0, 8, 0, 8, 4, 8, 8, 4, 32, 0, 16, 0, 16, 0, 24, 24, 16, 12, 12, 16, 24, 64, 0, 64, 0, 64, 0, 64, 0, 40, 72, 60, 44, 60, 60, 44, 60, 72, 224, 0, 208, 0, 192, 0, 192, 0, 208, 0, 176, 188, 188, 180, 196, 184, 184, 196, 180, 188, 188
Offset: 1

Views

Author

Seiichi Manyama, Mar 02 2018

Keywords

Examples

			First few rows are:
   2;
   4,  0;
   0,  4,  4;
   8,  0,  8,  0;
   8,  4,  8,  8,  4;
  32,  0, 16,  0, 16,  0;
  24, 24, 16, 12, 12, 16, 24;
  64,  0, 64,  0, 64,  0, 64, 0;
		

Crossrefs

Cf. A000079 (row sums), A300307, A300328.

A300329 Number of solutions to +-1 +- 2 +- 3 +- ... +- n == n-1 (mod n).

Original entry on oeis.org

2, 4, 2, 0, 6, 20, 18, 0, 56, 204, 186, 0, 630, 2340, 2182, 0, 7710, 29120, 27594, 0, 99858, 381300, 364722, 0, 1342176, 5162220, 4971008, 0, 18512790, 71582716, 69273666, 0, 260300986, 1010580540, 981706806, 0, 3714566310, 14467258260, 14096302710, 0
Offset: 1

Views

Author

Seiichi Manyama, Mar 03 2018

Keywords

Examples

			Solutions for n = 7:
--------------------------------------------------------------
1 +2 +3 +4 -5 -6 +7 =   6,         -1 +2 +3 -4 +5 -6 +7 =   6,
1 +2 +3 +4 -5 -6 -7 =  -8,         -1 +2 +3 -4 +5 -6 -7 =  -8,
1 +2 +3 -4 +5 +6 +7 =  20,         -1 +2 -3 +4 +5 +6 +7 =  20,
1 +2 +3 -4 +5 +6 -7 =   6,         -1 +2 -3 +4 +5 +6 -7 =   6,
1 +2 -3 -4 -5 -6 +7 =  -8,         -1 -2 +3 -4 -5 -6 +7 =  -8,
1 +2 -3 -4 -5 -6 -7 = -22,         -1 -2 +3 -4 -5 -6 -7 = -22,
1 -2 +3 -4 -5 +6 +7 =   6,         -1 -2 -3 +4 -5 +6 +7 =   6,
1 -2 +3 -4 -5 +6 -7 =  -8,         -1 -2 -3 +4 -5 +6 -7 =  -8,
1 -2 -3 +4 +5 -6 +7 =   6,
1 -2 -3 +4 +5 -6 -7 =  -8.
		

Crossrefs

Programs

  • PARI
    a(n) = my (v=vector(n, k, k==1)); for (p=1, n, v = vector(n, k, v[1+(k-1+p)%n]+v[1+(k-1-p)%n])); v[1+(n-1)%n] \\ Rémy Sigrist, Mar 03 2018
Showing 1-4 of 4 results.