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

A002939 a(n) = 2*n*(2*n-1).

Original entry on oeis.org

0, 2, 12, 30, 56, 90, 132, 182, 240, 306, 380, 462, 552, 650, 756, 870, 992, 1122, 1260, 1406, 1560, 1722, 1892, 2070, 2256, 2450, 2652, 2862, 3080, 3306, 3540, 3782, 4032, 4290, 4556, 4830, 5112, 5402, 5700, 6006, 6320, 6642, 6972, 7310, 7656, 8010, 8372
Offset: 0

Views

Author

Keywords

Comments

Write 0,1,2,... in a spiral; sequence gives numbers on one of 4 diagonals (see Example section).
For n>1 this is the Engel expansion of cosh(1), A118239. - Benoit Cloitre, Mar 03 2002
a(n) = A125199(n,n) for n>0. - Reinhard Zumkeller, Nov 24 2006
Central terms of the triangle in A195437: a(n+1) = A195437(2*n,n). - Reinhard Zumkeller, Nov 23 2011
For n>2, the terms represent the sums of those primitive Pythagorean triples with hypotenuse (H) one unit longer than the longest side (L), or H = L + 1. - Richard R. Forberg, Jun 09 2015
For n>1, a(n) is the perimeter of a Pythagorean triangle with an odd leg 2*n-1. - Agola Kisira Odero, Apr 26 2016
From Rigoberto Florez, Nov 07 2020 : (Start)
A338109(n)/a(n+1) is the Kirchhoff index of the join of the disjoint union of two complete graphs on n vertices with the empty graph on n+1 vertices.
Equivalently, the graph can be described as the graph on 3*n + 1 vertices with labels 0..3*n and with i and j adjacent iff iff i+j> 0 mod 3.
A338588(n)/a(n+1) is the Kirchhoff index of the disjoint union of two complete graphs each on n and n+1 vertices with the empty graph on n+1 vertices.
Equivalently, the graph can be described as the graph on 3*n + 2 vertices with labels 0..3*n+1 and with i and j adjacent iff i+j> 0 mod 3.
These graphs are cographs. (End)
a(n), n>=1, is the number of paths of minimum length (length=2) from the origin to the cross polytope of size 2 in Z^n (column 2 in A371064). - Shel Kaphan, Mar 09 2024

Examples

			G.f. = 2*x + 12*x^2 + 30*x^3 + 56*x^4 + 90*x^5 + 132*x^6 + 182*x^7 + 240*x^8 + ...
On a square lattice, place the nonnegative integers at lattice points forming a spiral as follows: place "0" at the origin; then move one step in any of the four cardinal directions and place "1" at the lattice point reached; then turn 90 degrees in either direction and place a "2" at the next lattice point; then make another 90-degree turn in the same direction and place a "3" at the lattice point; etc. The terms of the sequence will lie along one of the diagonals, as seen in the example below:
.
   99  64--65--66--67--68--69--70--71--72
    |   |                               |
   98  63  36--37--38--39--40--41--42  73
    |   |   |                       |   |
   97  62  35  16--17--18--19--20  43  74
    |   |   |   |               |   |   |
   96  61  34  15   4---5---6  21  44  75
    |   |   |   |   |       |   |   |   |
   95  60  33  14   3  *0*  7  22  45  76
    |   |   |   |   |   |   |   |   |   |
   94  59  32  13  *2*--1   8  23  46  77
    |   |   |   |           |   |   |   |
   93  58  31 *12*-11--10---9  24  47  78
    |   |   |                   |   |   |
   92  57 *30*-29--28--27--26--25  48  79
    |   |                           |   |
   91 *56*-55--54--53--52--51--50--49  80
    |                                   |
  *90*-89--88--87--86--85--84--83--82--81
.
[Edited by _Jon E. Schoenfield_, Jan 01 2017]
		

References

  • R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 2nd ed., 1994, p. 99.

Crossrefs

Sequences on the four axes of the square spiral: Starting at 0: A001107, A033991, A007742, A033954; starting at 1: A054552, A054556, A054567, A033951.
Sequences on the four diagonals of the square spiral: Starting at 0: A002939 = 2*A000384, A016742 = 4*A000290, A002943 = 2*A014105, A033996 = 8*A000217; starting at 1: A054554, A053755, A054569, A016754.
Sequences obtained by reading alternate terms on the X and Y axes and the two main diagonals of the square spiral: Starting at 0: A035608, A156859, A002378 = 2*A000217, A137932 = 4*A002620; starting at 1: A317186, A267682, A002061, A080335.
Cf. numbers of the form n*(n*k-k+4)/2 listed in A226488 (this sequence is the case k=8). - Bruno Berselli, Jun 10 2013
Cf. A017089 (first differences), A268684 (partial sums), A010050 (partial products).
Cf. A371064.

Programs

Formula

Sum_{n >= 1} 1/a(n) = log(2) (cf. Tijdeman).
Log(2) = Sum_{n >= 1} ((1 - 1/2) + (1/3 - 1/4) + (1/5 - 1/6) + (1/7 - 1/8) + ...) = Sum_{n >= 0} (-1)^n/(n+1). Log(2) = Integral_{x=0..1} 1/(1+x) dx. - Gary W. Adamson, Jun 22 2003
a(n) = A000384(n)*2. - Omar E. Pol, May 14 2008
From R. J. Mathar, Apr 23 2009: (Start)
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3).
G.f.: 2*x*(1+3*x)/(1-x)^3. (End)
a(n) = a(n-1) + 8*n - 6 (with a(0)=0). - Vincenzo Librandi, Nov 12 2010
a(n) = A118729(8n+1). - Philippe Deléham, Mar 26 2013
Product_{k=1..n} a(k) = (2n)! = A010050(n). - Tony Foster III, Sep 06 2015
E.g.f.: 2*x*(1 + 2*x)*exp(x). - Ilya Gutkovskiy, Apr 29 2016
a(n) = A002943(-n) for all n in Z. - Michael Somos, Jan 28 2017
0 = 12 + a(n)*(-8 + a(n) - 2*a(n+1)) + a(n+1)*(-8 + a(n+1)) for all n in Z. - Michael Somos, Jan 28 2017
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi/4 - log(2)/2. - Amiram Eldar, Jul 31 2020

A028399 a(n) = 2^n - 4.

Original entry on oeis.org

0, 4, 12, 28, 60, 124, 252, 508, 1020, 2044, 4092, 8188, 16380, 32764, 65532, 131068, 262140, 524284, 1048572, 2097148, 4194300, 8388604, 16777212, 33554428, 67108860, 134217724, 268435452, 536870908, 1073741820, 2147483644, 4294967292, 8589934588, 17179869180
Offset: 2

Views

Author

Keywords

Comments

Number of permutations of [n] with 2 sequences.
Number of 2 X n binary matrices that avoid simultaneously the right angled numbered polyomino patterns (ranpp) (00;1) and (11;0). An occurrence of a ranpp (xy;z) in a matrix A=(a(i,j)) is a triple (a(i1,j1), a(i1,j2), a(i2,j1)) where i1Sergey Kitaev, Nov 11 2004
The number of edges in the dual Edwards-Venn diagram graph with n-1 digits when n>2.
a(n) (n>=6) is the number of vertices in the molecular graph NS2[n-5], defined pictorially in the Ashrafi et al. reference (Fig. 2, where NS2[2] is shown). - Emeric Deutsch, May 16 2018
From Petros Hadjicostas, Aug 08 2019: (Start)
With regard to the comment above about a(n) being the "number of permutations of [n] with 2 sequences", we refer to Ex. 13 (pp. 260-261) of Comtet (1974), who uses the definition of a "séquence" given by André in several of his papers in the 19th century.
In the terminology of array A059427, these so-called "séquences" in permutations (defined by Comtet and André) are called "alternating runs" (or just "runs"). We discuss these so-called "séquences" below.
If b = (b_1, b_2, ..., b_n) is a permutation of [n], written in one-line notation (not in cycle notation), a "séquence" in a permutation of length l >= 2 (according to Comtet) is a maximal interval of integers {i, i+1, ..., i+l-1} for some i (where 1 <= i <= n-l+1) such that b_i < b_{i+1} < ... < b_{i+l-1} or b_i > b_{i+1} > ... > b_{i+l-1}. (The word "maximal" means that, in the first case, we have b_{i-1} > b_i and b_{i+l} < b_{i+l-1}, while in the second case, we have b_{i-1} < b_i and b_{i+l} > b_{i+l-1} provided b_{i-1} and b_{i+l} can be defined.)
When defining a "séquence", André (1884) actually refers to the list of terms (b_i, b_{i+1}, ..., b_{i+l-1}) rather than the corresponding index set {i, i+1, ..., i+l-1} (which is essentially the same thing).
For more details about these so-called "séquences" (or "alternate runs"), see the comments and examples for sequence A000708.
(End)
For n >= 1, a(n+2) is the number of shortest paths from (0,0) of a square grid to {(x,y): |x|+|y| = n} along the grid line. - Jianing Song, Aug 23 2021

Examples

			From _Petros Hadjicostas_, Aug 08 2019: (Start)
We have a(3) = 4 because each of the following permutations of [3] has the following so-called "séquences" ("alternate runs"):
   123 -> 123 (one),
   132 -> 13, 32 (two),
   213 -> 21, 13 (two),
   231 -> 23, 31 (two),
   312 -> 31, 12 (two),
   321 -> 321 (one).
Recall that a so-called "séquence" ("alternate run") must start with a "maximum" and end with "minimum", or vice versa, and it should not contain any other maxima and minima in between. Two consecutive such "séquences" ("alternate runs") have exactly one minimum or exactly one maximum in common.
(End)
		

References

  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 261.
  • A. W. F. Edwards, Cogwheels of the Mind, Johns Hopkins University Press, 2004, p. 82.

Crossrefs

Column k = 2 of A059427.
Row n = 2 of A371064.

Programs

  • GAP
    a:=List([2..40], n->2^n-4); # Muniru A Asiru, May 17 2018
    
  • Maple
    seq(2^n-4, n=2..40); # Muniru A Asiru, May 17 2018
  • Mathematica
    2^Range[2,40]-4 (* Harvey P. Dale, Jul 05 2019 *)
  • PARI
    a(n)=if(n<2, 0, 2^n-4)
    
  • Python
    def A028399(n): return (1<Chai Wah Wu, Jun 27 2023

Formula

O.g.f.: 4*x^3/((1-x)*(1-2*x)). - R. J. Mathar, Aug 07 2008
From Reinhard Zumkeller, Feb 28 2010: (Start)
a(n) = A175164(2*n)/A140504(n+2);
a(2*n) = A052548(n)*A000918(n) for n > 0;
a(n) = A173787(n,2). (End)
a(n) = a(n-1) + 2^(n-1) (with a(2)=0). - Vincenzo Librandi, Nov 22 2010
a(n) = 4*A000225(n-2). - R. J. Mathar, Dec 15 2015
E.g.f.: 3 + 2*x - 4*exp(x) + exp(2*x). - Stefano Spezia, Apr 06 2021
a(n) = sigma(A003945(n-2)) for n>=3. - Flávio V. Fernandes, Apr 20 2021

Extensions

Additional comments from Barbara Haas Margolius (margolius(AT)math.csuohio.edu), Dec 02 2001

A371568 Array read by ascending antidiagonals: A(n, k) is the number of paths of length k in Z^n from the origin to points such that x1+x2+...+xn = k with x1,...,xn > 0.

Original entry on oeis.org

1, 0, 1, 0, 2, 1, 0, 0, 6, 1, 0, 0, 6, 14, 1, 0, 0, 0, 36, 30, 1, 0, 0, 0, 24, 150, 62, 1, 0, 0, 0, 0, 240, 540, 126, 1, 0, 0, 0, 0, 120, 1560, 1806, 254, 1, 0, 0, 0, 0, 1800, 8400, 5796, 510, 1
Offset: 1

Views

Author

Shel Kaphan, Mar 28 2024

Keywords

Comments

T(n, k) can also be seen as the number of ordered partitions of k items into n nonempty buckets.
T(n, n) = n!, which is readily seen because to go from the origin to a point in Z^n a distance n away, with at least one step taken in each dimension, the first step can be in any of n dimensions, the second step in any of n-1 dimensions, and so on.
This array is the image of Pascal's triangle A007318 under the Akiyama-Tanigawa transformation. See the Python program. - Peter Luschny, Apr 19 2024

Examples

			 n\k 1 2 3  4   5    6     7      8       9       10
  --------------------------------------------------
 1|  1 1 1  1   1    1     1      1       1        1
 2|  0 2 6 14  30   62   126    254     510     1022
 3|  0 0 6 36 150  540  1806   5796   18150    55980
 4|  0 0 0 24 240 1560  8400  40824  186480   818520
 5|  0 0 0  0 120 1800 16800 126000  834120  5103000
 6|  0 0 0  0   0  720 15120 191520 1905120 16435440
 7|  0 0 0  0   0    0  5040 141120 2328480 29635200
 8|  0 0 0  0   0    0     0  40320 1451520 30240000
 9|  0 0 0  0   0    0     0      0  362880 16329600
10|  0 0 0  0   0    0     0      0       0  3628800
		

Crossrefs

Cf. A000918 (n=2), A001117 (n=3), A000919 (n=4), A001118 (n=5), A000920 (n=6).
Cf. A135456 (n=7), A133068 (n=8), A133360 (n=9), A133132 (n=10).
See A019538 and A131689 for other versions.

Programs

  • Mathematica
    A[n_,k_] := Sum[(-1)^(n-i) * i^k * Binomial[n,i], {i,1,n}]
  • Python
    # The Akiyama-Tanigawa algorithm for the binomial generates the rows.
    # Adds row(0) = 0^k and column(0) = 0^n.
    from math import comb as binomial
    def ATBinomial(n, len):
        A = [0] * len
        R = [0] * len
        for k in range(len):
            R[k] = binomial(k, n)
            for j in range(k, 0, -1):
                R[j - 1] = j * (R[j] - R[j - 1])
            A[k] = R[0]
        return A
    for n in range(11): print([n], ATBinomial(n, 11))  # Peter Luschny, Apr 19 2024

Formula

A(n,k) = Sum_{i=1..n} (-1)^(n-i) * binomial(n,i) * i^k

A366058 Number of n-step self-avoiding walks on a 3D cubic lattice where no step is to a lattice point closer to the origin than the current point.

Original entry on oeis.org

1, 6, 30, 126, 462, 1566, 5070, 15966, 49422, 151326, 460110, 1392606, 4202382, 12656286, 38067150, 114398046, 343587342, 1031548446, 3096218190, 9291800286, 27881692302, 83657659806, 250998145230, 753044767326, 2259234965262, 6777906222366, 20334121320270, 61003169267166, 183011118414222
Offset: 0

Views

Author

Scott R. Shannon, Dec 15 2023

Keywords

Comments

Consider the n-step self-avoiding walks from the origin in the first octant that increase in L1 distance from the origin on each step. There are 3^n such walks since each of the n steps may occur in any of 3 ways. To account for all combinations of signs of coordinates, there are binomial(3,3)*2^3 = 8 octants so there would be 8*3^n n-step paths total, but they overlap where one or more coordinates of the endpoint are 0. They overlap pairwise on the binomial(3,2)*2^2 = 12 edges of the octahedron at distance n from the origin. Each edge represents 2^n paths, since holding one coordinate 0, either of the other two coordinates may be chosen for each step. So now we have 8*3^n - 12*2^n to avoid double counting the edges. However, since the edges overlap at each of the binomial(3,1)*2^1 = 6 octahedral vertices, we have now eliminated the vertices, so they must be added back in. There is only one n-step path from the origin to each octahedral vertex. Thus, there are 8*3^n - 12*2^n + 6 paths of length n that increase in distance from the origin at each step. - Shel Kaphan, Mar 10 2024

Examples

			a(2) = 30 as after two steps no walk can step closer to the origin than its current point, so a(2) = A001412(2) = 30.
a(3) = 126. Given the first two steps of the 3-step walk are to points (1,0,0) and (1,0,1) then a step to (0,0,1) is forbidden. This walk can be taken in 4*6 = 24 ways on the cubic lattice, so the total number of permitted walks is a(3) = A001412(3) - 24 = 150 - 24 = 126.
		

Crossrefs

Cf. A173033 (2D square lattice), A001412.
Cf. A371064.

Formula

Conjectured: a(n) = 6*(4*3^(n-1) - 4*2^(n-1) + 1), for n > 0.
a(n) = Sum_{i=1..d} (-1)^(d-i) * binomial(d,i) * 2^i * i^n, where d=3, n>=1, which simplifies to 8*3^n - 12*2^n + 6, equivalent to conjectured formula (and row 3 of A371064). - Shel Kaphan, Mar 09 2024

A370469 Triangle read by columns where T(n,k) is the number of points in Z^n such that |x1| + ... + |xn| = k, |x1|, ..., |xn| > 0.

Original entry on oeis.org

2, 2, 4, 2, 8, 8, 2, 12, 24, 16, 2, 16, 48, 64, 32, 2, 20, 80, 160, 160, 64, 2, 24, 120, 320, 480, 384, 128, 2, 28, 168, 560, 1120, 1344, 896, 256, 2, 32, 224, 896, 2240, 3584, 3584, 2048, 512, 2, 36, 288, 1344, 4032, 8064, 10752, 9216, 4608, 1024
Offset: 1

Views

Author

Shel Kaphan, Mar 30 2024

Keywords

Comments

T(n,k) is the number of points on the n-dimensional cross polytope with facets at distance k from the origin which have no coordinate equal to 0.
T(n,n) = 2^n. The (n-1)-dimensional simplex at distance n from the origin in Z^n has exactly 1 point with no zero coordinates, at (1,1,...,1). There are 2^n (n-1)-dimensional simplexes at distance n from the origin as part of the cross polytope in Z^n. (The lower dimensional facets do not count as they have at least one 0 coordinate.)
T(2*n,3*n) = T(2*n+1,3*n), and this is A036909.

Examples

			 n\k 1 2 3  4  5   6   7    8    9    10    11    12     13     14      15
   -----------------------------------------------------------------------
 1 | 2 2 2  2  2   2   2    2    2     2     2     2      2      2       2
 2 |   4 8 12 16  20  24   28   32    36    40    44     48     52      56
 3 |     8 24 48  80 120  168  224   288   360   440    528    624     728
 4 |       16 64 160 320  560  896  1344  1920  2640   3520   4576    5824
 5 |          32 160 480 1120 2240  4032  6720 10560  15840  22880   32032
 6 |              64 384 1344 3584  8064 16128 29568  50688  82368  128128
 7 |                 128  896 3584 10752 26880 59136 118272 219648  384384
 8 |                      256 2048  9216 30720 84480 202752 439296  878592
 9 |                           512  4608 23040 84480 253440 658944 1537536
10 |                                1024 10240 56320 225280 732160 2050048
11 |                                      2048 22528 135168 585728 2050048
12 |                                            4096  49152 319488 1490944
13 |                                                   8192 106496  745472
14 |                                                         16384  229376
15 |                                                                 32768
The cross polytope in Z^3 (the octahedron) with points at distance 3 from the origin has 8 triangle facets, each with edge length 4. There is one point in the center of each triangle with coordinates (+-1,+-1,+-1).
		

Crossrefs

Cf. A033996, A333714 (n=3)
Cf. A102860 (n=4).
Cf. A036289, A097064, A134401 (+1-diagonal).
Cf. A001815 (+2-diagonal).
Cf. A371064.
Cf. A036909.
2 * A013609.

Programs

  • Mathematica
    T[n_,k_]:=Binomial[k-1,n-1]*2^n; Table[T[n,k],{k,10},{n,k}]//Flatten
  • Python
    from math import comb
    def A370469_T(n,k): return comb(k-1,n-1)<Chai Wah Wu, Apr 25 2024

Formula

T(n,k) = binomial(k-1,n-1)*2^n.
G.f.: 2*x*y/(1 - y - 2*x*y). - Stefano Spezia, Apr 27 2024
Showing 1-5 of 5 results.