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.

A143102 Triangle read by rows, A000012 * (A143097 * 0^(n-k)) * A000012, 1<=k<=n.

Original entry on oeis.org

1, 2, 3, 4, 6, 7, 3, 7, 9, 10, 5, 8, 12, 14, 15, 7, 12, 15, 29, 21, 22, 6, 18, 18, 21, 25, 27, 28, 8, 14, 21, 26, 29, 33, 35, 36, 10, 18, 24, 31, 36, 39, 43, 45, 46, 9, 19, 27, 33, 40, 45, 48, 52, 54, 55, 11, 20, 30, 38, 44, 51, 56, 59, 63, 65, 66, 13, 24, 33, 43, 51, 57, 64, 69, 72
Offset: 1

Views

Author

Gary W. Adamson, Jul 24 2008

Keywords

Comments

Left border = A143097: (1, 2, 4, 3, 5, 7, 6, 8,...); right border = A143101, partial sums of A143097: (1, 3, 7, 10, 15, 22, 28,...).
Row sums = A143103: (1, 5, 17, 29, 54, 96,...).

Examples

			First few rows of the triangle are:
1;
2, 3;
4, 6, 7;
3, 7, 9, 10;
5, 8, 12, 14, 15;
7, 12, 15, 19, 21, 22;
6, 13, 18, 21, 25, 27, 28;
...
		

Crossrefs

Formula

Triangle read by rows, A000012 * (A143097 * 0(n-k)) * A000012, 1<=k<=n; where = A000012 = an infinite lower triangular matrix with all 1's and A143097 * 0^(n-k) = an infinite lower triangular matrix with A143097 (1, 2, 4, 3, 5, 7, 6,...) in the main diagonal and the rest zeros.

A288797 Square array a(p,q) = p^2 + q^2 - 2*p - 2*q + 2*gcd(p,q), p >= 1, q >= 1, read by antidiagonals.

Original entry on oeis.org

0, 1, 1, 4, 4, 4, 9, 5, 5, 9, 16, 12, 12, 12, 16, 25, 17, 13, 13, 17, 25, 36, 28, 20, 24, 20, 28, 36, 49, 37, 33, 25, 25, 33, 37, 49, 64, 52, 40, 36, 40, 36, 40, 52, 64, 81, 65, 53, 45, 41, 41, 45, 53, 65, 81, 100, 84, 72, 64, 52, 60, 52, 64, 72, 84, 100
Offset: 1

Views

Author

Luc Rousseau, Jun 16 2017

Keywords

Comments

In the Cartesian plane, let r(p,q) denote the rotation with center origin and angle associated to slope p/q (p: number of units upwards, q: number of units towards the right).
Let R(p,q) be the square of area p^2 + q^2 = R^2, with vertices (0,0), (0,R), (R,R), (R,0).
The natural unit squares (i.e., the (a,a+1) X (b,b+1) Cartesian products, with a and b integers) are transformed by r(p,q) into rotated unit squares.
a(p,q) is the number of rotated unit squares that fully land inside R(p,q).

Examples

			Table begins:
    0   1   4   9  16  25 ...
    1   4   5  12  17  28 ...
    4   5  12  13  20  33 ...
    9  12  13  24  25  36 ...
   16  17  20  25  40  41 ...
   25  28  33  36  41  60 ...
  ... ... ... ... ... ... ...
		

Crossrefs

Programs

  • Mathematica
    A[p_, q_] := p^2 + q^2 - 2*p - 2*q + 2*GCD[p, q];
    (* or, checking without the formula: *)
    okQ[{a_, b_}, p_, q_] := Module[{r2 = p^2 + q^2}, 0 <= a*q - b*p <= r2 && 0 <= a*p + b*q <= r2 && 0 <= a*q - b*p + q <= r2 && 0 <= a*p + b*q + p <= r2 && 0 <= a*q - (b + 1)*p <= r2 && 0 <= a*p + b*q + q <= r2 && 0 <= (a + 1)*q - (b + 1)*p <= r2 && 0 <= a*p + b*q + p + q <= r2];
    A[p_, q_] := Module[{r}, r = Reduce[okQ[{a, b}, p, q], {a, b}, Integers]; If[r[[0]] === And, 1, Length[r]]];
    Flatten[Table[A[p - q + 1, q], {p, 1, 11}, {q, 1, p}]] (* Jean-François Alcover, Jun 17 2017 *)
  • PARI
    a(p,q)=p^2+q^2-2*p-2*q+2*gcd(p,q)
    for(n=2,12,for(p=1,n-1,{q=n-p;print(a(p,q))}))

Formula

a(p,q) = p^2 + q^2 - 2*p - 2*q + 2*gcd(p,q).
a(p,1) = a(1,p) = (p-1)^2 = A000290(p-1).
a(p,p) = 2*p*(p-1) = 4*A000217(p-1).
a(p,p+1) = 2*p*(p-1)+1 = A001844(p-1).
a(p,p+2) = 2*p^2+2*gcd(2,p) = 2*p^2+3+(-1)^(p) = 4*A099392(p-1) = 4*A080827(p).
a(p,p+3) = 2*p^2+2*p+5+4*A079978(p) = 1+4*(1+A143101(p)).
a(p,2*p) = p*(5*p-4) = A051624(p).
a(p,3*p) = 2*p*(5*p-3) = 4*A000566(p).
Showing 1-2 of 2 results.