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.

A193739 Mirror of the triangle A193738.

Original entry on oeis.org

1, 1, 1, 2, 2, 1, 3, 3, 2, 1, 4, 4, 3, 2, 1, 5, 5, 4, 3, 2, 1, 6, 6, 5, 4, 3, 2, 1, 7, 7, 6, 5, 4, 3, 2, 1, 8, 8, 7, 6, 5, 4, 3, 2, 1, 9, 9, 8, 7, 6, 5, 4, 3, 2, 1, 10, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 11, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 12, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 13, 13, 12
Offset: 0

Views

Author

Clark Kimberling, Aug 04 2011

Keywords

Comments

This sequence is obtained by reversing the rows of the triangle A193738.
Except for the first term, this sequence gives the integers occurring in the song "One man went to mow".

Examples

			First six rows:
1
1....1
2....2....1
3....3....2....1
4....4....3....2...1
5....5....4....3...2...1
		

Crossrefs

Cf. A193738.

Programs

  • Haskell
    a193738 n k = a193738_tabl !! n !! k
    a193738_row n = a193738_tabl !! n
    a193738_tabl = map reverse a193739_tabl
    -- Reinhard Zumkeller, May 11 2013
  • Mathematica
    z = 12;
    p[0, x_] := 1
    p[n_, x_] := x*p[n - 1, x] + 1; p[n_, 0] := p[n, x] /. x -> 0
    q[n_, x_] := p[n, x]
    t[n_, k_] := Coefficient[p[n, x], x^(n - k)];
    t[n_, n_] := p[n, x] /. x -> 0;
    w[n_, x_] := Sum[t[n, k]*q[n + 1 - k, x], {k, 0, n}]; w[-1, x_] := 1
    g[n_] := CoefficientList[w[n, x], {x}]
    TableForm[Table[Reverse[g[n]], {n, -1, z}]]
    Flatten[Table[Reverse[g[n]], {n, -1, z}]]  (* A193738 *)
    TableForm[Table[g[n], {n, -1, z}]]
    Flatten[Table[g[n], {n, -1, z}]]   (* A193739 *)

Formula

Write w(n,k) for the triangle at A193738. The current triangle is then given by w(n,n-k).

A193740 Triangular array: the fusion of polynomial sequences P and Q given by p(n,x)=q(n,x) in A193738.

Original entry on oeis.org

1, 1, 1, 1, 3, 3, 1, 4, 9, 9, 1, 4, 10, 19, 19, 1, 4, 10, 20, 34, 34, 1, 4, 10, 20, 35, 55, 55, 1, 4, 10, 20, 35, 56, 83, 83, 1, 4, 10, 20, 35, 56, 84, 119, 119, 1, 4, 10, 20, 35, 56, 84, 120, 164, 164, 1, 4, 10, 20, 35, 56, 84, 120, 165, 219, 219, 1, 4, 10, 20, 35, 56
Offset: 0

Views

Author

Clark Kimberling, Aug 04 2011

Keywords

Comments

See A193722 for the definition of fusion of two sequences of polynomials or triangular arrays.

Examples

			First six rows:
1
1....1
1....3....3
1....4....9....9
1....4....10....19...19
1....4....10....20...34...34
		

Crossrefs

Programs

  • Mathematica
    z = 12;
    p[0, x_] := 1
    p[n_, x_] := n + Sum[(k + 1) x^(n - k), {k, 0, n - 1}]
    q[n_, x_] := p[n, x]
    t[n_, k_] := Coefficient[p[n, x], x^(n - k)];
    t[n_, n_] := p[n, x] /. x -> 0;
    w[n_, x_] := Sum[t[n, k]*q[n + 1 - k, x], {k, 0, n}]; w[-1, x_] := 1
    g[n_] := CoefficientList[w[n, x], {x}]
    TableForm[Table[Reverse[g[n]], {n, -1, z}]]
    Flatten[Table[Reverse[g[n]], {n, -1, z}]]  (* A193740 *)
    TableForm[Table[g[n], {n, -1, z}]]
    Flatten[Table[g[n], {n, -1, z}]]   (* A193741 *)

A193722 Triangular array: the fusion of (x+1)^n and (x+2)^n; see Comments for the definition of fusion.

Original entry on oeis.org

1, 1, 2, 1, 5, 6, 1, 8, 21, 18, 1, 11, 45, 81, 54, 1, 14, 78, 216, 297, 162, 1, 17, 120, 450, 945, 1053, 486, 1, 20, 171, 810, 2295, 3888, 3645, 1458, 1, 23, 231, 1323, 4725, 10773, 15309, 12393, 4374, 1, 26, 300, 2016, 8694, 24948, 47628, 58320, 41553, 13122
Offset: 0

Views

Author

Clark Kimberling, Aug 04 2011

Keywords

Comments

Suppose that p = p(n)*x^n + p(n-1)*x^(n-1) + ... + p(1)*x + p(0) is a polynomial and that Q is a sequence of polynomials
...
q(k,x)=t(k,0)*x^k+t(k,1)*x^(k-1)+...+t(k,k-1)*x+t(k,k),
...
for k=0,1,2,... The Q-upstep of p is the polynomial given by
...
U(p) = p(n)*q(n+1,x) + p(n-1)*q(n,x) + ... + p(0)*q(1,x); note that q(0,x) does not appear.
...
Now suppose that P=(p(n,x)) and Q=(q(n,x)) are sequences of polynomials, where n indicates degree. The fusion of P by Q, denoted by P**Q, is introduced here as the sequence W=(w(n,x)) of polynomials defined by w(0,x)=1 and w(n+1,x)=U(p(n,x)).
...
Strictly speaking, ** is an operation on sequences of polynomials. However, if P and Q are regarded as numerical triangles (e.g., coefficients of polynomials), then ** can be regarded as an operation on numerical triangles. In this case, row (n+1) of P**Q, for n >= 0, is given by the matrix product P(n)*QQ(n), where P(n)=(p(n,n)...p(n,n-1)......p(n,1), p(n,0)) and QQ(n) is the (n+1)-by-(n+2) matrix given by
...
q(n+1,0) .. q(n+1,1)........... q(n+1,n) .... q(n+1,n+1)
0 ......... q(n,0)............. q(n,n-1) .... q(n,n)
0 ......... 0.................. q(n-1,n-2) .. q(n-1,n-1)
...
0 ......... 0.................. q(2,1) ...... q(2,2)
0 ......... 0 ................. q(1,0) ...... q(1,1);
here, the polynomial q(k,x) is taken to be
q(k,0)*x^k + q(k,1)x^(k-1) + ... + q(k,k)*x+q(k,k-1); i.e., "q" is used instead of "t".
...
If s=(s(1),s(2),s(3),...) is a sequence, then the infinite square matrix indicated by
s(1)...s(2)...s(3)...s(4)...s(5)...
..0....s(1)...s(2)...s(3)...s(4)...
..0......0....s(1)...s(2)...s(3)...
..0......0.......0...s(1)...s(2)...
is the self-fusion matrix of s; e.g., A202453, A202670.
...
Example: let p(n,x)=(x+1)^n and q(n,x)=(x+2)^n. Then
...
w(0,x) = 1 by definition of W
w(1,x) = U(p(0,x)) = U(1) = p(0,0)*q(1,x) = 1*(x+2) = x+2;
w(2,x) = U(p(1,x)) = U(x+1) = q(2,x) + q(1,x) = x^2+5x+6;
w(3,x) = U(p(2,x)) = U(x^2+2x+1) = q(3,x) + 2q(2,x) + q(1,x) = x^3+8x^2+21x+18;
...
From these first 4 polynomials in the sequence P**Q, we can write the first 4 rows of P**Q when P, Q, and P**Q are regarded as triangles:
1;
1, 2;
1, 5, 6;
1, 8, 21, 18;
...
Generally, if P and Q are the sequences given by p(n,x)=(ax+b)^n and q(n,x)=(cx+d)^n, then P**Q is given by (cx+d)(bcx+a+bd)^n.
...
In the following examples, r(P**Q) is the mirror of P**Q, obtained by reversing the rows of P**Q.
...
..P...........Q.........P**Q.......r(P**Q)
(x+1)^n.....(x+1)^n.....A081277....A118800 (unsigned)
(x+1)^n.....(x+2)^n.....A193722....A193723
(x+2)^n.....(x+1)^n.....A193724....A193725
(x+2)^n.....(x+2)^n.....A193726....A193727
(x+2)^n.....(2x+1)^n....A193728....A193729
(2x+1)^n....(x+1)^n.....A038763....A136158
(2x+1)^n....(2x+1)^n....A193730....A193731
(2x+1)^n,...(x+1)^n.....A193734....A193735
...
Continuing, let u denote the polynomial x^n+x^(n-1)+...+x+1, and let Fibo[n,x] denote the n-th Fibonacci polynomial.
...
P.............Q.........P**Q.......r(P**Q)
Fib[n+1,x]...(x+1)^n....A193736....A193737
u.............u.........A193738....A193739
u**u..........u**u......A193740....A193741
...
Regarding A193722:
col 1 ..... A000012
col 2 ..... A016789
col 3 ..... A081266
w(n,n) .... A025192
w(n,n-1) .. A081038
...
Associated with "upstep" as defined above is "downstep" defined at A193842 in connection with fission.

Examples

			First six rows:
  1;
  1,   2;
  1,   5,   6;
  1,   8,  21,  18;
  1,  11,  45,  81,  54;
  1,  14,  78, 216, 297, 162;
		

Crossrefs

Programs

  • GAP
    Flat(List([0..10], n-> List([0..n], k-> 3^(k-1)*( Binomial(n-1,k) + 2*Binomial(n,k) ) ))); # G. C. Greubel, Feb 18 2020
  • Magma
    [3^(k-1)*( Binomial(n-1,k) + 2*Binomial(n,k) ): k in [0..n], n in [0..10]]; // G. C. Greubel, Feb 18 2020
    
  • Maple
    fusion := proc(p, q, n) local d, k;
    p(n-1,0)*q(n,x)+add(coeff(p(n-1,x),x^k)*q(n-k,x), k=1..n-1);
    [1,seq(coeff(%,x,n-1-k), k=0..n-1)] end:
    p := (n, x) -> (x + 1)^n; q := (n, x) -> (x + 2)^n;
    A193722_row := n -> fusion(p, q, n);
    for n from 0 to 5 do A193722_row(n) od; # Peter Luschny, Jul 24 2014
  • Mathematica
    (* First program *)
    z = 9; a = 1; b = 1; c = 1; d = 2;
    p[n_, x_] := (a*x + b)^n ; q[n_, x_] := (c*x + d)^n
    t[n_, k_] := Coefficient[p[n, x], x^k]; t[n_, 0] := p[n, x] /. x -> 0;
    w[n_, x_] := Sum[t[n, k]*q[n + 1 - k, x], {k, 0, n}]; w[-1, x_] := 1
    g[n_] := CoefficientList[w[n, x], {x}]
    TableForm[Table[Reverse[g[n]], {n, -1, z}]]
    Flatten[Table[Reverse[g[n]], {n, -1, z}]] (* A193722 *)
    TableForm[Table[g[n], {n, -1, z}]]
    Flatten[Table[g[n], {n, -1, z}]] (* A193723 *)
    (* Second program *)
    Table[3^(k-1)*(Binomial[n-1,k] +2*Binomial[n,k]), {n,0,10}, {k,0,n}]//Flatten (* G. C. Greubel, Feb 18 2020 *)
  • PARI
    T(n,k) = 3^(k-1)*(binomial(n-1,k) +2*binomial(n,k)); \\ G. C. Greubel, Feb 18 2020
    
  • Sage
    def fusion(p, q, n):
        F = p(n-1,0)*q(n,x)+add(expand(p(n-1,x)).coefficient(x,k)*q(n-k,x) for k in (1..n-1))
        return [1]+[expand(F).coefficient(x,n-1-k) for k in (0..n-1)]
    A193842_row = lambda k: fusion(lambda n,x: (x+1)^n, lambda n,x: (x+2)^n, k)
    for n in range(7): A193842_row(n) # Peter Luschny, Jul 24 2014
    

Formula

Triangle T(n,k), read by rows, given by [1,0,0,0,0,0,0,0,...] DELTA [2,1,0,0,0,0,0,0,0,0,...] where DELTA is the operator defined in A084938. - Philippe Deléham, Oct 04 2011
T(n,k) = 3*T(n-1,k-1) + T(n-1,k) with T(0,0)=T(1,0)=1 and T(1,1)=2. - Philippe Deléham, Oct 05 2011
T(n, k) = 3^(k-1)*( binomial(n-1,k) + 2*binomial(n,k) ). - G. C. Greubel, Feb 18 2020

A019587 The left budding sequence: number of i such that 0 < i <= n and 0 < {phi*i} <= {phi*n}, where {} denotes the fractional part and phi = A001622.

Original entry on oeis.org

1, 1, 3, 2, 1, 5, 3, 8, 5, 2, 9, 5, 1, 10, 5, 15, 9, 3, 15, 8, 21, 13, 5, 20, 11, 2, 19, 9, 27, 16, 5, 25, 13, 1, 23, 10, 33, 19, 5, 30, 15, 41, 25, 9, 37, 20, 3, 33, 15, 46, 27, 8, 41, 21, 55, 34, 13, 49, 27, 5, 43, 20, 59, 35, 11, 52, 27, 2, 45, 19, 63, 36, 9, 55, 27, 74, 45, 16, 65
Offset: 1

Views

Author

Keywords

Examples

			{r} = 0.61...; {2r} = 0.23...; {3r} = 0.85...; {4r} = 0.47...; so that a(4) = 2.
		

References

  • J. H. Conway, personal communication.

Crossrefs

Programs

  • Haskell
    a019587 n = length $ filter (<= nTau) $
                map (snd . properFraction . (* tau) . fromInteger) [1..n]
       where (_, nTau) = properFraction (tau * fromInteger n)
             tau = (1 + sqrt 5) / 2
    -- Reinhard Zumkeller, Jan 28 2012
  • Maple
    Digits := 100;
    A019587 := proc(n::posint)
        local a,k,phi,kfrac,nfrac ;
        phi := (1+sqrt(5))/2 ;
        a :=0 ;
        nfrac := n*phi-floor(n*phi) ;
        for k from 1 to n do
            kfrac := k*phi-floor(k*phi) ;
            if evalf(kfrac-nfrac)  <= 0 then
                a := a+1 ;
            end if;
        end do:
        a ;
    end proc:
    seq(A019587(n),n=1..100) ; # R. J. Mathar, Aug 13 2021
  • Mathematica
    r = GoldenRatio; p[x_] := FractionalPart[x];
    u[n_, k_] := If[p[k*r] <= p[n*r], 1, 0]
    v[n_, k_] := If[p[k*r] > p[n*r], 1, 0]
    s[n_] := Sum[u[n, k], {k, 1, n}]
    t[n_] := Sum[v[n, k], {k, 1, n}]
    Table[s[n], {n, 1, 100}]  (* A019587 *)
    Table[t[n], {n, 1, 100}]  (* A194733 *)
    (* Clark Kimberling, Sep 02 2011 *)

Formula

a(n) + A194733(n) = n.
The theorem prover Walnut (see link) can compute the following "linear representation" for a(n). Let v = [1,0,0,0,0,0,0,0,0,0,0,0], w = [0,1,1,3,2,1,5,3,8,5,2,9]^T, mu(0) =[[1,0,0,0,0,0,0,0,0,0,0,0], [0,0,1,0,0,0,0,0,0,0,0,0], [0,0,0,1,0,0,0,0,0,0,0,0], [0,0,0,0,0,1,0,0,0,0,0,0], [0,0,0,0,0,0,0,1,0,0,0,0], [0,0,0,0,0,0,0,0,1,0,0,0], [0,0,0,0,0,0,0,0,0,0,1,0], [0,0,0,0,0,0,0,0,0,0,0,1], [0,0,0,0,0,0,0,-1,0,0,2,0], [0,0,-2,0,0,1,0,2,0,0,0,0], [0,0,-1,-1,0,1,0,1,1,0,-1,1], [0,0,-1,0,0,0,0,0,0,0,2,0]], mu(1) = [[0,1,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,1,0,0,0,0,0,0,0], [0,0,0,0,0,0,1,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,1,0,0], [0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,-1,0,0,2,0,0], [0,-2,0,0,1,0,2,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0], [0,-1,0,0,0,0,0,0,0,2,0,0], [0,-4,0,0,2,0,4,0,0,-1,0,0]]. Then a(n) = v.mu(x).w, where x is the Zeckendorf (or Fibonacci) representation of n. This gives an algorithm for a(n) that runs in polynomial time in log n. - Jeffrey Shallit, Aug 09 2025

Extensions

Extended by Ray Chandler, Apr 18 2009

A371763 Triangle read by rows: Trace of the Akiyama-Tanigawa algorithm for powers x^2.

Original entry on oeis.org

0, 1, 1, 5, 6, 4, 13, 18, 15, 9, 29, 42, 39, 28, 16, 61, 90, 87, 68, 45, 25, 125, 186, 183, 148, 105, 66, 36, 253, 378, 375, 308, 225, 150, 91, 49, 509, 762, 759, 628, 465, 318, 203, 120, 64, 1021, 1530, 1527, 1268, 945, 654, 427, 264, 153, 81
Offset: 0

Views

Author

Peter Luschny, Apr 15 2024

Keywords

Comments

The Akiyama-Tanigawa is a sequence-to-sequence transformation AT := A -> B. If A(n) = 1/(n + 1) then B(n) are the Bernoulli numbers. Tracing the algorithm generates a triangle where the right edge is sequence A and the left edge is its transform B.
Here we consider the sequence A(n) = n^2 that is transformed into sequence B(n) = |A344920(n)|. The case A(n) = n^3 is A371764. Sequence [1, 1, 1, ...] generates A023531 and sequence [0, 1, 2, 3, ...] generates A193738.
In their general form, the AT-transforms of the powers are closely related to the poly-Bernoulli numbers A099594 and generate the rows of the array A371761.

Examples

			Triangle starts:
0:                  0
1:               1,   1
2:             5,   6,   4
3:          13,  18,  15,   9
4:        29,  42,  39,  28,  16
5:      61,  90,  87,  68,  45,  25
6:    125, 186, 183, 148, 105,  66, 36
7:  253, 378, 375, 308, 225, 150, 91, 49
		

Crossrefs

Family of triangles: A023531 (n=0), A193738 (n=1), this triangle (n=2), A371764 (n=3).

Programs

  • Julia
    function ATPtriangle(k::Int, len::Int)
        A = Vector{BigInt}(undef, len)
        B = Vector{Vector{BigInt}}(undef, len)
        for n in 0:len-1
            A[n+1] = n^k
            for j = n:-1:1
                A[j] = j * (A[j+1] - A[j])
            end
            B[n+1] = A[1:n+1]
        end
        return B
    end
    for (n, row) in enumerate(ATPtriangle(2, 9))
        println("$(n-1): ", row)
    end
  • Maple
    ATProw := proc(k, n) local m, j, A;
       for m from 0 by 1 to n do
          A[m] := m^k;
          for j from m by -1 to 1 do
             A[j - 1] := j * (A[j] - A[j - 1])
       od od; convert(A, list) end:
    ATPtriangle := (p, len) -> local k;
         ListTools:-Flatten([seq(ATProw(p, k), k = 0..len)]):
    ATPtriangle(2, 9);
  • Mathematica
    T[n,k] := If[n==k, n^2, (k+1)*(2^(n-k)*(k+2)-3)]; Flatten[Table[T[n,k],{n,0,9},{k,0,n}]] (* Detlef Meya, Apr 19 2024 *)
  • Python
    # See function ATPowList in A371761.
    

Formula

T(n, k) = n^2 if n=k, otherwise (k + 1)*(2^(n - k)*(k + 2) - 3). - Detlef Meya, Apr 19 2024
Showing 1-5 of 5 results.