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

A068009 Square array T(m,n) with m (row) >= 1 and n (column) >= 0 read by antidiagonals: number of subsets of {1,2,3,...n} that sum to 0 mod m (including the empty set, whose sum is 0).

Original entry on oeis.org

1, 2, 1, 4, 1, 1, 8, 2, 1, 1, 16, 4, 2, 1, 1, 32, 8, 4, 1, 1, 1, 64, 16, 6, 2, 1, 1, 1, 128, 32, 12, 4, 2, 1, 1, 1, 256, 64, 24, 8, 4, 2, 1, 1, 1, 512, 128, 44, 16, 8, 3, 1, 1, 1, 1, 1024, 256, 88, 32, 14, 6, 3, 1, 1, 1, 1, 2048, 512, 176, 64, 26, 12, 5, 2, 1, 1, 1, 1, 4096, 1024, 344, 128, 52, 22, 10, 4, 2, 1, 1, 1, 1
Offset: 0

Views

Author

Antti Karttunen, Feb 11 2002

Keywords

Comments

When p is an odd prime, T(p,k+p) = 2*T(p,k) + (2^k * ((2^p) - 2)/p) for all k >= 0. [Sophie LeBlanc]
When m divides n (with n >= m), T(m,n) = (1/m) Sum_{d | m and d is odd} phi(d) * 2^(n/d). [N. Kitchloo and L. Pachter; D. Rusin]
A068009(C(i+1,2), i) = 2, A068009(C(i,2)+1, i) = A000009(i-1) + 1. [AK, cf. A068049]

Examples

			Table for T(m,n) (with rows m >= 1 and columns n >= 0) begins as follows:
  1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, ...
  1, 1, 2, 4,  8, 16, 32,  64, 128, 256,  512, 1024, ...
  1, 1, 2, 4,  6, 12, 24,  44,  88, 176,  344, ...
  1, 1, 1, 2,  4,  8, 16,  32,  64, 128,  ...
  1, 1, 1, 2,  4,  8, 14,  26,  52, ...
  1, 1, 1, 2,  3,  6, 12,  22, ...
  1, 1, 1, 1,  3,  5, 10, ...
  1, 1, 1, 1,  2,  4, ...
  1, 1, 1, 1,  2, ...
  1, 1, 1, 1, ...
  1, 1, 1, ...
  1, 1, ...
  1, ...
  ...
		

Crossrefs

Main diagonal: A000016, superdiagonal: A063776. The first term greater than one occurs on each row m in the position A002024(m) and these are given in A068049.
Row 1: A000079, row 2: A011782, row 3: A068010, row 5: A068011, row 6: A068012, row 7: A068013, row 9: A068030, row 10: A068031, row 11: A068032, row 12: A068033, row 13: A068034, row 14: A068035, row 15: A068036, row 16: A068037, row 17: A068038, row 18: A068039, row 19: A068040, row 20: A068041, row 21: A068042, row 25: A068043, row 32: A068044, row 64: A068045.

Programs

  • Maple
    b:= proc(n, m, t) option remember; `if`(n=0, `if`(t=0, 1, 0),
           b(n-1, m, t)+ b(n-1, m, irem(t+n,m)))
        end:
    T:= (m, n)-> b(n, m, 0):
    seq(seq(T(1+m, d-m), m=0..d), d=0..12);  # Alois P. Heinz, Jan 18 2014
  • Mathematica
    max = 13; row[m_] := (ClearAll[t]; im = IdentityMatrix[m]; v = Join[ {Last[im]}, Most[im] ]; t[0] = im[[1]]; t[k_] := t[k] = (im + MatrixPower[v, k]) . t[k-1]; Table[ t[k][[1]], {k, 0, max}]); rows = Table[ row[m], {m, 1, max}]; A068009 = Flatten[ Table[ rows[[m-n+1, n]], {m, 1, max, 1}, {n, m, 1, -1}]] (* Jean-François Alcover, Apr 02 2012, after Will Self *)
    b[n_, m_, t_] := b[n, m, t] = If[n == 0, If[t == 0, 1, 0], b[n-1, m, t]+b[n-1, m, Mod[t+n, m]]]; T[m_, n_] := b[n, m, 0]; Table[Table[T[1+m, d-m], {m, 0, d}], {d, 0, 12}] // Flatten (* Jean-François Alcover, Jan 13 2015, after Alois P. Heinz *)

A068011 Number of subsets of {1,2,3,...,n} that sum to 0 mod 5.

Original entry on oeis.org

1, 1, 1, 2, 4, 8, 14, 26, 52, 104, 208, 412, 820, 1640, 3280, 6560, 13112, 26216, 52432, 104864, 209728, 419440, 838864, 1677728, 3355456, 6710912, 13421792, 26843552, 53687104, 107374208, 214748416, 429496768, 858993472, 1717986944, 3435973888, 6871947776
Offset: 0

Views

Author

Antti Karttunen, Feb 11 2002

Keywords

Comments

For n>2, a(n) = 2 * A068031(n).

Crossrefs

5th row of A068009.

Programs

  • Maple
    A068011_rec := proc(n); if(0 = n) then RETURN(1); fi; if(1 = (n mod 5)) then RETURN(2*A068011_rec(n-1)-2^((n-1)/5)); fi; if(2 = (n mod 5)) then RETURN(2*A068011_rec(n-1)-2^((n-2)/5)); fi; RETURN(2*A068011_rec(n-1)); end;
    # second Maple program:
    b:= proc(n, s) option remember; `if`(n=0, `if`(s=0, 1, 0),
          b(n-1, s)+b(n-1, irem(s+n, 5)))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..35);  # Alois P. Heinz, May 02 2025
  • Mathematica
    LinearRecurrence[{2, 0, 0, 0, 2, -4}, {1, 1, 1, 2, 4, 8}, 40] (* Jean-François Alcover, Mar 06 2016 *)

Formula

a(k+1) = 2*a(k) if k == 2, 3, or 4 mod 5, 2*a(k)-2^(k/5) if k == 0 mod 5, 2*a(k)-2^((k-1)/5) if k == 1 mod 5.
G.f.: -(x^2-x+1)*(2*x^3+2*x^2-1) / ((2*x-1)*(2*x^5-1)). - Colin Barker, Dec 22 2012
If n == 0 mod 5, then a(n) = (2^n + 4*2^(n/5))/5. - Giorgos Kalogeropoulos, May 02 2025
a(n) ~ 2^n/5. - Stefano Spezia, May 02 2025
Showing 1-2 of 2 results.