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-3 of 3 results.

A338996 Numbers of squares and rectangles of all sizes in 3*n*(n+1)/2-ominoes in form of three-quarters of Aztec diamonds.

Original entry on oeis.org

0, 5, 27, 85, 205, 420, 770, 1302, 2070, 3135, 4565, 6435, 8827, 11830, 15540, 20060, 25500, 31977, 39615, 48545, 58905, 70840, 84502, 100050, 117650, 137475, 159705, 184527, 212135, 242730, 276520
Offset: 0

Views

Author

Luce ETIENNE, Nov 18 2020

Keywords

Examples

			a(1) = 2*3-1 = 5, a(2) = 2*16-5 = 27, a(3) = 2*50-15 = 85, a(4) = 2*120-35 = 205, a(5) = 2*245-70 = 420, a(6) = 2*448-126 = 770.
		

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[x (2 x + 5)/(1 - x)^5, {x, 0, 30}], x] (* Michael De Vlieger, Dec 12 2020 *)

Formula

G.f.: x*(2*x + 5)/(1 - x)^5.
E.g.f.: exp(x)*x*(120 + 204*x + 76*x^2 + 7*x^3)/24. - Stefano Spezia, Nov 18 2020
a(n) = 5*(n-1) - 10*a(n-2) + 10*a(n-3) - 5*a(n-4) + a(n-5).
a(n) = n*(n + 1)*(n + 2)*(7*n + 13)/24.
a(n) = 2*A004320(n) - A000332(n+3).
a(n) = 2*A000332(n+2) + 5*A000332(n+3).

A356356 Triangle of number of rectangles in the interior of the rectangle with vertices (k,0), (0,k), (n,n+k) and (n+k,n), read by rows.

Original entry on oeis.org

0, 1, 9, 2, 19, 51, 3, 29, 86, 166, 4, 39, 121, 250, 410, 5, 49, 156, 334, 575, 855, 6, 59, 191, 418, 740, 1141, 1589, 7, 69, 226, 502, 905, 1427, 2044, 2716, 8, 79, 261, 586, 1070, 1713, 2499, 3396, 4356, 9, 89, 296, 670, 1235, 1999, 2954, 4076, 5325, 6645
Offset: 1

Views

Author

Evan Robinson, Oct 15 2022

Keywords

Comments

The function of the triangle T(n,k), where n,k > 0, is equal to (n-k+1)*A330805(k-1) - (n-k)*T(k,k-1) + k*(n-k). This is equivalent to saying that this function is (n-k+1) Aztec diamonds (A330805(k-1)) minus the overlaps of those diamonds (two Aztec diamonds of size k-1 overlapped, hence f(k,k-1)) plus (n-k) copies of k extra rectangles. For this last part, the rectangles are of sizes 1 X (2k-1), 3 X (2k-3), 5 X (2k-5), ..., (2k-3) X 3, (2k-1) X 1 and there are (n-k) copies per overlap.
T(n,n) = A330805(n-1).
If n or k <= 0, T(n,k) = 0.
T(n,k) = T(k,k) + (n-k)*A000447(k). That is, incrementing n for fixed k adds a fixed number of new rectangles, equal to A000447(k).
This sequence was prompted by the codegolf.se question linked below, where the problem was to find T(n,k) plus the number of squares and rectangles in an n X k rectangular lattice with diagonals (lines y+a=+-x).

Examples

			Triangle T(n,k) begins:
  n\k  1    2    3    4    5    6    7    8    9   10
   1   0
   2   1    9
   3   2   19   51
   4   3   29   86  166
   5   4   39  121  250  410
   6   5   49  156  334  575  855
   7   6   59  191  418  740 1141 1589
   8   7   69  226  502  905 1427 2044 2716
   9   8   79  261  586 1070 1713 2499 3396 4356
  10   9   89  296  670 1235 1999 2954 4076 5325 6645
For n = 7, k = 3, T(n,k) = (7-3+1)*A330805(3-1) - (7-3)*f(3,2) + 3*(7-3) = 5*51 - 4*19 + 3*4 = 191.
		

Crossrefs

Programs

  • Julia
    function T(n, k)
        (2*(n-k)*(4*k^3-k)+(4*k^4-k^2-3*k))รท6
    end

Formula

T(n,k) = (n-k+1)*A330805(k-1) - (n-k)*T(k,k-1) + k*(n-k).
T(n,k) = (n-k+1)*(4*k^4-k^2-3*k)/6 - (n-k)*T(k,k-1) + k*(n-k).
T(n,k) = 1/3*(n-k)*(4*k^3-k) + (4*k^4-k^2-3*k)/6.
T(n,k) = (n-k)*A000447(k) + A330805(k-1).
T(n,1) = n-1.
T(n,n) = A330805(n-1).
T(n,n-1) = (4*n^4-8*n^3-n^2+5*n)/6.
T(n,k) = (n-1)*A000447(k) - T(k,k-1).

A372917 a(n) is the number of distinct rectangles with area n whose vertices lie on points of a unit square grid.

Original entry on oeis.org

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

Views

Author

Felix Huber, Jun 08 2024

Keywords

Comments

A rectangle in the square unit grid has the sides W = w*sqrt(r) and H = h*sqrt(r). The area is therefore n = w*h*r. Let r be a squarefree divisor of n that can be written as the sum of two squares x^2 + y^2. The number of distinct rectangles is then the sum of the number of ways for each value of r to decompose n/r into two factors w and h (with w >= h).

Examples

			See also the linked illustrations of the terms a(4) = 3, a(8) = 4, a(15) = 3.
n = 4 has the three divisors 1, 2, 4. Since 4 is not squarefree, r can have the values 1 or 2. For r = 1 = 1^2 + 0^2 there are two rectangles (2,2), (4,1). For r = 2 = 1^2 + 1^2 and n/r = 4/2 = 2 = w*h there is the rectangle (2*sqrt(2), 1*sqrt(2)). That's a total of a(4) = 3 distinct rectangles.
n = 8 has the four divisors 1, 2, 4, 8. Since 4 and 8 are not squarefree, r can have the values 1 or 2. For r = 1 = 1^2 + 0^2 there are two rectangles (4,2), (8,1). For r = 2 = 1^2 + 1^2 and n/r = 8/2 = 4 = w*h there are the rectangles (4*sqrt(2), 1*sqrt(2)) and (2*sqrt(2), 2*sqrt(2)). That's a total of a(8) = 4 distinct rectangles.
n = 15 has the four divisors 1, 3, 5, 15. They are all squarefree, but 3 and 15 cannot be written as a sum of two squares, r can only have the values 1 or 5. For r = 1 = 1^2 + 0^2 there are two rectangles (5,3), (15,1). For r = 5 = 2^2 + 1^2 and n/r = 15/5 = 3 = w*h there is the rectangles (3*sqrt(5), 1*sqrt(5)). That's a total of a(15) = 3 distinct rectangles.
		

Crossrefs

Programs

  • Maple
    A372917:= proc(n)
        local f,i,prod;
        f:=ifactors(n)[2];
        prod:=1;
        for i from 1 to numelems(f) do
            if f[i][1] mod 4 = 3 then
                prod:=prod*(1*f[i][2]+1);
            else
                prod:=prod*(2*f[i][2]+1);
            end if;
        end do;
        return round(prod/2);
    end proc;
    seq(A372917(n),n=1..86);
  • PARI
    a(n) = my(f=factor(n)); prod(i=1,#f[,1], if(f[i,1]%4==3,1,2)*f[i,2] + 1) \/ 2; \\ Kevin Ryde, Jun 09 2024

Formula

a(n) = ceiling(Product_{i=1..omega(n)}(k[i]*e[i] + 1)/2), with k[i] = 2 if p[i] mod 4 = 3 and k[i] = 1 else, where p[i]^e[i] is the prime factorization of n.
Showing 1-3 of 3 results.