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

A081580 Pascal-(1,5,1) array.

Original entry on oeis.org

1, 1, 1, 1, 7, 1, 1, 13, 13, 1, 1, 19, 61, 19, 1, 1, 25, 145, 145, 25, 1, 1, 31, 265, 595, 265, 31, 1, 1, 37, 421, 1585, 1585, 421, 37, 1, 1, 43, 613, 3331, 6145, 3331, 613, 43, 1, 1, 49, 841, 6049, 17401, 17401, 6049, 841, 49, 1, 1, 55, 1105, 9955, 40105, 65527, 40105, 9955, 1105, 55, 1
Offset: 0

Views

Author

Paul Barry, Mar 23 2003

Keywords

Comments

One of a family of Pascal-like arrays. A007318 is equivalent to the (1,0,1)-array. A008288 is equivalent to the (1,1,1)-array. Rows include A016921, A081589, A081590. Coefficients of the row polynomials in the Newton basis are given by A013613.

Examples

			Square array begins as:
  1,  1,   1,    1,    1, ... A000012;
  1,  7,  13,   19,   25, ... A016921;
  1, 13,  61,  145,  265, ... A081589;
  1, 19, 145,  595, 1585, ... A081590;
  1, 25, 265, 1585, 6145, ...
The triangle begins as:
  1;
  1,  1;
  1,  7,    1;
  1, 13,   13,    1;
  1, 19,   61,   19,     1;
  1, 25,  145,  145,    25,     1;
  1, 31,  265,  595,   265,    31,     1;
  1, 37,  421, 1585,  1585,   421,    37,    1;
  1, 43,  613, 3331,  6145,  3331,   613,   43,    1;
  1, 49,  841, 6049, 17401, 17401,  6049,  841,   49,  1;
  1, 55, 1105, 9955, 40105, 65527, 40105, 9955, 1105, 55, 1; - _Philippe Deléham_, Mar 15 2014
		

Crossrefs

Cf. Pascal (1,m,1) array: A123562 (m = -3), A098593 (m = -2), A000012 (m = -1), A007318 (m = 0), A008288 (m = 1), A081577 (m = 2), A081578 (m = 3), A081579 (m = 4), A081581 (m = 6), A081582 (m = 7), A143683 (m = 8).

Programs

  • Magma
    A081580:= func< n,k,q | (&+[Binomial(k, j)*Binomial(n-j, k)*q^j: j in [0..n-k]]) >;
    [A081580(n,k,5): k in [0..n], n in [0..12]]; // G. C. Greubel, May 26 2021
    
  • Mathematica
    Table[Hypergeometric2F1[-k, k-n, 1, 6], {n,0,10}, {k,0,n}]//Flatten (* Jean-François Alcover, May 24 2013 *)
  • Sage
    flatten([[hypergeometric([-k, k-n], [1], 6).simplify() for k in (0..n)] for n in (0..12)]) # G. C. Greubel, May 26 2021

Formula

Square array T(n, k) defined by T(n, 0) = T(0, k) = 1, T(n, k) = T(n, k-1) + 5*T(n-1, k-1) + T(n-1, k).
Rows are the expansions of (1+5*x)^k/(1-x)^(k+1).
From Paul Barry, Aug 28 2008: (Start)
Number triangle T(n,k) = Sum_{j=0..n-k} binomial(n-k,j)*binomial(k,j)*5^j.
Riordan array (1/(1-x), x*(1+5*x)/(1-x)). (End)
T(n, k) = Hypergeometric2F1([-k, k-n], [1], 6). - Jean-François Alcover, May 24 2013
E.g.f. for the n-th subdiagonal, n = 0,1,2,..., equals exp(x)*P(n,x), where P(n,x) is the polynomial Sum_{k = 0..n} binomial(n,k)*(6*x)^k/k!. For example, the e.g.f. for the second subdiagonal is exp(x)*(1 + 12*x + 36*x^2/2) = 1 + 13*x + 61*x^2/2! + 145*x^3/3! + 265*x^4/4! + 421*x^5/5! + .... - Peter Bala, Mar 05 2017
Sum_{k=0..n} T(n, k, 3) = A002532(n+1). - G. C. Greubel, May 26 2021

A214230 Sum of the eight nearest neighbors of n in a right triangular type-1 spiral with positive integers.

Original entry on oeis.org

53, 88, 78, 125, 85, 84, 125, 97, 108, 143, 223, 168, 158, 169, 201, 284, 208, 183, 179, 187, 210, 281, 226, 219, 227, 235, 261, 314, 430, 339, 311, 310, 318, 326, 346, 396, 515, 403, 360, 347, 355, 363, 371, 379, 411, 509, 427, 411, 419, 427, 435, 443, 451, 486, 557
Offset: 1

Views

Author

Alex Ratushnyak, Jul 08 2012

Keywords

Comments

Right triangular type-1 spiral implements the sequence Up, Right-down, Left.
Right triangular type-2 spiral (A214251): Left, Up, Right-down.
Right triangular type-3 spiral (A214252): Right-down, Left, Up.
A140064 -- rightwards from 1: 3,14,34...
A064225 -- leftwards from 1: 8,24,49...
A117625 -- upwards from 1: 2,12,31...
A006137 -- downwards from 1: 6,20,43...
A038764 -- left-down from 1: 7,22,46...
A081267 -- left-up from 1: 9,26,52...
A081589 -- right-up from 1: 13, 61, 145...
9*x^2/2 - 19*x/2 + 6 -- right-down from 1: 5,18,40...

Examples

			Right triangular spiral begins:
56
55  57
54  29  58
53  28  30  59
52  27  11  31  60
51  26  10  12  32  61
50  25   9   2  13  33  62
49  24   8   1   3  14  34  63
48  23   7   6   5   4  15  35  64
47  22  21  20  19  18  17  16  36  65
46  45  44  43  42  41  40  39  38  37  66
78  77  76  75  74  73  72  71  70  69  68  67
The eight nearest neighbors of 3 are 1, 2, 13, 33, 14, 4, 5, 6. Their sum is a(3)=78.
		

Crossrefs

Programs

  • Python
    SIZE=29  # must be odd
    grid = [0] * (SIZE*SIZE)
    saveX = [0]* (SIZE*SIZE)
    saveY = [0]* (SIZE*SIZE)
    saveX[1] = saveY[1] = posX = posY = SIZE//2
    grid[posY*SIZE+posX]=1
    n = 2
    def walk(stepX,stepY,chkX,chkY):
      global posX, posY, n
      while 1:
        posX+=stepX
        posY+=stepY
        grid[posY*SIZE+posX]=n
        saveX[n]=posX
        saveY[n]=posY
        n+=1
        if posY==0 or grid[(posY+chkY)*SIZE+posX+chkX]==0:
            return
    while 1:
        walk(0, -1,  1,  1)    # up
        if posY==0:
            break
        walk( 1, 1, -1,  0)    # right-down
        walk(-1, 0,  0, -1)    # left
    for n in range(1,92):
        posX = saveX[n]
        posY = saveY[n]
        k = grid[(posY-1)*SIZE+posX] + grid[(posY+1)*SIZE+posX]
        k+= grid[(posY-1)*SIZE+posX-1] + grid[(posY-1)*SIZE+posX+1]
        k+= grid[(posY+1)*SIZE+posX-1] + grid[(posY+1)*SIZE+posX+1]
        k+= grid[posY*SIZE+posX-1] + grid[posY*SIZE+posX+1]
        print(k, end=', ')

A081272 Downward vertical of triangular spiral in A051682.

Original entry on oeis.org

1, 25, 85, 181, 313, 481, 685, 925, 1201, 1513, 1861, 2245, 2665, 3121, 3613, 4141, 4705, 5305, 5941, 6613, 7321, 8065, 8845, 9661, 10513, 11401, 12325, 13285, 14281, 15313, 16381, 17485, 18625, 19801, 21013, 22261, 23545, 24865, 26221, 27613, 29041, 30505
Offset: 0

Views

Author

Paul Barry, Mar 15 2003

Keywords

Comments

Reflection of A081271 in the horizontal A051682.
Binomial transform of (1, 24, 36, 0, 0, 0, .....).
One of the six verticals of a triangular spiral which starts with 1 (see the link). Other verticals are A060544, A081589, A080855, A157889, A038764. - Yuriy Sibirmovsky, Sep 18 2016.

Crossrefs

Programs

  • Mathematica
    Table[n^2 + (n + 1)^2, {n, 0, 300, 3}] (* or *) LinearRecurrence[{3, -3, 1}, {1, 25, 85}, 80] (* Vladimir Joseph Stephan Orlovsky, Feb 17 2012 *)
    Table[n^2 + (n + 1)^2, {n, 0, 150, 3}] (* Vincenzo Librandi, Aug 07 2013 *)
  • PARI
    x='x+O('x^99); Vec((1+22*x+13*x^2)/(1-x)^3) \\ Altug Alkan, Sep 18 2016

Formula

a(n) = C(n, 0) + 24*C(n, 1) + 36*C(n, 2).
a(n) = 18*n^2 + 6*n + 1.
G.f.: (1 + 22*x + 13*x^2)/(1 - x)^3.
E.g.f.: exp(x)*(1 + 24*x + 18*x^2). - Stefano Spezia, Mar 07 2023

A081590 Fourth row of Pascal-(1,5,1) array A081580.

Original entry on oeis.org

1, 19, 145, 595, 1585, 3331, 6049, 9955, 15265, 22195, 30961, 41779, 54865, 70435, 88705, 109891, 134209, 161875, 193105, 228115, 267121, 310339, 357985, 410275, 467425, 529651, 597169, 670195, 748945, 833635, 924481, 1021699, 1125505, 1236115, 1353745, 1478611
Offset: 0

Views

Author

Paul Barry, Mar 23 2003

Keywords

Crossrefs

Programs

  • Magma
    [1+36*n-54*n^2+36*n^3: n in [0..40]]; // Vincenzo Librandi, Sep 07 2011
  • Mathematica
    Table[36n^3-54n^2+36n+1,{n,0,50}] (* or *) LinearRecurrence[{4,-6,4,-1},{1,19,145,595},50] (* Harvey P. Dale, Sep 07 2011 *)

Formula

a(n) = 1 + 36*n - 54*n^2 + 36*n^3.
G.f.: (1+5*x)^3/(1-x)^4.
a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4); a(0)=1, a(1)=19, a(2)=145, a(3)=595. - Harvey P. Dale, Sep 07 2011
E.g.f.: exp(x)*(1 + 18*x + 54*x^2 + 36*x^3). - Elmo R. Oliveira, Jun 06 2025

A361682 Array read by descending antidiagonals. A(n, k) is the number of multiset combinations of {0, 1} whose type is defined in the comments. Also A(n, k) = hypergeom([-k, -2], [1], n).

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 6, 5, 1, 1, 10, 13, 7, 1, 1, 15, 25, 22, 9, 1, 1, 21, 41, 46, 33, 11, 1, 1, 28, 61, 79, 73, 46, 13, 1, 1, 36, 85, 121, 129, 106, 61, 15, 1, 1, 45, 113, 172, 201, 191, 145, 78, 17, 1, 1, 55, 145, 232, 289, 301, 265, 190, 97, 19, 1
Offset: 0

Views

Author

Peter Luschny, Mar 21 2023

Keywords

Comments

A combination of a multiset M is an unordered selection of k objects of M, where every object can appear at most as many times as it appears in M.
A(n, k) = Cardinality(Union_{j=0..k} Combination(MultiSet(1^[j*n], 0^[(k-j)*n]))), where MultiSet(r^[s], u^[v]) denotes a set that contains the element r with multiplicity s and the element u with multiplicity v; thus the multisets under consideration have n*k elements. Since the base set is {1, 0} the elements can be represented as binary strings. Applying the combination operator to the multisets results in a set of binary strings where '0' resp. '1' can appear at most j*n resp. (k-j)*n times. 'At most' means that they do not have to appear; in other words, the resulting set always includes the empty string ''.
In contrast to the procedure in A361045 we consider here the cardinality of the set union and not the sum of the individual cardinalities. If you want to exclude the empty string, you will find the sequences listed in A361521. The same construction with multiset permutations instead of multiset combinations results in A361043.
A different view can be taken if one considers the hypergeometric representation, hypergeom([-k, -m], [1], n). This is a family of arrays that includes the 'rascal' triangle: the all 1's array A000012 (m = 0), the rascal array A077028 (m = 1), this array (m = 2), and A361731 (m = 3).

Examples

			Array A(n, k) starts:
   [0] 1,  1,   1,    1,   1,   1,   1,    1, ...  A000012
   [1] 1,  3,   6,   10,  15,  21,  28,   36, ...  A000217
   [2] 1,  5,  13,   25,  41,  61,  85,  113, ...  A001844
   [3] 1,  7,  22,   46,  79, 121, 172,  232, ...  A038764
   [4] 1,  9,  33,   73, 129, 201, 289,  393, ...  A081585
   [5] 1, 11,  46,  106, 191, 301, 436,  596, ...  A081587
   [6] 1, 13,  61,  145, 265, 421, 613,  841, ...  A081589
   [7] 1, 15,  78,  190, 351, 561, 820, 1128, ...  A081591
   000012  | A028872 | A239325 |
       A005408    A100536   A069133
.
Triangle T(n, k) starts:
   [0] 1;
   [1] 1,  1;
   [2] 1,  3,   1;
   [3] 1,  6,   5,   1;
   [4] 1, 10,  13,   7,   1;
   [5] 1, 15,  25,  22,   9,   1;
   [6] 1, 21,  41,  46,  33,  11,   1;
   [7] 1, 28,  61,  79,  73,  46,  13,  1;
   [8] 1, 36,  85, 121, 129, 106,  61, 15,  1;
   [9] 1, 45, 113, 172, 201, 191, 145, 78, 17, 1.
.
Row 4 of the triangle:
A(0, 4) =  1 = card('').
A(1, 3) = 10 = card('', 0, 00, 000, 1, 10, 100, 11, 110, 111).
A(2, 2) = 13 = card('', 0, 00, 000, 0000, 1, 10, 100, 11, 110, 1100, 111, 1111).
A(3, 1) =  7 = card('', 0, 00, 000, 1, 11, 111).
A(4, 0) =  1 = card('').
		

Crossrefs

Cf. A239592 (main diagonal), A239331 (transposed array).

Programs

  • Maple
    A := (n, k) -> 1 + n*k*(4 + n*(k - 1))/2:
    for n from 0 to 7 do seq(A(n, k), k = 0..7) od;
    # Alternative:
    ogf := n -> (1 + (n - 1)*x)^2 / (1 - x)^3:
    ser := n -> series(ogf(n), x, 12):
    row := n -> seq(coeff(ser(n), x, k), k = 0..9):
    seq(print(row(n)), n = 0..7);
  • SageMath
    def A(m: int, steps: int) -> int:
        if m == 0: return 1
        size = m * steps
        cset = set()
        for a in range(0, size + 1, m):
            S = [str(int(i < a)) for i in range(size)]
            C = Combinations(S)
            cset.update("".join(i for i in c) for c in C)
        return len(cset)
    def ARow(n: int, size: int) -> list[int]:
        return [A(n, k) for k in range(size + 1)]
    for n in range(8): print(ARow(n, 7))

Formula

A(n, k) = 1 + n*k*(4 + n*(k - 1))/2.
T(n, k) = 1 + k*(n - k)*(4 + k*(n - k - 1))/2.
A(n, k) = [x^k] (1 + (n - 1)*x)^2 / (1 - x)^3.
A(n, k) = hypergeom([-k, -2], [1], n).
A(n, k) = A361521(n, k) + 1.

A155185 Primes in A155175.

Original entry on oeis.org

5, 13, 113, 1741, 5101, 8581, 9941, 21841, 26681, 47741, 82013, 481181, 501001, 1009621, 2356621, 2542513, 3279361, 3723721, 4277813, 7757861, 8124481, 13204661, 25311613, 30772013, 44170601, 48619661, 51521401, 52541501, 54236113, 60731221, 72902813
Offset: 1

Views

Author

Keywords

Comments

Hypotenuse C (prime numbers only) of primitive Pythagorean triangles such that perimeters are Averages of twin prime pairs, q=p+1, a=q^2-p^2, c=q^2+p^2, b=2*p*q, ar=a*b/2; s=a+b+c, s-+1 are primes. p=1,q=2,a=3,b=4,c=5=prime,s=12-+1primes, ...

Crossrefs

Programs

  • Mathematica
    lst={};Do[p=n;q=p+1;a=q^2-p^2;c=q^2+p^2;b=2*p*q;ar=a*b/2;s=a+b+c;If[PrimeQ[s-1]&&PrimeQ[s+1],If[PrimeQ[c],AppendTo[lst,c]]],{n,8!}];lst (* corrected by Ray Chandler, Feb 11 2020 *)

Extensions

Sequence corrected by Ray Chandler, Feb 11 2020

A239331 Square array, read by antidiagonals: column k has g.f. (1+(k-1)*x)^2/(1-x)^3.

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 5, 6, 1, 1, 7, 13, 10, 1, 1, 9, 22, 25, 15, 1, 1, 11, 33, 46, 41, 21, 1, 1, 13, 46, 73, 79, 61, 28, 1, 1, 15, 61, 106, 129, 121, 85, 36, 1, 1, 17, 78, 145, 191, 201, 172, 113, 45, 1, 1, 19, 97, 190, 265, 301, 289, 232, 145, 55, 1, 1, 21
Offset: 0

Views

Author

Philippe Deléham, Mar 16 2014

Keywords

Examples

			Square array begins:
n\k : 0......1......2......3......4......5......6......7......8......9
======================================================================
.0||  1......1......1......1......1......1......1......1......1......1
.1||  1......3......5......7......9.....11.....13.....15.....17.....19
.2||  1......6.....13.....22.....33.....46.....61.....78.....97....118
.3||  1.....10.....25.....46.....73....106....145....190....241....298
.4||  1.....15.....41.....79....129....191....265....351....449....559
.5||  1.....21.....61....121....201....301....421....561....721....901
.6||  1.....28.....85....172....289....436....613....820...1057...1324
.7||  1.....36....113....232....393....596....841...1128...1457...1828
.8||  1.....45....145....301....513....781...1105...1485...1921...2413
.9||  1.....55....181....379....649....991...1405...1891...2449...3079
10||  1.....66....221....466....801...1226...1741...2346...3041...3826
11||  1.....78....265....562....969...1486...2113...2850...3697...4654
		

Crossrefs

Formula

T(n,k) = 3*T(n-1,k) - 3*T(n-2,k) + T(n-3,k).
T(n,k) = 3*T(n,k-1) - 3*T(n,k-2) + T(n,k-3).
T(n,k) = (T(n,k-1) + T(n,k+1))/2 - A161680(n).
T(n,k) = (T(n-1,k) + T(n+1,k) - A000290(n))/2.

A155186 Primes in A155171.

Original entry on oeis.org

2, 7, 29, 101, 107, 197, 227, 457, 647, 829, 1549, 1627, 2221, 2309, 2347, 2521, 2677, 2801, 3181, 3299, 3529, 3541, 3557, 3739, 3769, 4231, 4549, 4871, 4987, 5651, 5827, 5881, 6037, 6079, 6637, 6827, 7517, 7639, 7937, 9787, 11621, 12041, 12329, 13009
Offset: 1

Views

Author

Keywords

Comments

Numbers p (prime numbers only) of primitive Pythagorean triangles such that perimeters are Averages of twin prime pairs, q=p+1, a=q^2-p^2, c=q^2+p^2, b=2*p*q, s=a+b+c, s-+1 are primes.

Crossrefs

Programs

  • Mathematica
    lst={};Do[p=n;q=p+1;a=q^2-p^2;c=q^2+p^2;b=2*p*q;ar=a*b/2;s=a+b+c;If[PrimeQ[s-1]&&PrimeQ[s+1],If[PrimeQ[p],AppendTo[lst,p]]],{n,8!}];lst

A155187 Prime numbers q of primitive Pythagorean triangles such that perimeters are averages of twin prime pairs, p+1=q(prime), a=q^2-p^2, c=q^2+p^2, b=2*p*q, ar=a*b/2; s=a+b+c, s-+1 are primes.

Original entry on oeis.org

2, 3, 11, 71, 227, 491, 683, 1103, 1187, 2591, 3923, 4271, 4931, 6737, 7193, 7703, 8093, 8753, 8963, 9173, 9377, 10271, 13043, 13451, 13997, 15233, 15443, 15803, 15887, 17957, 18701, 19961, 20681, 21701, 22031, 22073, 24371, 24473, 24683
Offset: 1

Views

Author

Keywords

Comments

p=1, q=2(prime), a=3, b=4, c=5, s=12-+1 primes, ...

Crossrefs

Programs

  • Mathematica
    lst={};Do[p=n;q=p+1;a=q^2-p^2;c=q^2+p^2;b=2*p*q;ar=a*b/2;s=a+b+c;If[PrimeQ[s-1]&&PrimeQ[s+1],If[PrimeQ[q],AppendTo[lst,q]]],{n,8!}];lst
Showing 1-9 of 9 results.