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-10 of 15 results. Next

A047999 Sierpiński's [Sierpinski's] triangle (or gasket): triangle, read by rows, formed by reading Pascal's triangle (A007318) mod 2.

Original entry on oeis.org

1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1
Offset: 0

Views

Author

Keywords

Comments

Restored the alternative spelling of Sierpinski to facilitate searching for this triangle using regular-expression matching commands in ASCII. - N. J. A. Sloane, Jan 18 2016
Also triangle giving successive states of cellular automaton generated by "Rule 60" and "Rule 102". - Hans Havermann, May 26 2002
Also triangle formed by reading triangle of Eulerian numbers (A008292) mod 2. - Philippe Deléham, Oct 02 2003
Self-inverse when regarded as an infinite lower triangular matrix over GF(2).
Start with [1], repeatedly apply the map 0 -> [00/00], 1 -> [10/11] [Allouche and Berthe]
Also triangle formed by reading triangles A011117, A028338, A039757, A059438, A085881, A086646, A086872, A087903, A104219 mod 2. - Philippe Deléham, Jun 18 2005
J. H. Conway writes (in Math Forum): at least the first 31 rows give odd-sided constructible polygons (sides 1, 3, 5, 15, 17, ... see A001317). The 1's form a Sierpiński sieve. - M. Dauchez (mdzzdm(AT)yahoo.fr), Sep 19 2005
When regarded as an infinite lower triangular matrix, its inverse is a (-1,0,1)-matrix with zeros undisturbed and the nonzero entries in every column form the Prouhet-Thue-Morse sequence (1,-1,-1,1,-1,1,1,-1,...) A010060 (up to relabeling). - David Callan, Oct 27 2006
Triangle read by rows: antidiagonals of an array formed by successive iterates of running sums mod 2, beginning with (1, 1, 1, ...). - Gary W. Adamson, Jul 10 2008
T(n,k) = A057427(A143333(n,k)). - Reinhard Zumkeller, Oct 24 2010
The triangle sums, see A180662 for their definitions, link Sierpiński’s triangle A047999 with seven sequences, see the crossrefs. The Kn1y(n) and Kn2y(n), y >= 1, triangle sums lead to the Sierpiński-Stern triangle A191372. - Johannes W. Meijer, Jun 05 2011
Used to compute the total Steifel-Whitney cohomology class of the Real Projective space. This was an essential component of the proof that there are no product operations without zero divisors on R^n for n not equal to 1, 2, 4 or 8 (real numbers, complex numbers, quaternions, Cayley numbers), proved by Bott and Milnor. - Marcus Jaiclin, Feb 07 2012
T(n,k) = A134636(n,k) mod 2. - Reinhard Zumkeller, Nov 23 2012
T(n,k) = 1 - A219463(n,k), 0 <= k <= n. - Reinhard Zumkeller, Nov 30 2012
From Vladimir Shevelev, Dec 31 2013: (Start)
Also table of coefficients of polynomials s_n(x) of degree n which are defined by formula s_n(x) = Sum_{i=0..n} (binomial(n,i) mod 2)*x^k. These polynomials we naturally call Sierpiński's polynomials. They also are defined by the recursion: s_0(x)=1, s_(2*n+1)(x) = (x+1)*s_n(x^2), n>=0, and s_(2*n)(x) = s_n(x^2), n>=1.
Note that: s_n(1) = A001316(n),
s_n(2) = A001317(n),
s_n(3) = A100307(n),
s_n(4) = A001317(2*n),
s_n(5) = A100308(n),
s_n(6) = A100309(n),
s_n(7) = A100310(n),
s_n(8) = A100311(n),
s_n(9) = A100307(2*n),
s_n(10) = A006943(n),
s_n(16) = A001317(4*n),
s_n(25) = A100308(2*n), etc.
The equality s_n(10) = A006943(n) means that sequence A047999 is obtained from A006943 by the separation by commas of the digits of its terms. (End)
Comment from N. J. A. Sloane, Jan 18 2016: (Start)
Take a diamond-shaped region with edge length n from the top of the triangle, and rotate it by 45 degrees to get a square S_n. Here is S_6:
[1, 1, 1, 1, 1, 1]
[1, 0, 1, 0, 1, 0]
[1, 1, 0, 0, 1, 1]
[1, 0, 0, 0, 1, 0]
[1, 1, 1, 1, 0, 0]
[1, 0, 1, 0, 0, 0].
Then (i) S_n contains no square (parallel to the axes) with all four corners equal to 1 (cf. A227133); (ii) S_n can be constructed by using the greedy algorithm with the constraint that there is no square with that property; and (iii) S_n contains A064194(n) 1's. Thus A064194(n) is a lower bound on A227133(n). (End)
See A123098 for a multiplicative encoding of the rows, i.e., product of the primes selected by nonzero terms; e.g., 1 0 1 => 2^1 * 3^0 * 5^1. - M. F. Hasler, Sep 18 2016
From Valentin Bakoev, Jul 11 2020: (Start)
The Sierpinski's triangle with 2^n rows is a part of a lower triangular matrix M_n of dimension 2^n X 2^n. M_n is a block matrix defined recursively: M_1= [1, 0], [1, 1], and for n>1, M_n = [M_(n-1), O_(n-1)], [M_(n-1), M_(n-1)], where M_(n-1) is a block matrix of the same type, but of dimension 2^(n-1) X 2^(n-1), and O_(n-1) is the zero matrix of dimension 2^(n-1) X 2^(n-1). Here is how M_1, M_2 and M_3 look like:
1 0 1 0 0 0 1 0 0 0 0 0 0 0
1 1 1 1 0 0 1 1 0 0 0 0 0 0 - It is seen the self-similarity of the
1 0 1 0 1 0 1 0 0 0 0 0 matrices M_1, M_2, ..., M_n, ...,
1 1 1 1 1 1 1 1 0 0 0 0 analogously to the Sierpinski's fractal.
1 0 0 0 1 0 0 0
1 1 0 0 1 1 0 0
1 0 1 0 1 0 1 0
1 1 1 1 1 1 1 1
M_n can also be defined as M_n = M_1 X M_(n-1) where X denotes the Kronecker product. M_n is an important matrix in coding theory, cryptography, Boolean algebra, monotone Boolean functions, etc. It is a transformation matrix used in computing the algebraic normal form of Boolean functions. Some properties and links concerning M_n can be seen in LINKS. (End)
Sierpinski's gasket has fractal (Hausdorff) dimension log(A000217(2))/log(2) = log(3)/log(2) = 1.58496... (and cf. A020857). This gasket is the first of a family of gaskets formed by taking the Pascal triangle (A007318) mod j, j >= 2 (see CROSSREFS). For prime j, the dimension of the gasket is log(A000217(j))/log(j) = log(j(j + 1)/2)/log(j) (see Reiter and Bondarenko references). - Richard L. Ollerton, Dec 14 2021

Examples

			Triangle begins:
              1,
             1,1,
            1,0,1,
           1,1,1,1,
          1,0,0,0,1,
         1,1,0,0,1,1,
        1,0,1,0,1,0,1,
       1,1,1,1,1,1,1,1,
      1,0,0,0,0,0,0,0,1,
     1,1,0,0,0,0,0,0,1,1,
    1,0,1,0,0,0,0,0,1,0,1,
   1,1,1,1,0,0,0,0,1,1,1,1,
  1,0,0,0,1,0,0,0,1,0,0,0,1,
  ...
		

References

  • Boris A. Bondarenko, Generalized Pascal Triangles and Pyramids (in Russian), FAN, Tashkent, 1990, ISBN 5-648-00738-8.
  • Brand, Neal; Das, Sajal; Jacob, Tom. The number of nonzero entries in recursively defined tables modulo primes. Proceedings of the Twenty-first Southeastern Conference on Combinatorics, Graph Theory, and Computing (Boca Raton, FL, 1990). Congr. Numer. 78 (1990), 47--59. MR1140469 (92h:05004).
  • John W. Milnor and James D. Stasheff, Characteristic Classes, Princeton University Press, 1974, pp. 43-49 (sequence appears on p. 46).
  • H.-O. Peitgen, H. Juergens and D. Saupe: Chaos and Fractals (Springer-Verlag 1992), p. 408.
  • Michel Rigo, Formal Languages, Automata and Numeration Systems, 2 vols., Wiley, 2014. Mentions this sequence - see "List of Sequences" in Vol. 2.
  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; Chapter 3.

Crossrefs

Sequences based on the triangles formed by reading Pascal's triangle mod m: (this sequence) (m = 2), A083093 (m = 3), A034931 (m = 4), A095140 (m = 5), A095141 (m = 6), A095142 (m = 7), A034930(m = 8), A095143 (m = 9), A008975 (m = 10), A095144 (m = 11), A095145 (m = 12), A275198 (m = 14), A034932 (m = 16).
Other versions: A090971, A038183.
From Johannes W. Meijer, Jun 05 2011: (Start)
A106344 is a skew version of this triangle.
Triangle sums (see the comments): A001316 (Row1; Related to Row2), A002487 (Related to Kn11, Kn12, Kn13, Kn21, Kn22, Kn23), A007306 (Kn3, Kn4), A060632 (Fi1, Fi2), A120562 (Ca1, Ca2), A112970 (Gi1, Gi2), A127830 (Ze3, Ze4). (End)

Programs

  • Haskell
    import Data.Bits (xor)
    a047999 :: Int -> Int -> Int
    a047999 n k = a047999_tabl !! n !! k
    a047999_row n = a047999_tabl !! n
    a047999_tabl = iterate (\row -> zipWith xor ([0] ++ row) (row ++ [0])) [1]
    -- Reinhard Zumkeller, Dec 11 2011, Oct 24 2010
    
  • Magma
    A047999:= func< n,k | BitwiseAnd(n-k, k) eq 0 select 1 else 0 >;
    [A047999(n,k): k in [0..n], n in [0..15]]; // G. C. Greubel, Dec 03 2024
  • Maple
    # Maple code for first M rows (here M=10) - N. J. A. Sloane, Feb 03 2016
    ST:=[1,1,1]; a:=1; b:=2; M:=10;
    for n from 2 to M do ST:=[op(ST),1];
    for i from a to b-1 do ST:=[op(ST), (ST[i+1]+ST[i+2]) mod 2 ]; od:
    ST:=[op(ST),1];
    a:=a+n; b:=a+n; od:
    ST; # N. J. A. Sloane
    # alternative
    A047999 := proc(n,k)
        modp(binomial(n,k),2) ;
    end proc:
    seq(seq(A047999(n,k),k=0..n),n=0..12) ; # R. J. Mathar, May 06 2016
  • Mathematica
    Mod[ Flatten[ NestList[ Prepend[ #, 0] + Append[ #, 0] &, {1}, 13]], 2] (* Robert G. Wilson v, May 26 2004 *)
    rows = 14; ca = CellularAutomaton[60, {{1}, 0}, rows-1]; Flatten[ Table[ca[[k, 1 ;; k]], {k, 1, rows}]] (* Jean-François Alcover, May 24 2012 *)
    Mod[#,2]&/@Flatten[Table[Binomial[n,k],{n,0,20},{k,0,n}]] (* Harvey P. Dale, Jun 26 2019 *)
  • PARI
    \\ Recurrence for Pascal's triangle mod p, here p = 2.
    p = 2; s=13; T=matrix(s,s); T[1,1]=1;
    for(n=2,s, T[n,1]=1; for(k=2,n, T[n,k] = (T[n-1,k-1] + T[n-1,k])%p ));
    for(n=1,s,for(k=1,n,print1(T[n,k],", "))) \\ Gerald McGarvey, Oct 10 2009
    
  • PARI
    A011371(n)=my(s);while(n>>=1,s+=n);s
    T(n,k)=A011371(n)==A011371(k)+A011371(n-k) \\ Charles R Greathouse IV, Aug 09 2013
    
  • PARI
    T(n,k)=bitand(n-k,k)==0 \\ Charles R Greathouse IV, Aug 11 2016
    
  • Python
    def A047999_T(n,k):
        return int(not ~n & k) # Chai Wah Wu, Feb 09 2016
    

Formula

Lucas's Theorem is that T(n,k) = 1 if and only if the 1's in the binary expansion of k are a subset of the 1's in the binary expansion of n; or equivalently, k AND NOT n is zero, where AND and NOT are bitwise operators. - Chai Wah Wu, Feb 09 2016 and N. J. A. Sloane, Feb 10 2016
Sum_{k>=0} T(n, k) = A001316(n) = 2^A000120(n).
T(n,k) = T(n-1,k-1) XOR T(n-1,k), 0 < k < n; T(n,0) = T(n,n) = 1. - Reinhard Zumkeller, Dec 13 2009
T(n,k) = (T(n-1,k-1) + T(n-1,k)) mod 2 = |T(n-1,k-1) - T(n-1,k)|, 0 < k < n; T(n,0) = T(n,n) = 1. - Rick L. Shepherd, Feb 23 2018
From Vladimir Shevelev, Dec 31 2013: (Start)
For polynomial {s_n(x)} we have
s_0(x)=1; for n>=1, s_n(x) = Product_{i=1..A000120(n)} (x^(2^k_i) + 1),
if the binary expansion of n is n = Sum_{i=1..A000120(n)} 2^k_i;
G.f. Sum_{n>=0} s_n(x)*z^n = Product_{k>=0} (1 + (x^(2^k)+1)*z^(2^k)) (0
Let x>1, t>0 be real numbers. Then
Sum_{n>=0} 1/s_n(x)^t = Product_{k>=0} (1 + 1/(x^(2^k)+1)^t);
Sum_{n>=0} (-1)^A000120(n)/s_n(x)^t = Product_{k>=0} (1 - 1/(x^(2^k)+1)^t).
In particular, for t=1, x>1, we have
Sum_{n>=0} (-1)^A000120(n)/s_n(x) = 1 - 1/x. (End)
From Valentin Bakoev, Jul 11 2020: (Start)
(See my comment about the matrix M_n.) Denote by T(i,j) the number in the i-th row and j-th column of M_n (0 <= i, j < 2^n). When i>=j, T(i,j) is the j-th number in the i-th row of the Sierpinski's triangle. For given i and j, we denote by k the largest integer of the type k=2^m and k
T(i,0) = T(i,i) = 1, or
T(i,j) = 0 if i < j, or
T(i,j) = T(i-k,j), if j < k, or
T(i,j) = T(i-k,j-k), if j >= k.
Thus, for given i and j, T(i,j) can be computed in O(log_2(i)) steps. (End)

Extensions

Additional links from Lekraj Beedassy, Jan 22 2004

A227116 Given an equilateral triangular grid with side n, containing n(n+1)/2 points, a(n) is the minimal number of points to be removed from the grid, so that, if 3 of the remaining points are chosen, they do not form an equilateral triangle with sides parallel to the grid.

Original entry on oeis.org

0, 1, 2, 4, 7, 9, 14, 18, 23, 29, 36, 44, 52, 61, 71
Offset: 1

Author

Heinrich Ludwig, Jul 01 2013

Keywords

Comments

This is the complementary problem to A227308.
Numbers found by an exhaustive computational search for all solutions (see history).

Examples

			n = 11: at least a(11) = 36 points (.) out of the 66 have to be removed, leaving 30 (X) behind:
              .
             X X
            X . X
           X . . X
          X . . . X
         X . . . . X
        . X X . X X .
       . X . X X . X .
      . . X X . X X . .
     X . . . . . . . . X
    . X X X . . . X X X .
There is no equilateral subtriangle with all vertices = X and sides parallel to the whole triangle.
		

Crossrefs

Formula

a(n) + A227308(n) = n(n+1)/2.

Extensions

Added a(12), a(13), Heinrich Ludwig, Sep 02 2013
Added a(14), Giovanni Resta, Sep 19 2013
a(15) from Heinrich Ludwig, Oct 27 2013

A227308 Given an equilateral triangular grid with side n consisting of n(n+1)/2 points, a(n) is the maximum number of points that can be painted so that, if any 3 of the painted ones are chosen, they do not form an equilateral triangle with sides parallel to the grid.

Original entry on oeis.org

1, 2, 4, 6, 8, 12, 14, 18, 22, 26, 30, 34, 39, 44, 49
Offset: 1

Author

Heinrich Ludwig, Jul 06 2013

Keywords

Comments

Numbers found by an exhaustive computational search for all solutions. This sequence is complementary to A227116: A227116(n) + A227308(n) = n(n+1)/2.
Up to n=12 there is always a symmetric maximal solution. For n=13 and n=15 symmetric solutions contain at most a(n)-1 painted points. - Heinrich Ludwig, Oct 26 2013

Examples

			n = 11. At most a(11) = 30 points (X) of 66 can be painted, while 36 (.) must remain unpainted.
                .
               X X
              X . X
             X . . X
            X . . . X
           X . . . . X
          . X X . X X .
         . X . X X . X .
        . . X X . X X . .
       X . . . . . . . . X
      . X X X . . . X X X .
In this pattern there is no equilateral subtriangle with all vertices = X and sides parallel to the whole triangle.
		

Crossrefs

Cf. A227116 (the complementary problem), A152125, A227133, A002717.

Programs

  • Mathematica
    ivar[r_, c_] := r*(r-1)/2 + c; a[n_] := Block[{m, qq, nv = n*(n+1)/2, ne}, qq = Union[ Flatten[Table[{ivar[r, c], ivar[r-j, c], ivar[r, c+j]}, {r, 2, n}, {c, r - 1}, {j, Min[r - 1, r - c]}], 2], Flatten[Table[{ivar[r, c], ivar[r + j, c], ivar[r, c - j]}, {r, 2, n}, {c, 2, r}, {j, Min[c - 1, n - r]}], 2]]; ne = Length@qq; m = Table[0, {ne}, {nv}]; Do[m[[i, qq[[i]]]] = 1, {i, ne}]; Total@ Quiet@ LinearProgramming[ Table[-1, {nv}], m, Table[{2, -1}, {ne}], Table[{0, 1}, {nv}], Integers]]; Array[a, 9] (* Giovanni Resta, Sep 19 2013 *)

Extensions

a(12), a(13) from Heinrich Ludwig, Sep 02 2013
a(14) from Giovanni Resta, Sep 19 2013
a(15) from Heinrich Ludwig, Oct 26 2013

A152125 Consider a square grid with side n consisting of n^2 cells (or points); a(n) is the minimal number of points that can be painted black so that, out of any four points forming a square with sides parallel to the sides of the grid, at least one of the four is black.

Original entry on oeis.org

0, 1, 2, 4, 8, 12, 17, 23, 30, 39, 48, 59, 71
Offset: 1

Author

Joshua Zucker, Mar 25 2009

Keywords

Comments

On a 4 X 4 square grid, there are 14 lattice squares parallel to the axes. What is the fewest dots you can remove from the grid such that at least one vertex of each of the 14 squares is removed? The answer is a(4) = 4. In general a(n) is the answer for an n X n grid.
This is a "set covering problem", which can be handled by integer linear programming for small n. - Robert Israel, Mar 25 2009
This sequence is complementary to A227133: A227133(n) + a(n) = n^2.

Examples

			1 X 1: 0 dots, since there are already no squares,
2 X 2: 1 dot, any vertex will do,
3 X 3: 2 dots, the center kills all the small squares and you need one corner to kill the big square,
a(4) = 4: there are 4 disjoint squares, so it must be at least 4, and with a little more work you can find a set of 4 dots that work.
From _Robert Israel_: (Start)
For the 5 X 5 case, Maple confirms that the optimal solution is 8 dots,
which can be placed at
[1, 1], [1, 3], [2, 2], [2, 3], [3, 0], [3, 1], [3, 2], [4, 4]
For the 6 X 6 case, Maple tells me that the optimal solution is 12 dots,
which can be placed at
[0, 5], [1, 1], [1, 2], [1, 4], [2, 0], [2, 3], [2, 4], [3, 1], [3, 3],
[4, 0], [4, 4], [5, 2]
For the 7 X 7 case, Maple tells me that the optimal solution is 17 dots,
which can be placed at
[0, 0], [1, 2], [1, 3], [1, 5], [2, 1], [2, 4], [2, 5], [3, 2], [3, 3],
[3, 4], [4, 1], [4, 2], [4, 5], [5, 1], [5, 3], [5, 4], [6, 6]
For n=9, at least a(9) = 30 points (.) have to be removed while 51 (X) of 81 are remaining. The solution is unique (congruent images being ignored).
      . X X X X X . X .
      X . X . . X X X X
      X X . . X . X . X
      X . . X X X X . .
      X X X . X . . X X
      X . X X X . . . X
      . X X . . X X . X
      X X . X . X . X X
      . X X X X X X X .
(End)
		

Crossrefs

See A227133 for an equivalent version of this problem.
A227116 treats an analogous question but for equilateral triangles instead of squares.
A000330 gives the number of subsquares in a square grid of side n.
Cf. also A240443.

Extensions

a(5)-a(7) from Robert Israel, Mar 25 2009
a(8)-a(9) from Heinrich Ludwig, Jul 01 2013
a(10) from Giovanni Resta, Jul 14 2013 (see A152125).
Reworded definition to align this with several similar sequences (A227133, A240443, A227116, etc.). - N. J. A. Sloane, Apr 19 2016
a(11)-a(13) (using A227133) from Alois P. Heinz, May 05 2023

A240443 Maximal number of points that can be placed on an n X n square grid so that no four of them are vertices of a square with any orientation.

Original entry on oeis.org

1, 3, 6, 10, 15, 21, 27, 34, 42, 50
Offset: 1

Author

Heinrich Ludwig, May 07 2014

Keywords

Comments

a(10) >= 50, a(11) >= 58. - Robert Israel, Apr 08 2016
a(12) >= 67. - Robert Israel, Apr 12 2016
a(13) >= 76, a(14) >= 86, a(15) >= 95, a(16) >= 106. - Peter Karpov, Jun 04 2016

Examples

			On a 9 X 9 grid a maximum of 42 points (x) can be placed so that no four of them are vertices of an (arbitrarily oriented) square. An example:
     x x . . x . x . x
     . x . . x x x x .
     x x x . . x . . x
     x . x x x . . x x
     . . . . x x . . .
     . x . x x . . . x
     x x x . x . . . x
     x . x . . . . x x
     x . . x x x x x .
		

Crossrefs

Cf. A227133 (where we are concerned only with subsquares oriented parallel to the sides of the grid), A240114, A227308, A240444.

Extensions

a(10) from Dominik Stadlthanner using integer programming, Apr 08 2020

A240114 Maximal number of points that can be placed on a triangular grid of side n so that no three of them are vertices of an equilateral triangle in any orientation.

Original entry on oeis.org

1, 2, 4, 6, 8, 10, 12, 14, 17, 20, 22, 25, 28, 31, 34
Offset: 1

Author

Heinrich Ludwig, Apr 01 2014

Keywords

Comments

Placing points on a triangular grid of side n, there are A000332(n + 3) triangles to be avoided.
The number k(n) of maximal solutions (reflections and rotations not counted) varies greatly: k(n) = 1, 1, 1, 1, 1, 3, 13, 129, 15, 2, 63, 3, 20, 1, ...
From Elijah Beregovsky, Nov 20 2022: (Start)
a(n) >= 3n-11.
This lower bound is given by the construction seen in the example section.
Conjecture: for n >= 11, a(n) = 3n-11. (End)

Examples

			On a triangular grid of side 15, 34 points (X) can be placed so that no three of them form an equilateral triangle, regardless of its orientation.
                   X
                  . .
                 . X .
                X . X .
               . X . . X
              X . . . X .
             . X . . . . X
            X . . . . . X .
           . X . . . . . . X
          X . . . . . . . X .
         . X . . . . . . . . X
        X . . . . . . . . . X .
       . X . . . . . . . . . . X
      . . . . . . . . . . . . X .
     . . X X X X X X X X X X X . .
		

Crossrefs

Extensions

a(14) from Heinrich Ludwig, Jun 20 2014
a(15) from Heinrich Ludwig, Jun 21 2016

A350296 Minimum number of 1's in an n X n binary matrix with no zero 2 X 2 submatrix.

Original entry on oeis.org

0, 1, 3, 7, 13, 20, 28, 40, 52, 66, 82, 99, 117, 140, 164, 189, 215, 243, 273, 304, 336, 376, 414, 454
Offset: 1

Author

Andrew Howroyd, Dec 23 2021

Keywords

Examples

			Solutions for a(3)=3, a(4)=7, a(5)=13, a(6)=20:
  . . x    . . . x    . . . . x    . . . x x x
  . x .    . x x .    . x x x .    . x x . . x
  x . .    x . x .    x . x x .    x . x . x .
           x x . .    x x . x .    x x . x . .
                      x x x . .    . x x x x .
                                   x . x x . x
		

Crossrefs

Formula

a(n) = A347472(n) + 1 = n^2 - A001197(n) + 1 = n^2 - A072567(n).
a(n) >= A152125(n).

Extensions

a(22)-a(24) computed from A001197, added by Max Alekseyev, Feb 08 2022

A268239 Given an n X n X n grid of points, a(n) is the maximum number of points that can be painted red so that, if any 8 of the red points are chosen, they do not form a cube with sides parallel to the grid.

Original entry on oeis.org

0, 1, 7, 25, 56, 109, 187, 295, 440
Offset: 0

Author

Benoit Cloitre and N. J. A. Sloane, Feb 05 2016

Keywords

Comments

Using a greedy coloring gives a(4) >= 49.

Examples

			For n=3, we may color 25 of the 27 points red (X) without any of 25 red points forming a cube. Color the three slices as follows:
XXX XXX XXX
XXX X.X XXX
XXX XXX xx.
		

Crossrefs

This is a three-dimensional analog of A227133.

Programs

  • Mathematica
    a[n_] := Block[{m, qq, nv = n^3, ne}, qq = Flatten[1 + Table[n^2*z + n*x + y + s*Plus @@@ Tuples[{{0, 1}, {0, n}, {0, n^2}}], {x, 0, n-2}, {y, 0, n-2}, {z, 0, n-2}, {s, Min[n-x, n-y, n-z] - 1}], 3]; ne = Length@ qq; m = Table[0, {ne}, {nv}]; Do[m[[i, qq[[i]]]] = 1, {i, ne}]; Total@ Quiet@ LinearProgramming[ Table[-1, {nv}], m, Table[{7, -1}, {ne}], Table[{0, 1}, {nv}], Integers]]; Table[ a[n], {n, 0, 6}] (* Giovanni Resta, Feb 06 2016 *)

Extensions

a(4)-a(6) from Giovanni Resta, Feb 06 2016
a(7)-a(8) from Paul Tabatabai using integer programming, Sep 27 2018

A271906 Size of the largest subset S of the points of an n X n square grid such that no three of the points of S form a right isosceles triangle.

Original entry on oeis.org

1, 2, 4, 6, 9, 11, 14, 17, 20, 23, 26
Offset: 1

Author

Giovanni Resta and N. J. A. Sloane, Apr 22 2016

Keywords

Comments

S must not contain 3 points A,B,C such that angle ABC = 90 degrees and |AB| = |BC|.
For example, this configuration is forbidden:
O B O O
O O O C
A O O O
O O O O
a(12) >= 29. - Robert Israel, Apr 22 2016
a(13) >= 32, a(14) >= 36, a(15) >= 38 (see pictures in Links). Note that a(14) >= 36 breaks the pattern of increasing by 3 at each step. - Giovanni Resta, Apr 23 2016

Examples

			Illustration for a(3) = 4:
   X X X
   O O O
   O X O
Illustration for a(8) = 17:
   O X O O O O O X
   X O O O O O O X
   O O O X O O O X
   O O X O O O O X
   O O O O O O O X
   O O O O O O O X
   O O O O O O X O
   X X X X X X O O
		

Crossrefs

Programs

  • Mathematica
    d[n_,a_,b_] := Block[{x1, y1, x2, y2}, x1 = Mod[a-1, n]; y1 = Floor[(a-1)/n];x2 = Mod[b-1, n]; y2 = Floor[(b-1)/n]; (x1-x2)^2 + (y1-y2)^2]; isorQ[n_,a_, b_,c_] := Block[{k = Sort[{d[n,a,b], d[n,b,c], d[n, a, c]}]}, k[[1]] == k[[2]] && 2 k[[1]] == k[[3]]]; sol[n_] := sol[n] = Block[{m, L={}, nv=n^2, ne}, Do[If[ isorQ[n, x, y, z], AppendTo[L, {x,y,z}]], {x, n^2}, {y, x-1}, {z, y-1}]; ne = Length@L; m = Table[0, {ne}, {nv}]; Do[m[[i, L[[i]]]] = 1, {i, ne}]; Quiet@ LinearProgramming[ Table[-1, {nv}], m, Table[{2, -1}, {ne}], Table[{0, 1}, {nv}], Integers]]; a[n_] := Total[sol[n]]; Do[Print@ MatrixForm@ Partition[ sol@n, n], {n,6}]; Array[a,6]

A271907 Size of the largest subset S of the points of an n X n square grid such that no three of the points of S form an isosceles triangle.

Original entry on oeis.org

1, 2, 4, 6, 8, 10, 12, 14, 16, 18
Offset: 1

Author

Giovanni Resta and N. J. A. Sloane, Apr 22 2016

Keywords

Comments

S must not contain 3 points A,B,C such that |AB| = |BC|.
For example, this configuration is forbidden:
O O O B
O O O O
A O O O
O C O O
It appears that this is simply a(n) = 2n-2 for n>1, and if so this entry may be replaced by a comment in A271914 and A271906, and this A-number recycled.

Examples

			Illustration for a(3) = 4:
   O X X
   X O O
   X O O
Illustration for a(8) = 14:
   O X X X X X O X
   X O O O O O O X
   X O O O O O O O
   X O O O O O O O
   X O O O O O O O
   X O O O O O O O
   O O O O O O O O
   X X O O O O O O
		

Crossrefs

Main diagonal of A271914.
Showing 1-10 of 15 results. Next