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.

Previous Showing 31-35 of 35 results.

A004741 Concatenation of sequences (1,3,..,2n-1,2n,2n-2,..,2) for n >= 1.

Original entry on oeis.org

1, 2, 1, 3, 4, 2, 1, 3, 5, 6, 4, 2, 1, 3, 5, 7, 8, 6, 4, 2, 1, 3, 5, 7, 9, 10, 8, 6, 4, 2, 1, 3, 5, 7, 9, 11, 12, 10, 8, 6, 4, 2, 1, 3, 5, 7, 9, 11, 13, 14, 12, 10, 8, 6, 4, 2, 1, 3, 5, 7, 9, 11, 13, 15, 16, 14, 12, 10, 8, 6, 4, 2, 1, 3, 5, 7, 9, 11, 13, 15, 17, 18, 16, 14, 12, 10, 8, 6, 4, 2, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19
Offset: 1

Views

Author

R. Muller

Keywords

Comments

Odd numbers increasing from 1 to 2k-1 followed by even numbers decreasing from 2k to 2.
The ordinal transform of a sequence b_0, b_1, b_2, ... is the sequence a_0, a_1, a_2, ... where a_n is the number of times b_n has occurred in {b_0 ... b_n}.
This is a fractal sequence, see Kimberling link.

References

  • F. Smarandache, "Numerical Sequences", University of Craiova, 1975; [Arizona State University, Special Collection, Tempe, AZ, USA].

Programs

  • Haskell
    a004741 n = a004741_list !! (n-1)
    a004741_list = concat $ map (\n -> [1,3..2*n-1] ++ [2*n,2*n-2..2]) [1..]
    -- Reinhard Zumkeller, Mar 26 2011
  • Mathematica
    Flatten[Table[{Range[1,2n-1,2],Range[2n,2,-2]},{n,10}]] (* Harvey P. Dale, Aug 12 2014 *)

Formula

Ordinal transform of A004737. - Franklin T. Adams-Watters, Aug 28 2006

Extensions

Data corrected from 36th term on by Reinhard Zumkeller, Mar 26 2011

A133826 Triangle whose rows are sequences of increasing and decreasing tetrahedral numbers: 1; 1,4,1; 1,4,10,4,1; ... .

Original entry on oeis.org

1, 1, 4, 1, 1, 4, 10, 4, 1, 1, 4, 10, 20, 10, 4, 1, 1, 4, 10, 20, 35, 20, 10, 4, 1, 1, 4, 10, 20, 35, 56, 35, 20, 10, 4, 1, 1, 4, 10, 20, 35, 56, 84, 56, 35, 20, 10, 4, 1, 1, 4, 10, 20, 35, 56, 84, 120, 84, 56, 35, 20, 10, 4, 1, 1, 4, 10, 20, 35, 56, 84, 120, 165, 120, 84, 56, 35, 20, 10, 4, 1
Offset: 0

Views

Author

Peter Bala, Sep 25 2007

Keywords

Comments

Reading the triangle by rows produces the sequence 1,1,4,1,1,4,10,4,1,..., analogous to A004737.
T(n,k) = min(n*(n+1)*(n+2)/6, k*(k+1)*(k+2)/6) n, k > 0. The order of the list T(n,k) is by sides of squares from T(1,n) to T(n,n), then from T(n,n) to T(n,1). - Boris Putievskiy, Jan 13 2013

Examples

			Triangle T(n,k) starts:
  1;
  1,  4,  1;
  1,  4, 10,  4,  1;
  1,  4, 10, 20, 10,  4,  1;
  1,  4, 10, 20, 35, 20, 10,  4,  1;
  1,  4, 10, 20, 35, 56, 35, 20, 10,  4,  1;
  1,  4, 10, 20, 35, 56, 84, 56, 35, 20, 10,  4,  1;
  ...
		

Crossrefs

Cf. A000292, A002415 (row sums), A004737, A124258, A133825.

Programs

  • Maple
    T:= n-> (f-> (f(i)$i=1..n, f(n-i)$i=1..n-1))(t-> t*(t+1)*(t+2)/6):
    seq(T(n), n=1..10);  # Alois P. Heinz, Feb 17 2022
  • Mathematica
    Module[{nn=10,tet},tet=Table[(n(n+1)(n+2))/6,{n,nn}];Table[Join[Take[ tet,k], Reverse[ Take[tet,k-1]]],{k,nn}]]//Flatten (* Harvey P. Dale, Oct 22 2017 *)
    Table[Series[(1-h^(2*N+4))^2/(1-h^2)^4-((2+N)^2 *h^(2N+2))/(1-h^2)^2, {h, 0, 4*N}], {N,0,5}] // Normal (* Sergii Voloshyn, Sep 09 2022 *)

Formula

O.g.f.: (1+q*x)/((1-x)*(1-q*x)^3*(1-q^2x)) = 1 + x*(1 + 4*q + q^2) + x^2*(1 + 4*q + 10*q^2 + 4*q^3 + q^4) + ... .
From Boris Putievskiy, Jan 13 2013: (Start)
a(n) = A004737(n)*(A004737(n)+1)*(A004737(n)+2)/2.
a(n) = z*(z+1)*(z+2)/6, where z = floor(sqrt(n-1)) - |n - floor(sqrt(n-1))^2 - floor(sqrt(n-1)) - 1| + 1. (End)

A347026 Irregular triangle read by rows in which row n lists the first n odd numbers, followed by the first n odd numbers in decreasing order.

Original entry on oeis.org

1, 1, 1, 3, 3, 1, 1, 3, 5, 5, 3, 1, 1, 3, 5, 7, 7, 5, 3, 1, 1, 3, 5, 7, 9, 9, 7, 5, 3, 1, 1, 3, 5, 7, 9, 11, 11, 9, 7, 5, 3, 1, 1, 3, 5, 7, 9, 11, 13, 13, 11, 9, 7, 5, 3, 1, 1, 3, 5, 7, 9, 11, 13, 15, 15, 13, 11, 9, 7, 5, 3, 1, 1, 3, 5, 7, 9, 11, 13, 15, 17, 17, 15, 13, 11, 9, 7, 5, 3, 1
Offset: 1

Views

Author

Eddie Gutierrez, Aug 11 2021

Keywords

Comments

The terms of this sequence are the numbers in an irregular triangle corresponding to the addition of rows when multiplying two large numbers via a novel method (see Links).
Sums of the rising diagonals yield sequence A007980.
When the 2n terms in row n are used as the coefficients of a (2n-1)st-order polynomial in x, dividing that polynomial by x+1 produces a (2n-2)nd-order polynomial whose coefficients are the n-th row of A004737 (if that sequence is taken as an irregular triangle with 2n-1 terms in its n-th row). E.g., for n=3, (x^5 + 3x^4 + 5x^3 + 5x^2 + 3x + 1)/(x+1) = x^4 + 2x^3 + 3x^2 + 2x + 1.

Examples

			Triangle begins:
  1,  1;
  1,  3,  3,  1;
  1,  3,  5,  5,  3,  1;
  1,  3,  5,  7,  7,  5,  3,  1;
  1,  3,  5,  7,  9,  9,  7,  5,  3,  1;
  1,  3,  5,  7,  9, 11, 11,  9,  7,  5,  3,  1;
  1,  3,  5,  7,  9, 11, 13, 13, 11,  9,  7,  5,  3,  1;
  1,  3,  5,  7,  9, 11, 13, 15, 15, 13, 11,  9,  7,  5,  3,  1;
...
		

Crossrefs

Even-indexed rows of A157454.
Antidiagonal sums give A007980.
Row lengths give nonzero terms of A005843.
Cf. A004737.

Programs

  • C
    #include 
    int main()
    {
       int n, k;
       for (n=1; n<=13; n++)
       {
          for (k=1; k<=n; k++)
          {
             printf("%d ", 2*k - 1);
          }
          for (k=n+1; k<=2*n; k++)
          {
             printf("%d ", 4*n - 2*k + 1);
          }
          printf("\n");
       }
       return 0;
    }
    
  • Mathematica
    Array[Join[#, Reverse[#]] &@Range[1, 2 # - 1, 2] &, 9] // Flatten (* Michael De Vlieger, Aug 18 2021 *)
    Flatten[Table[Join[Range[1,2n+1,2],Range[2n+1,1,-2]],{n,0,10}]] (* Harvey P. Dale, Aug 31 2024 *)
  • PARI
    row(n) = n*=2; vector(n, k, min(2*k-1, 2*(n-k)+1)); \\ Michel Marcus, Aug 17 2021

Formula

T(n,k) = 2k - 1 for 1 <= k <= n,
4n - 2k + 1 for n+1 <= k <= 2n.

Extensions

Better definition from Omar E. Pol, Aug 14 2021

A359087 a(n) is equal to the last point of a reverse pyramid summation with base 1, 2, 3, ..., n-2, n-1, n, n-1, n-2, ..., 3, 2, 1.

Original entry on oeis.org

1, 4, 19, 78, 301, 1108, 3951, 13758, 47049, 158616, 528619, 1745098, 5715429, 18593032, 60136183, 193525002, 620046513, 1978886448, 6293809971, 19955385762, 63094947981, 198990438408, 626141673375, 1966085927898, 6161660863929, 19276374528468, 60206635741131
Offset: 1

Views

Author

Moosa Nasir, Dec 15 2022

Keywords

Comments

Each element in the pyramid below the base is equal to the sum of the top left, top, and top right elements.
Each row has 2*n-(1+2*r) elements where r is the row number starting from 0.
The sum of elements in the first row is n^2.
The total number of elements in the pyramid is n^2.

Examples

			For n = 3:
  1  2  3  2  1
     6  7  6
       19
so a(3) = 19.
For n = 4:
  1   2   3   4   3   2   1
      6   9  10   9   6
         25  28  25
             78
so a(4) = 78.
		

Crossrefs

Programs

  • C
    unsigned long tri(int n, int k)
    {
        if (n == 0 && k == 0) return 1;
        if(k < -n || k > n) return 0;
        return tri(n - 1, k - 1) + tri(n - 1, k) + tri(n - 1, k + 1);
    }
    unsigned long a(int n)
    {
        unsigned long sum = 0;
        sum += tri(n - 1,0) * n;
        for (int i = 1; i < n; i++)
        {
            sum += 2 * tri(n - 1,n - i) * i;
        }
        return sum;
    }
  • Maple
    f:= proc(n) local L,i;
      L:= [seq(i,i=1..n),seq(n-i,i=1..n-1)];
      for i from 1 to n-1 do
        L:= L[1..-3] + L[2..-2] + L[3..-1]
      od;
      op(L)
    end proc:
    map(f, [$1..30]); # Robert Israel, Dec 17 2022
  • Mathematica
    f[n_] := Module[{L, i}, L = Range[n]~Join~Table[n-i, {i, 1, n-1}]; For[i = 1, i <= n-1, i++, L = L[[1;;-3]] + L[[2;;-2]] + L[[3;;-1]]]; L[[1]]];
    f /@ Range[30] (* Jean-François Alcover, Jan 25 2023, after Robert Israel *)

Formula

a(n) = Sum_{k=1..2*n-1} A004737(k + (n-1)^2) * A027907(k + (n-1)^2 - 1).
Empirical g.f.: x/(1-3*x)^2 - 2*x^2/((1+x)^(1/2)*(1-3*x)^(3/2)). - Robert Israel, Dec 17 2022
a(n) = n*3^(n-1) - 2*A132894(n-1) (conjectured). - Bernard Schott, Dec 20 2022

A360373 Triangular array T read by rows related to the multiplication table.

Original entry on oeis.org

1, 2, 4, 2, 3, 6, 9, 6, 3, 4, 8, 12, 16, 12, 8, 4, 5, 10, 15, 20, 25, 20, 15, 10, 5, 6, 12, 18, 24, 30, 36, 30, 24, 18, 12, 6, 7, 14, 21, 28, 35, 42, 49, 42, 35, 28, 21, 14, 7, 8, 16, 24, 32, 40, 48, 56, 64, 56, 48, 40, 32, 24, 16, 8, 9, 18, 27, 36, 45, 54, 63, 72, 81
Offset: 1

Views

Author

Philippe Deléham, Feb 04 2023

Keywords

Examples

			Table T(n, k) , n>=1 , 1<=k<=2*n-1.
n = 1 : 1 ;
n = 2 : 2,  4,  2 ;
n = 3 : 3,  6,  9,  6,  3 ;
n = 4 : 4,  8, 12, 16, 12,  8,  4 ;
n = 5 : 5, 10, 15, 20, 25, 20, 15, 10,  5 ;
n = 6 : 6, 12, 18, 24, 30, 36, 30, 24, 18, 12,  6 ;
n = 7 : 7, 14, 21, 28, 35, 42, 49, 42, 35, 28, 21, 14,  7 ;
n = 8 : 8, 16, 24, 32, 40, 48, 56, 64, 56, 48, 40, 32, 24, 16,  8 ;
...
		

Crossrefs

Cf. A000290 (central terms), A000578 (row sums), A060747 (row lengths).

Programs

  • Maple
    T:= (n, k)-> n*min(k, 2*n-k):
    seq(seq(T(n,k), k=1..2*n-1), n=1..10);  # Alois P. Heinz, Feb 04 2023

Formula

T(n, k) = T(n, 2*n-k) = n*k for 1<=k<=n .
Sum_{k=1..2*n-1} T(n, k) = n^3.
Sum_{k=1..2*n-1} T(n, k)^2 = n^3*(2*n^2 + 1)/3 = A272125(n).
T(n, k) = n * A004737(n,k).
Previous Showing 31-35 of 35 results.