A047999 Sierpiński's [Sierpinski's] triangle (or gasket): triangle, read by rows, formed by reading Pascal's triangle (A007318) mod 2.
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
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.
Links
- N. J. A. Sloane, Table of n, a(n) for n = 0..10584 [First 144 rows, flattened; first 50 rows from T. D. Noe].
- J.-P. Allouche and V. Berthe, Triangle de Pascal, complexité et automates, Bulletin of the Belgian Mathematical Society Simon Stevin 4.1 (1997): 1-24.
- J.-P. Allouche, F. v. Haeseler, H.-O. Peitgen and G. Skordev, Linear cellular automata, finite automata and Pascal's triangle, Discrete Appl. Math. 66 (1996), 1-22.
- David Applegate, Omar E. Pol and N. J. A. Sloane, The Toothpick Sequence and Other Sequences from Cellular Automata, Congressus Numerantium, Vol. 206 (2010), 157-191. [There is a typo in Theorem 6: (13) should read u(n) = 4.3^(wt(n-1)-1) for n >= 2.],
- J. Baer, Explore patterns in Pascal's Triangle
- Valentin Bakoev, Fast Bitwise Implementation of the Algebraic Normal Form Transform, Serdica J. of Computing 11 (2017), No 1, 45-57.
- Valentin Bakoev, Properties and links concerning M_n
- Thomas Baruchel, Flattening Karatsuba's Recursion Tree into a Single Summation, SN Computer Science (2020) Vol. 1, Article No. 48.
- Thomas Baruchel, A non-symmetric divide-and-conquer recursive formula for the convolution of polynomials and power series, arXiv:1912.00452 [math.NT], 2019.
- A. Bogomolny, Dot Patterns and Sierpinski Gasket
- Boris A. Bondarenko, Generalized Pascal Triangles and Pyramids, English translation published by Fibonacci Association, Santa Clara Univ., Santa Clara, CA, 1993; see pp. 130-132.
- Paul Bradley and Peter Rowley, Orbits on k-subsets of 2-transitive Simple Lie-type Groups, 2014.
- E. Burlachenko, Fractal generalized Pascal matrices, arXiv:1612.00970 [math.NT], 2016. See p. 9.
- S. Butkevich, Pascal Triangle Applet
- David Callan, Sierpinski's triangle and the Prouhet-Thue-Morse word, arXiv:math/0610932 [math.CO], 2006.
- B. Cherowitzo, Pascal's Triangle using Clock Arithmetic, Part I
- B. Cherowitzo, Pascal's Triangle using Clock Arithmetic, Part II
- C. Cobeli, A. Zaharescu, A game with divisors and absolute differences of exponents, arXiv:1411.1334 [math.NT], 2014; Journal of Difference Equations and Applications, Vol. 20, #11, 2014.
- Ilya Gutkovskiy, Illustrations (triangle formed by reading Pascal's triangle mod m)
- R. K. Guy, The strong law of small numbers. Amer. Math. Monthly 95 (1988), no. 8, 697-712.
- Brady Haran, Chaos Game, Numberphile video, YouTube (April 27, 2017).
- I. Kobayashi et al., Pascal's Triangle
- Dr. Math, Regular polygon formulas [Broken link?]
- Y. Moshe, The distribution of elements in automatic double sequences, Discr. Math., 297 (2005), 91-103.
- National Curve Bank, Sierpinski Triangles
- Hieu D. Nguyen, A Digital Binomial Theorem, arXiv:1412.3181 [math.NT], 2014.
- S. Northshield, Sums across Pascal's triangle modulo 2, Congressus Numerantium, 200, pp. 35-52, 2010.
- A. M. Reiter, Determining the dimension of fractals generated by Pascal's triangle, Fibonacci Quarterly, 31(2), 1993, pp. 112-120.
- F. Richman, Javascript for computing Pascal's triangle modulo n. Go to this page, then under "Modern Algebra and Other Things", click "Pascal's triangle modulo n".
- Vladimir Shevelev, On Stephan's conjectures concerning Pascal triangle modulo 2 and their polynomial generalization, J. of Algebra Number Theory: Advances and Appl., 7 (2012), no.1, 11-29. Also arXiv:1011.6083, 2010.
- N. J. A. Sloane, Illustration of rows 0 to 32 (encoignure style)
- N. J. A. Sloane, Illustration of rows 0 to 64 (encoignure style)
- N. J. A. Sloane, Illustration of rows 0 to 128 (encoignure style)
- N. J. A. Sloane, Catalog of Toothpick and Cellular Automata Sequences in the OEIS
- Eric Weisstein's World of Mathematics, Sierpiński Sieve, Rule 60, Rule 102
- Index entries for sequences related to cellular automata
- Index entries for triangles and arrays related to Pascal's triangle
- Index entries for sequences generated by sieves
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).
Cf. A007318, A054431, A001317, A008292, A083093, A034931, A034930, A008975, A034932, A166360, A249133, A064194, A227133.
From Johannes W. Meijer, Jun 05 2011: (Start)
A106344 is a skew version of this triangle.
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
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.
0, 1, 2, 4, 7, 9, 14, 18, 23, 29, 36, 44, 52, 61, 71
Offset: 1
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.
Links
- Heinrich Ludwig, Illustration of a(2)..a(15)
- Ed Wynn, A comparison of encodings for cardinality constraints in a SAT solver, arXiv:1810.12975 [cs.LO], 2018.
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.
1, 2, 4, 6, 8, 12, 14, 18, 22, 26, 30, 34, 39, 44, 49
Offset: 1
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.
Links
- Heinrich Ludwig, Illustration of a(2)..a(15)
- Giovanni Resta, Illustration of a(3)-a(14)
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.
0, 1, 2, 4, 8, 12, 17, 23, 30, 39, 48, 59, 71
Offset: 1
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
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)
Links
- Ed Wynn, A comparison of encodings for cardinality constraints in a SAT solver, arXiv:1810.12975 [cs.LO], 2018.
Crossrefs
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.
1, 3, 6, 10, 15, 21, 27, 34, 42, 50
Offset: 1
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 .
Links
- Robert Israel, Illustration showing a(10) >= 50
- Robert Israel, Illustration showing a(11) >= 58
- Robert Israel, Illustration showing a(12) >= 67
- Peter Karpov, Maximal density subsquare-free arrangements / #Optimization #OpenProblem / 2016.02.22, giving lower bounds for a(1)-a(16).
- Peter Karpov, Best configurations known for n = 13 .. 16
- Giovanni Resta, Illustration of a(8) and a(9)
- Dominik Stadlthanner, Python program
- Ed Wynn, A comparison of encodings for cardinality constraints in a SAT solver, arXiv:1810.12975 [cs.LO], 2018.
Crossrefs
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.
1, 2, 4, 6, 8, 10, 12, 14, 17, 20, 22, 25, 28, 31, 34
Offset: 1
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 . .
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.
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
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
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.
0, 1, 7, 25, 56, 109, 187, 295, 440
Offset: 0
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.
Links
- Giovanni Resta, Illustration of a(3)-a(6)
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.
1, 2, 4, 6, 9, 11, 14, 17, 20, 23, 26
Offset: 1
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
Links
- Giovanni Resta, Illustration of a(3)-a(11)
- Giovanni Resta, Illustration of lower bounds on a(12)-a(15)
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.
1, 2, 4, 6, 8, 10, 12, 14, 16, 18
Offset: 1
Comments
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
Comments