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

A222188 Table read by antidiagonals: number of toroidal m X n binary arrays, allowing rotation and/or reflection of the rows and/or the columns.

Original entry on oeis.org

2, 3, 3, 4, 7, 4, 6, 13, 13, 6, 8, 34, 36, 34, 8, 13, 78, 158, 158, 78, 13, 18, 237, 708, 1459, 708, 237, 18, 30, 687, 4236, 14676, 14676, 4236, 687, 30, 46, 2299, 26412, 184854, 340880, 184854, 26412, 2299, 46
Offset: 1

Views

Author

N. J. A. Sloane, Feb 12 2013

Keywords

Examples

			Array begins:
  2,  3,   4,     6,      8,      13,        18,         30, ...
  3,  7,  13,    34,     78,     237,       687,       2299, ...
  4, 13,  36,   158,    708,    4236,     26412,     180070, ...
  6, 34, 158,  1459,  14676,  184854,   2445918,   33888844, ...
  8, 78, 708, 14676, 340880, 8999762, 245619576, 6873769668, ...
  ...
		

Crossrefs

Main diagonal is A209251.
Cf. A184271.

Programs

  • Mathematica
    b1[m_, n_] := Sum[EulerPhi[c]*EulerPhi[d]*2^(m*n/LCM[c, d]), {c, Divisors[ m]}, {d, Divisors[n]}]/(4*m*n); b2a[m_, n_] := If[OddQ[m], 2^((m+1)*n/2) /(4*n), (2^(m*n/2) + 2^((m+2)*n/2))/(8*n)]; b2b[m_, n_] := DivisorSum[n, If[# >= 2, EulerPhi[#]*2^((m*n)/#), 0]&]/(4*n); b2c[m_, n_] := If[OddQ[ m], Sum[If [OddQ[n/GCD[j, n]], 2^((m+1)*GCD[j, n]/2) - 2^(m*GCD[j, n]), 0], {j, 1, n-1}]/(4*n), Sum[If[OddQ[n/GCD[j, n]], 2^(m*GCD[j, n]/2) + 2^((m+2)*GCD[j, n]/2) - 2^(m*GCD[j, n]+1), 0], {j, 1, n-1}]/(8*n)]; b2[m_, n_] := b2a[m, n] + b2b[m, n] + b2c[m, n]; b3[m_, n_] := b2[n, m]; b4oo[m_, n_] := 2^((m*n-3)/2); b4eo[m_, n_] := 3*2^(m*n/2 - 3); b4ee[m_, n_] := 7*2^(m*n/2-4); a[m_, n_] := Module[{b}, If [OddQ[m], If [OddQ[n], b = b4oo[m, n], b = b4eo[m, n]], If[OddQ[n], b = b4eo[m, n], b = b4ee[m, n]]]; b += b1[m, n] + b2[m, n] + b3[m, n]; Return[b]]; Table[a[m - n+1, n], {m, 1, 10}, {n, 1, m}] // Flatten (* Jean-François Alcover, Dec 05 2015, adapted from Michel Marcus's PARI script *)
  • PARI
    odd(n) = n%2;
    b1(m,n) = sumdiv(m, c, sumdiv(n, d, eulerphi(c)*eulerphi(d)*2^(m*n/lcm(c,d))))/(4*m*n);
    b2a(m,n) = if (odd(m), 2^((m+1)*n/2)/(4*n), (2^(m*n/2)+2^((m+2)*n/2))/(8*n));
    b2b(m,n) = sumdiv(n, d, if (d>=2, eulerphi(d)*2^((m*n)/d), 0))/(4*n);
    b2c(m,n) = if (odd(m), sum(j=1, n-1, if (odd(n/gcd(j,n)), 2^((m+1)*gcd(j,n)/2)-2^(m*gcd(j,n))))/(4*n), sum(j=1, n-1, if (odd(n/gcd(j,n)), 2^(m*gcd(j,n)/2)+2^((m+2)*gcd(j,n)/2)-2^(m*gcd(j,n)+1)))/(8*n));
    b2(m,n) = b2a(m,n) + b2b(m,n) + b2c(m,n);
    b3(m,n) = b2(n,m);
    b4oo(m,n) = 2^((m*n - 3)/2);
    b4eo(m,n) = 3*2^(m*n/2 - 3);
    b4ee(m,n) = 7*2^(m*n/2 - 4);
    a(m,n) = {if (odd(m), if (odd(n), b = b4oo(m,n), b = b4eo(m,n)), if (odd(n), b = b4eo(m,n), b = b4ee(m,n))); b += b1(m,n) + b2(m,n) + b3(m,n); return (b);}
    \\ Michel Marcus, Feb 13 2013

A255016 Number of toroidal n X n binary arrays, allowing rotation and/or reflection of rows and/or columns as well as matrix transposition.

Original entry on oeis.org

1, 2, 6, 26, 805, 172112, 239123150, 1436120190288, 36028817512382026, 3731252531904348833632, 1584563250300891724601560272, 2746338834266358751489231123956672, 19358285762613388352671214587818634041520
Offset: 0

Views

Author

Jiyeon Lee, Feb 12 2015

Keywords

Crossrefs

Cf. A184271 (number of m X n binary arrays allowing rotation of rows/columns), A179043 (main diagonal of A184271), A222188 (number of m X n binary arrays allowing rotation/reflection of rows/columns), A209251 (main diagonal of A222188), A255015 (number of n X n binary arrays allowing rotation of rows/columns as well as matrix transposition).
Cf. A054247.

Programs

  • Mathematica
    a[n_] := (8 n^2)^(-1) Sum[If[Mod[n, c] == 0, Sum[If[Mod[n, d] == 0, EulerPhi[c] EulerPhi[d] 2^(n^2/ LCM[c, d]), 0], {d, 1, n}], 0], {c, 1, n}] + (4 n)^(-1) Sum[If[Mod[n, d] == 0, EulerPhi[d] 2^(n^2/d), 0], {d, 1, n}] + If[Mod[n, 2] == 1, (4 n)^(-1) Sum[If[Mod[n, d] == 0 && Mod[d, 2] == 1, EulerPhi[d] (2^(n (n + 1)/(2 d)) - 2^(n^2/d)), 0], {d, 1, n}],(8 n)^(-1) Sum[If[Mod[n, d] == 0 && Mod[d, 2] == 1, EulerPhi[d] (2^(n^2/(2 d)) + 2^(n (n + 2)/(2 d)) - 2 2^(n^2/d)), 0], {d, 1, n}]] + (1/2) If[Mod[n, 2] == 1, 2^((n^2 - 3)/2), 7 2^(n^2/2 - 4)] + (4 n)^(-1) Sum[If[Mod[n, d] == 0, EulerPhi[d] 2^(n (n + d - 2 IntegerPart[d/2])/(2 d)), 0], {d, 1, n}] + If[Mod[n, 2] == 1, 2^((n^2 - 5)/4), 5 2^(n^2/4 - 3)];

Extensions

a(0)=1 from Alois P. Heinz, Feb 19 2015

A255015 Number of toroidal n X n binary arrays, allowing rotation of rows and/or columns as well as matrix transposition.

Original entry on oeis.org

1, 2, 6, 44, 2209, 674384, 954623404, 5744406453840, 144115192471496836, 14925010120653819583840, 6338253001142965335834871200, 10985355337065423791175013899922368, 77433143050453552587418968170813573149024
Offset: 0

Views

Author

Stewart N. Ethier, Feb 12 2015

Keywords

Crossrefs

Cf. A184271 (number of m X n binary arrays allowing rotation of rows/columns), A179043 (main diagonal of A184271), A222188 (number of m X n binary arrays allowing rotation/reflection of rows/columns), A209251 (main diagonal of A222188), A255016 (number of n X n binary arrays allowing rotation/reflection of rows/columns as well as matrix transposition).

Programs

  • Mathematica
    a[n_] := (2 n^2)^(-1) Sum[If[Mod[n, c] == 0, Sum[If[Mod[n, d] == 0, EulerPhi[c] EulerPhi[d] 2^(n^2/ LCM[c, d]), 0], {d, 1, n}], 0], {c, 1, n}] + (2 n)^(-1) Sum[If[Mod[n, d] == 0, EulerPhi[d] 2^(n (n + d - 2 IntegerPart[d/2])/(2 d)), 0], {d, 1, n}];

Formula

a(n) = (2*n^2)^{-1} Sum_{ c divides n } Sum_{ d divides n } phi(c)*phi(d)* 2^(n^2/lcm(c,d)) + (2*n)^{-1} Sum_{ d divides n } phi(d)*2^(n*(n + d - 2 *floor(d/2))/(2*d)), where phi is A000010.

Extensions

a(0)=1 from Alois P. Heinz, Feb 19 2015
Showing 1-3 of 3 results.