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.

A114043 Take an n X n square grid of points in the plane; a(n) = number of ways to divide the points into two sets using a straight line.

Original entry on oeis.org

1, 7, 29, 87, 201, 419, 749, 1283, 2041, 3107, 4493, 6395, 8745, 11823, 15557, 20075, 25457, 32087, 39725, 48935, 59457, 71555, 85253, 101251, 119041, 139351, 161933, 187255, 215137, 246691, 280917, 319347, 361329, 407303
Offset: 1

Views

Author

Ugo Merlone (merlone(AT)econ.unito.it) and N. J. A. Sloane, Feb 22 2006

Keywords

Comments

Also, half of the number of two-dimensional threshold functions (A114146).
The line may not pass through any point. This is the "labeled" version - rotations and reflections are not taken into account (cf. A116696).
The number of ways to divide a (2n) X (2n) grid into two sets of equal size is given by 2*A099957(n). - David Applegate, Feb 23 2006
All terms are odd: the line that misses the grid contributes 1 to the total and all other lines contribute 2, 4 or 8, so the total must be odd.
What can be said about the 3-D generalization? - Max Alekseyev, Feb 27 2006

Examples

			Examples: the two sets are indicated by X's and o's.
a(2) = 7:
XX oX Xo XX XX oo oX
XX XX XX Xo oX XX oX
--------------------
a(3) = 29:
XXX oXX ooX ooo ooX ooo
XXX XXX XXX XXX oXX oXX
XXX XXX XXX XXX XXX XXX
-1- -4- -8- -4- -4- -8- Total = 29
--------------------
a(4)= 87:
XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX
XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX
XXXX XXXX XXXX XXXX XXXX XXXo XXXo XXXo XXoo XXoo
XXXX XXXo XXoo Xooo oooo XXoo Xooo oooo Xooo oooo
--1- --4- --8- --8- --4- --4- --8- --8- --8- --8-
XXXX XXXX XXXX XXXX XXXX
XXXo XXXX XXXX XXXo XXXo
XXoo Xooo oooo Xooo XXoo
Xooo oooo oooo oooo oooo
--4- --8- --2- --4- --8- Total = 87.
--------------------
		

Crossrefs

Cf. A114499, A115004, A115005, A116696 (unlabeled case), A114531, A114146.
Cf. A099957.
The following eight sequences are all essentially the same. The simplest is A115004(n), which we denote by z(n). Then A088658(n) = 4*z(n-1); A114043(n) = 2*z(n-1)+2*n^2-2*n+1; A114146(n) = 2*A114043(n); A115005(n) = z(n-1)+n*(n-1); A141255(n) = 2*z(n-1)+2*n*(n-1); A290131(n) = z(n-1)+(n-1)^2; A306302(n) = z(n)+n^2+2*n. - N. J. A. Sloane, Feb 04 2020

Programs

  • Mathematica
    a[n_] := 2*Sum[(n - i)*(n - j)*Boole[CoprimeQ[i, j]], {i, 1, n - 1}, {j, 1, n - 1}] + 2*n^2 - 2*n + 1; Array[a, 40] (* Jean-François Alcover, Apr 25 2016, after Max Alekseyev *)
  • Python
    from sympy import totient
    def A114043(n): return 4*n**2-6*n+3 + 2*sum(totient(i)*(n-i)*(2*n-i) for i in range(2,n)) # Chai Wah Wu, Aug 15 2021

Formula

Let V(m,n) = Sum_{i=1..m, j=1..n, gcd(i,j)=1} (m+1-i)*(n+1-j); then a(n+1) = 2*(n^2 + n + V(n,n)) + 1. - Max Alekseyev, Feb 22 2006
a(n) ~ (3/Pi^2) * n^4. - Max Alekseyev, Feb 22 2006
a(n) = A141255(n) + 1. - T. D. Noe, Jun 17 2008
a(n) = 4*n^2 - 6*n + 3 + 2*Sum_{i=2..n-1} (n-i)*(2n-i)*phi(i). - Chai Wah Wu, Aug 15 2021

Extensions

More terms from Max Alekseyev, Feb 22 2006

A114500 Number of Dyck paths of semilength n having no UUUDDD's starting at level zero; here U=(1,1), D=(1,-1). Also number of Dyck paths of semilength n having no UUDUDD's starting at level zero.

Original entry on oeis.org

1, 1, 2, 4, 12, 37, 119, 390, 1307, 4460, 15452, 54207, 192170, 687386, 2477810, 8992007, 32825653, 120460613, 444125661, 1644324767, 6111002752, 22789116600, 85251100275, 319826371389, 1203008722282, 4536009027311, 17141555233270
Offset: 0

Views

Author

Emeric Deutsch, Dec 04 2005

Keywords

Comments

Column 0 of A114499.

Examples

			a(4)=12 because among the 14 Dyck paths of semilength 4 only UDUUUDDD and UUUDDDUD contain UUUDDD starting at level 0.
		

Crossrefs

Cf. A114499.

Programs

  • Maple
    C:=(1-sqrt(1-4*z))/2/z: G:=1/(1-z*C+z^3): Gser:=series(G,z=0,35): 1,seq(coeff(Gser,z^n),n=1..30);
  • Mathematica
    CoefficientList[Series[1/(1-x*(1-Sqrt[1-4*x])/2/x+x^3), {x, 0, 20}], x] (* Vaclav Kotesovec, Mar 20 2014 *)
  • PARI
    my(x='x+O('x^50)); Vec(2/(1+sqrt(1-4*x)+2*x^3)) \\ Jason Yuen, Sep 09 2024

Formula

G.f.: 1/(1 - z*C + z^3), where C = (1-sqrt(1-4*z))/(2*z) is the Catalan function.
a(n) ~ 4^(n+5)/(1089*sqrt(Pi)*n^(3/2)). - Vaclav Kotesovec, Mar 20 2014
D-finite with recurrence +(n+1)*a(n) +2*(-2*n+1)*a(n-1) +(n+1)*a(n-2) +2*(-2*n+1)*a(n-3) +(n+1)*a(n-5) +2*(-2*n+1)*a(n-6)=0. - R. J. Mathar, Jul 26 2022
Showing 1-2 of 2 results.