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.

User: Rob Pratt

Rob Pratt's wiki page.

Rob Pratt has authored 53 sequences. Here are the ten most recent ones:

A367185 Largest cost for a permutation problem.

Original entry on oeis.org

0, 2, 7, 17, 35, 62, 100, 152, 219, 303, 406, 530, 678, 851, 1051, 1280, 1540, 1834, 2163, 2529, 2934, 3380, 3869, 4403, 4985, 5616, 6298, 7033, 7823, 8670, 9576, 10544, 11575, 12671, 13834, 15066, 16369, 17745, 19196, 20724, 22332, 24021, 25793, 27650, 29594, 31627
Offset: 1

Author

Rob Pratt, Nov 10 2023

Keywords

Comments

The problem is to maximize Sum_{i=1..n} i p(i) - Max_{j=1..n} j p(j) where p is a permutation of {1,...,n}.
The terms up to n = 100 were computed via integer linear programming.

Examples

			For n = 4, the best permutation is [1, 4, 3, 2], with a(4) = (1*1+2*4+3*3+4*2) - max(1*1,2*4,3*3,4*2) = 26 - 9 = 17.
		

A347301 Let S be a set of n distinct integers in the range -n-3 to n+3, and consider the sums s+t of pairs of distinct elements of S; a(n) is the maximum number of such sums that are powers of 2, over all choices for S.

Original entry on oeis.org

0, 1, 3, 4, 5, 7, 9, 11, 13, 15, 17, 19, 21, 24, 26, 29, 31, 34, 36, 39, 41, 44, 46, 49, 51, 54, 56, 59, 61, 65, 67, 71, 73, 77, 79, 83, 85, 89, 91, 95, 97, 101, 103, 107, 109, 113, 115, 119, 121, 125, 127, 131, 133, 137, 139, 143, 146, 149, 152, 155, 159, 162, 166, 169, 173, 176
Offset: 1

Author

N. J. A. Sloane, Aug 28 2021, based on information supplied by Rob Pratt and Stan Wagon

Keywords

Comments

For a given set S, we count pairs (s,t) with s in S, t in S, s < t, and s+t equal to a power of 2. (The powers need not be distinct.)
Arises in studying Stan Wagon's Problem of the Week 1321, which asks for the maximum number b(n) if S can be any set of n distinct integers.
The values of a(n) for n <= 100 were found by Rob Pratt using a MILP solver. See links.
Of course b(n) >= a(n). For b(n) see A352178. - N. J. A. Sloane, Mar 07 2022
b(5) >= 6 from {-3, -1, 3, 5, 11} whereas a(5) = 5 from {-4, -3, -1, 3, 5}.
Comments from Rob Pratt: (Start)
With [-100,100] bounds, the optimal values for n=11 to 15 are 17, 19, 21, 24, 26.
With [-70,70] bounds, the optimal values for n=16 to 20 are 29, 31, 34, 36, 39.
The following two infinite families of odd consecutive integers appear to yield an n*log n lower bound.
(C1) For n odd, take S = {4-n, 6-n, ..., -3, -1, 1, 3, ..., n, n+2}.
(C2) For n even, take S = {5-n, 7-n, ..., -3, -1, 1, 3, ..., n+1, n+3}.
This is not always optimal. For example, you can do at least 1 better for n = 27 and 28.
n = 27: S = {-23, -21, -19, -17, -15, -13, -11, -9, -7, -5, -3, -1, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29} yields 56;
n = 28: S = {-23, -21, -19, -17, -15, -13, -11, -9, -7, -5, -3, -1, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31} yields 59;
n = 27: S = {-21, -19, -17, -15, -13, -11, -9, -7, -5, -3, -1, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 37} yields 57;
n = 28: S = {-21, -19, -17, -15, -13, -11, -9, -7, -5, -3, -1, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 35, 37} yields 60.
(End)
Comments from N. J. A. Sloane, Feb 21 2022: (Start)
Construction (C1) can be analyzed as follows. For n = 1, 3, 5, 7, ... the number of powers of 2 are 0, 2, 5, 9, 13, 17, 21, 26, 31, 36, 41, 46, 51, 56, 61, 67, 73, 79, 85, .... (*)
I computed 200 terms of (*), took first differences, and then the RUNS transform, getting essentially A070941, which implies that (*) appears to be A003314((n+1)/2)-3, which is (1/2)*n*log_2(n) - O(n). This is a plausible lower bound on a(n) for all n, and could even be the true order of growth. (End)
From Chai Wah Wu, Sep 21 2022: (Start)
If for S = {t_i}_i, all the integers t_i are even, then the set S generates the same number of powers of 2 as {t_i/2}_i. This is because 2a+2b is a power of 2 if and only if a+b is a power of 2.
It appears that a(n) can be achieved using S with only odd integers (this may be true for A352178 as well):
a(2) = 1: { -3, 5 }
a(3) = 3: { -1, 3, 5 }
a(4) = 4: { -3, -1, 3, 5 }
a(5) = 5: { -3, -1, 1, 3, 5 }
a(6) = 7: { -5, -3, -1, 5, 7, 9 }
a(7) = 9: { -5, -3, -1, 3, 5, 7, 9 }
a(8) = 11: { -7, -5, -3, -1, 5, 7, 9, 11 }
a(9) = 13: { -7, -5, -3, -1, 3, 5, 7, 9, 11 }
a(10) = 15: { -9, -5, -3, -1, 3, 5, 7, 9, 11, 13 }
a(11) = 17: { -9, -7, -5, -3, -1, 3, 5, 7, 9, 11, 13 }
a(12) = 19: { -9, -7, -5, -3, -1, 1, 3, 5, 7, 9, 11, 13 }
a(13) = 21: { -11, -7, -5, -3, -1, 1, 3, 5, 7, 9, 11, 13, 15 }
(End)
Comments from Eric Snyder, Oct 22 2022: (Start)
Construction (C1), along with the variable M from S. Wagon's solution linked below, is not unique to each n. For instance, for n = 128, all of M = {9, 11, 13, 15, 17} result in the same value, a(n) = 399. (However, for n = 4^p, M = 1 + 2^p does seem to be unique.)
If we consider only the central value of M for each n, M appears to be a stepwise function that "prefers" values near powers of 2, or halfway between powers of 2.
Conjecture: Construction (C1), with proper values of M, will compute the majority of maximal values for a(n). The exceptions, like 27, 28 above, seem to cluster near (7/8)*2^k, with a run from n = 54 to n = 59, and another from n = 111 to n = 124 (comparing values from (C1) to those provided by T. Scheuerle in A352178).
These exceptions seem to arise because including 2^k+1 and/or 2^k+3 in the set allows for connections to -1 and -3 (as well as lower negative numbers), where having 2^k-1 or 2^k-3 in the set of values would only connect to lower negative numbers. (End)

Examples

			a(3) = b(3) = 3 from S = {-1, 3, 5}.
		

Crossrefs

See A352178 for the unrestricted problem.

A337503 Minimum number of painted cells in an n X n grid to avoid unpainted pentominoes.

Original entry on oeis.org

0, 0, 3, 5, 8, 13, 17, 24, 31, 39
Offset: 1

Author

Rob Pratt, Aug 29 2020

Keywords

Examples

			For n = 3, painting only 2 cells would leave an unpainted pentomino, but painting the following 3 cells avoids all unpainted pentominoes:
. . .
. X X
X . .
		

Crossrefs

A337502 Minimum number of painted cells in an n X n grid to avoid unpainted tetrominoes.

Original entry on oeis.org

0, 1, 3, 6, 9, 15, 20, 27, 34, 43
Offset: 1

Author

Rob Pratt, Aug 29 2020

Keywords

Examples

			For n = 4, painting only 5 cells would leave an unpainted tetromino, but painting the following 6 cells avoids all unpainted tetrominoes:
. . X .
X X . X
. . X .
. X . .
		

Crossrefs

Cf. A337501.

A337501 Minimum number of painted cells in an n X n grid to avoid unpainted trominoes.

Original entry on oeis.org

0, 2, 4, 8, 11, 18, 23, 32, 39, 50
Offset: 1

Author

Rob Pratt, Aug 29 2020

Keywords

Examples

			For n = 3, painting only 3 cells would leave an unpainted tromino, but painting the following 4 cells avoids all unpainted trominoes:
. . X
X X .
. . X
		

A327469 Number of nonempty subsets of [1..n] which are geometric progressions of length >= 3 with rational ratio and are locally maximal.

Original entry on oeis.org

0, 0, 0, 1, 1, 1, 1, 1, 3, 3, 3, 4, 4, 4, 4, 5, 5, 7, 7, 8, 8, 8, 8, 8, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 19, 19, 19, 19, 19, 19, 19, 19, 20, 22, 22, 22, 23, 29, 33, 33, 34, 34, 34, 34, 34, 34, 34, 34, 35, 35, 35, 37, 40, 40, 40, 40, 41, 41, 41, 41, 45, 45, 45, 49, 50, 50, 50, 50, 51, 55, 55, 55, 56, 56, 56, 56, 56, 56, 58, 58, 59, 59, 59, 59, 60, 60, 66, 68, 77
Offset: 1

Author

N. J. A. Sloane, Oct 03 2019, using data computed by Rob Pratt

Keywords

Comments

Exceptionally, DATA section give first 100 terms.
One might have expected that the GP would be required to have an integer ratio, but in fact we allow rational ratios. The GPs can be assumed to be increasing.

Crossrefs

A307177 Decimal expansion of smallest nontrivial base-10 number that contains all pairwise products of its digits as substrings.

Original entry on oeis.org

1, 0, 1, 2, 0, 1, 4, 0, 1, 5, 2, 1, 6, 2, 4, 2, 5, 3, 0, 3, 2, 7, 2, 8, 1, 8, 3, 5, 4, 5, 6, 3, 6, 4, 8, 4, 9
Offset: 37

Author

Rob Pratt, Mar 27 2019

Comments

"Pairwise products" includes the squares of the digits.
Suggested by Ricardo Palomino, who mentioned the trivial numbers A007088.
If any digit other than 0 or 1 appears, then all ten digits appear, as can easily be checked for each digit. For example, if 2 appears then 2*2 = 4 appears, which implies that 2*4 = 8 appears and {1,6} (from 4*4 = 16) appear, which implies that 3 appears (from 4*8 = 32), which implies that 3*3 = 9 appears, which implies that {2,7} appear (from 3*9), which implies that {5,6} appear (from 7*8), which implies that 0 appears (from 2*5 = 10).
There are 37 distinct products (10 with one digit and 27 with two digits) of pairs of digits from {0,1,...,9}.
Rob Pratt solved an asymmetric traveling salesman problem (ATSP) on 38 nodes to find the minimum number of digits, which turns out to be 37, and then solved a sequence of integer linear programming problems (minimizing one digit at a time from left to right) to find the minimum such 37-digit number.

Examples

			1012014015216242530327281835456364849.
		

Crossrefs

A203565 considers only products of adjacent digits.

A274616 Maximal number of non-attacking queens on a right triangular board with n cells on each side.

Original entry on oeis.org

0, 1, 1, 2, 2, 3, 4, 5, 5, 6, 7, 7, 8, 9, 9, 10, 11, 11, 12, 13, 13, 14, 15, 15, 16, 17, 17, 18, 19, 19, 20, 21, 21, 22, 23, 23, 24, 25, 25, 26, 27, 27, 28, 29, 29, 30, 31, 31, 32, 33, 33, 34, 35, 35, 36, 37, 37, 38, 39, 39, 40, 41, 41, 42, 43, 43, 44, 45, 45, 46, 47, 47
Offset: 0

Author

Rob Pratt and N. J. A. Sloane, Jul 01 2016

Keywords

Comments

This sequence was mentioned by R. K. Guy in the first comment in A004396.

Examples

			n=3:
OOX
XO
O
n=4:
OOOX
OXO
OO
O
n=5:
OOOOX
OOXO
XOO
OO
O
		

References

  • Paul Vanderlind, Richard K. Guy, and Loren C. Larson, The Inquisitive Problem Solver, MAA, 2002. See Problem 252, pages 67, 87, 198 and 276.

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[x*(1 +x^2 -x^3)*(1 +x^4)/((1-x)^2*(1+x+x^2)), {x, 0, 50}], x] (* G. C. Greubel, Jul 03 2016 *)
  • PARI
    concat(0, Vec(x*(1+x^2-x^3)*(1+x^4)/((1-x)^2*(1+x+x^2)) + O(x^100))) \\ Colin Barker, Jul 02 2016

Formula

Except for n=4, this is round(2n/3).
From Colin Barker, Jul 02 2016: (Start)
a(n) = a(n-1) + a(n-3) - a(n-4) for n>5.
G.f.: x*(1+x^2-x^3)*(1+x^4)/((1-x)^2*(1+x+x^2)). (End)
a(n) = 2*(3*n + sqrt(3)*sin((2*Pi*n)/3)) / 9. - Colin Barker, Mar 08 2017

A271914 Symmetric array read by antidiagonals: T(n,k) (n>=1, k>=1) = maximal number of points that can be chosen in an n X k rectangular grid such that no three distinct points form an isosceles triangle.

Original entry on oeis.org

1, 2, 2, 3, 2, 3, 4, 4, 4, 4, 5, 4, 4, 4, 5, 6, 5, 5, 5, 5, 6, 7, 6, 6, 6, 6, 6, 7, 8, 7, 8, 7, 7, 8, 7, 8, 9, 8, 8, 8, 8, 8, 8, 8, 9, 10, 9, 10, 9, 9, 9, 9, 10, 9, 10
Offset: 1

Author

Rob Pratt and N. J. A. Sloane, Apr 24 2016

Keywords

Comments

It is conjectured that T(n,k) <= n+k-1.
The array is symmetric: T(n,k) = T(k,n).
The main diagonal T(n,n) appears to equal 2n-2 for n>1. (This diagonal is presently A271907, but if it really is 2n-2 that entry may be recycled.)
The triangle must have nonzero area (three collinear points don't count as a triangle).

Examples

			The array begins:
   1,  2,  3,  4,  5,  6,  7,  8,  9, 10, ...
   2,  2,  4,  4,  5,  6,  7,  8,  9, 10, ...
   3,  4,  4,  5,  6,  8,  8, 10, 10, 12, ...
   4,  4,  5,  6,  7,  8,  9, 10, 11, 12, ...
   5,  5,  6,  7,  8,  9, 10, 12, 12, 14, ...
   6,  6,  8,  8,  9, 10, 11, 12, 12, 14, ...
   7,  7,  8,  9, 10, 11, 12, 13, 14, 16, ...
   8,  8, 10, 10, 12, 12, 13, 14, 16, 16, ...
   9,  9, 10, 11, 12, 12, 14, 16, 16, 18, ...
  10, 10, 12, 12, 14, 14, 16, 16, 18, 18, ...
  ...
As a triangle:
   1,
   2,  2,
   3,  2,  3,
   4,  4,  4,  4,
   5,  4,  4,  4,  5,
   6,  5,  5,  5,  5,  6,
   7,  6,  6,  6,  6,  6,  7,
   8,  7,  8,  7,  7,  8,  7,  8,
   9,  8,  8,  8,  8,  8,  8,  8,  9,
  10,  9, 10,  9,  9,  9,  9, 10,  9, 10,
  ...
Illustration for T(2,3) = 4:
XOX
XOX
Illustration for T(2,5) = 5:
XXXXX
OOOOO
Illustration for T(3,5) = 6 (this left edge + top edge construction - or a slight modification of it - works in many cases):
OXXXX
XOOOO
XOOOO
Illustration for T(3,6) = 8:
XXOOXX
OOOOOO
XXOOXX
Illustration for T(3,8) = 10:
OXXXXXXO
XOOOOOOX
XOOOOOOX
Illustration for T(6,9) = 12:
OXOOOOOOX
OOXXXXXXO
OOOOOOOOO
OXOOOOOOX
OXOOOOOOX
OOOOOOOOO
From _Bob Selcoe_, Apr 24 2016 (Start)
Two symmetric illustrations for T(6,9) = 12:
Grid 1:
X X O O O O O X X
O O O O O O O O O
O O O O O O O O O
O X X X O X X X O
X O O O O O O O X
O O O O O O O O O
Grid 2:
X O O O O O O O X
X O O O O O O O X
O O O O O O O O O
O X X X O X X X O
X O O O O O O O X
O O O O O O O O O
(Note that a symmetric solution is obtained for T(5,9) = 12 by removing row 6)
(End)
		

Crossrefs

Cf. A271910.
Main diagonal is A271907.

Formula

From Chai Wah Wu, Nov 30 2016: (Start)
T(n,k) >= max(n,k).
T(n,max(k,m)) <= T(n,k+m) <= T(n,k) + T(n,m).
T(n,1) = n.
T(n,2) = n for n > 3.
For n > 4, T(n,3) >= n+1 if n is odd and T(n,3) >= n+2 if n is even.
Conjecture: For n > 4, T(n,3) = n+1 if n is odd and T(n,3) = n+2 if n is even.
Conjecture: If n is even, then T(n,k) <= n+k-2 for k >= 2n.
(End)

A264667 Number of optimal solutions to the maximal number of diagonals problem studied in A264041.

Original entry on oeis.org

2, 4, 28, 108, 2, 13968, 480, 7914054, 433284, 18726123500, 256, 178290006448984, 14454384, 6631290958957860856, 1401615406696, 941558205279187913101914, 1767136, 500995759754153499284692617816, 31163356068736, 984452644453618816989710782436259368
Offset: 1

Author

Rob Pratt, Nov 20 2015

Keywords

Comments

Solutions that differ by a rotation and/or reflection are counted as different. - N. J. A. Sloane, Nov 20 2015
The paper by Boyland et al. gives a(13) = 14454384 and a(15) = 1401615406696. - Eric M. Schmidt, Aug 30 2017

Examples

			For n=2 the 4 solutions are:
.\
\\
--
/.
//
--
\\
\.
--
//
./
--
where the dot indicates an empty cell.
		

Crossrefs

Cf. A264041.

Extensions

a(8)-a(13) from Andrew Howroyd, Feb 03 2018
a(14)-a(20) from Andrew Howroyd, Jun 22 2018