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 11-20 of 38 results. Next

A075117 Table by antidiagonals of generalized Lucas numbers: T(n,k) = T(n,k-1) + n*T(n,k-2) with T(n,0)=2 and T(n,1)=1.

Original entry on oeis.org

2, 1, 2, 1, 1, 2, 1, 3, 1, 2, 1, 4, 5, 1, 2, 1, 7, 7, 7, 1, 2, 1, 11, 17, 10, 9, 1, 2, 1, 18, 31, 31, 13, 11, 1, 2, 1, 29, 65, 61, 49, 16, 13, 1, 2, 1, 47, 127, 154, 101, 71, 19, 15, 1, 2, 1, 76, 257, 337, 297, 151, 97, 22, 17, 1, 2, 1, 123, 511, 799, 701, 506, 211, 127, 25, 19, 1, 2
Offset: 0

Views

Author

Henry Bottomley, Sep 02 2002

Keywords

Examples

			Array starts as:
  2, 1,  1,  1,  1,   1, ...;
  2, 1,  3,  4,  7,  11, ...;
  2, 1,  5,  7, 17,  31, ...;
  2, 1,  7, 10, 31,  61, ...;
  2, 1,  9, 13, 49, 101, ...;
  2, 1, 11, 16, 71, 151, ...; etc.
		

Crossrefs

Cf. A060959.
Columns include: A007395, A000012, A005408, A016777, A056220, A062786.

Programs

  • Magma
    [2^(1+k-n)*(&+[Binomial(n-k,2*j)*(1+4*k)^j: j in [0..Floor((n-k)/2)]]): k in [0..n], n in [0..13]]; // G. C. Greubel, Jan 27 2020
    
  • Maple
    seq(seq( 2^(1+k-n)*add( binomial(n-k, 2*j)*(1+4*k)^j, j=0..floor((n-k)/2)), k=0..n), n=0..13); # G. C. Greubel, Jan 27 2020
  • Mathematica
    T[n_, k_]:= ((1 + Sqrt[1+4n])/2)^k + ((1 - Sqrt[1+4n])/2)^k; Table[If[n==0 && k==0, 2, T[k, n-k]]//Simplify, {n,0,13}, {k,0,n}]//Flatten (* G. C. Greubel, Jan 27 2020 *)
  • Sage
    def T(n, k): return 2^(1-k)*sum( binomial(k, 2*j)*(1+4*n)^j for j in (0..floor(k/2)) )
    [[T(k,n-k) for k in (0..n)] for n in (0..13)] # G. C. Greubel, Jan 27 2020

Formula

T(n, k) = ((1+sqrt(4*n+1))/2)^k + ((1-sqrt(4*n+1))/2)^k = 2*A060959(n, k+1) - A060959(n, k).
T(n, k) = 2^(1-k)*Sum_{j=0..floor(k/2)} binomial(k, 2*j)*(1+4*n)^j. - G. C. Greubel, Jan 27 2020

A182579 Triangle read by rows: T(0,0) = 1, for n>0: T(n,n) = 2 and for k<=floor(n/2): T(n,2*k) = n/(n-k) * binomial(n-k,k), T(n,2*k+1) = (n-1)/(n-1-k) * binomial(n-1-k,k).

Original entry on oeis.org

1, 1, 2, 1, 1, 2, 1, 1, 3, 2, 1, 1, 4, 3, 2, 1, 1, 5, 4, 5, 2, 1, 1, 6, 5, 9, 5, 2, 1, 1, 7, 6, 14, 9, 7, 2, 1, 1, 8, 7, 20, 14, 16, 7, 2, 1, 1, 9, 8, 27, 20, 30, 16, 9, 2, 1, 1, 10, 9, 35, 27, 50, 30, 25, 9, 2, 1, 1, 11, 10, 44, 35, 77, 50, 55, 25, 11, 2
Offset: 0

Views

Author

Reinhard Zumkeller, May 06 2012

Keywords

Comments

A000204(n+1) = sum of n-th row, Lucas numbers;
A000204(n+3) = alternating row sum of n-th row;
A182584(n) = T(2*n,n), central terms;
A000012(n) = T(n,0), left edge;
A040000(n) = T(n,n), right edge;
A054977(n-1) = T(n,1) for n > 0;
A109613(n-1) = T(n,n-1) for n > 0;
A008794(n) = T(n,n-2) for n > 1.

Examples

			Starting with 2nd row = [1 2] the rows of the triangle are defined recursively without computing explicitely binomial coefficients; demonstrated for row 8, (see also Haskell program):
   (0) 1  1  7  6 14  9  7  2      [A]  row 7 prepended by 0
    1  1  7  6 14  9  7  2 (0)     [B]  row 7, 0 appended
    1  0  1  0  1  0  1  0  1      [C]  1 and 0 alternating
    1  0  7  0 14  0  7  0  0      [D]  = [B] multiplied by [C]
    1  1  8  7 20 14 16  7  2      [E]  = [D] added to [A] = row 8.
The triangle begins:                 | A000204
              1                      |       1
             1  2                    |       3
            1  1  2                  |       4
           1  1  3  2                |       7
          1  1  4  3  2              |      11
         1  1  5  4  5  2            |      18
        1  1  6  5  9  5  2          |      29
       1  1  7  6 14  9  7  2        |      47
      1  1  8  7 20 14 16  7  2      |      76
     1  1  9  8 27 20 30 16  9  2    |     123
    1  1 10  9 35 27 50 30 25  9  2  |     199 .
		

Crossrefs

Programs

  • Haskell
    a182579 n k = a182579_tabl !! n !! k
    a182579_row n = a182579_tabl !! n
    a182579_tabl = [1] : iterate (\row ->
      zipWith (+) ([0] ++ row) (zipWith (*) (row ++ [0]) a059841_list)) [1,2]
  • Mathematica
    T[_, 0] = 1;
    T[n_, n_] /; n > 0 = 2;
    T[_, 1] = 1;
    T[n_, k_] := T[n, k] = Which[
         OddQ[k],  T[n - 1, k - 1],
         EvenQ[k], T[n - 1, k - 1] + T[n - 1, k]];
    Table[T[n, k], {n, 0, 11}, {k, 0, n}] // Flatten (* Jean-François Alcover, Dec 01 2021 *)

Formula

T(n+1,2*k+1) = T(n,2*k), T(n+1,2*k) = T(n,2*k-1) + T(n,2*k).

A199969 a(n) = the greatest non-divisor h of n (1 < h < n), or 0 if no such h exists.

Original entry on oeis.org

0, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75
Offset: 1

Views

Author

Jaroslav Krizek, Nov 26 2011

Keywords

Comments

From Paul Curtz, Feb 09 2015: (Start)
The nonnegative numbers with 0 instead of 1. See A254667(n), which is linked to the Bernoulli numbers A164555(n)/A027642(n), an autosequence of the second kind.
Offset 0 could be chosen.
An autosequence of the second kind is a sequence whose main diagonal is the first upper diagonal multiplied by 2. If the first upper diagonal is
s0, s1, s2, s3, s4, s5, ...,
the sequence is
Ssk(n) = 2*s0, s0, s0 + 2*s1, s0 +3*s1, s0 + 4*s1 + 2*s2, s1 + 5*s1 + 5*s2, etc.
The corresponding coefficients are A034807(n), a companion to A011973(n).
The binomial transform of Ssk(n) is (-1)^n*Ssk(n).
Difference table of a(n):
0, 0, 2, 3, 4, 5, 6, 7, ...
0, 2, 1, 1, 1, 1, 1, ...
2, -1, 0, 0, 0, 0 ...
-3, 1, 0, 0, 0, ...
4, -1, 0, 0, ...
-5, 1, 0, ...
6, -1, ...
7, ...
etc.
a(n) is an autosequence of the second kind. See A054977(n).
The corresponding autosequence of the first kind (a companion) is 0, 0 followed by the nonnegative numbers (A001477(n)). Not in the OEIS.
Ssk(n) = 2*Sfk(n+1) - Sfk(n) where Sfk(n) is the corresponding sequence of the first kind (see A254667(n)).
(End)
Number of binary sequences of length n-1 that contain exactly one 0 and at least one 1. - Enrique Navarrete, May 11 2021

Crossrefs

Cf. A199968 (the smallest non-divisor h of n (1A199970. A001477, A011973, A034807, A054977, A254667.
Cf. A007978.
Essentially the same as A000027, A028310, A087156 etc.

Programs

  • Mathematica
    Join[{0,0},Table[Max[Complement[Range[n],Divisors[n]]],{n,3,70}]] (* or *) Join[{0,0},Range[2,70]] (* Harvey P. Dale, May 31 2014 *)
  • PARI
    if(n>2,n-1,0) \\ Charles R Greathouse IV, Sep 02 2015

Formula

a(n) = n-1 for n >= 3.
E.g.f.: 1-x^2/2+(x-1)*exp(x). - Enrique Navarrete, May 11 2021

A073423 Sums of two powers of zero: triangle read by rows: T(m,n) = 0^n + 0^m, n >= 0, m = 0..n.

Original entry on oeis.org

2, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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
Offset: 0

Views

Author

Jeremy Gardiner, Jul 30 2002

Keywords

Examples

			T(2,1) = 0^2 + 0^0 = 1.
Triangle begins:
  2;
  1, 0;
  1, 0, 0;
  1, 0, 0, 0;
  1, 0, 0, 0, 0;
  1, 0, 0, 0, 0, 0;
  ...
		

Crossrefs

Column k=0 gives A054977.

Programs

  • PARI
    A073423(n) = if(!n,2,ispolygonal(n,3)); \\ Antti Karttunen, Jan 19 2025
  • Python
    from math import isqrt
    def A073423(n): return int((k:=n<<1)==(m:=isqrt(k))*(m+1)) if n else 2 # Chai Wah Wu, Nov 09 2024
    

Formula

a(0) = 2; and for n > 0, a(n) = A010054(n). [As a flat sequence] - Antti Karttunen, Jan 19 2025

A054978 Obtained from sequence of lucky numbers (A000959) by taking iterated absolute value differences of terms and extracting the leading diagonal.

Original entry on oeis.org

1, 2, 2, 0, 0, 0, 2, 2, 2, 0, 0, 0, 2, 0, 2, 0, 0, 2, 0, 0, 2, 2, 0, 2, 0, 0, 2, 2, 2, 0, 0, 2, 2, 2, 0, 2, 2, 0, 2, 2, 0, 2, 0, 0, 2, 2, 2, 2, 0, 0, 2, 2, 0, 2, 2, 0, 2, 0, 2, 0, 2, 2, 2, 2, 0, 2, 0, 2, 2, 2, 0, 0, 0, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 2, 0, 2, 0, 0, 0, 2, 0, 2, 2
Offset: 0

Views

Author

Henry Gould, May 29 2000

Keywords

Comments

The classical Gilbreath-Proth Conjecture is that when iterated absolute differences are formed from the sequence of primes, the leading diagonal is 2,1,1,1,1,1,1,1,1,... (see A036262). This is an analog for the lucky numbers sequence.
This is the Gilbreath transform of the lucky numbers (cf. A362451). It appears that apart from the initial term, all the other terms are 0 or 2 (compare A362460). - N. J. A. Sloane, May 07 2023

References

  • Henry Gould, Gilbreath-Proth type sequence generated from Lucky numbers, unpublished.

Crossrefs

Programs

  • Haskell
    a054978 n = a054978_list !! n
    a054978_list = map head $ iterate
                   (\lds -> map abs $ zipWith (-) (tail lds) lds) a000959_list
    -- Reinhard Zumkeller, Feb 10 2015
  • Mathematica
    nmax = 104; (* index of last term *)
    imax = 400; (* max index of initial lucky array L *)
    L = Table[2 i + 1, {i, 0, imax}];
    For[n = 2, n < Length[L], r = L[[n++]]; L = ReplacePart[L, Table[r*i -> Nothing, {i, 1, Length[L]/r}]]];
    T[n_, n_] := If[n + 1 <= Length[L], L[[n + 1]], Print["imax should be increased"]; 0];
    T[n_, k_] := T[n, k] = Abs[T[n, k + 1] - T[n - 1, k]];
    a[n_] := T[n, 0];
    Table[a[n], {n, 0, nmax}] (* Jean-François Alcover, Sep 22 2021 *)
    A000959[upto_]:=Module[{s=2,a=Range[1,upto,2]},While[sA054978[upto_]:=Module[{d=A000959[upto]},Join[{1},Table[First[d=Abs[Differences[d]]],Length[d]-1]]];
    A054978[1000] (* Uses lucky numbers up to 1000 *) (* Paolo Xausa, May 11 2023 *)

Formula

a(n) = A254967(n,0). - Reinhard Zumkeller, Feb 11 2015

Extensions

More terms from Naohiro Nomoto, Jun 16 2001

A106513 A Pell-Pascal matrix.

Original entry on oeis.org

1, 2, 1, 5, 3, 1, 12, 8, 4, 1, 29, 20, 12, 5, 1, 70, 49, 32, 17, 6, 1, 169, 119, 81, 49, 23, 7, 1, 408, 288, 200, 130, 72, 30, 8, 1, 985, 696, 488, 330, 202, 102, 38, 9, 1, 2378, 1681, 1184, 818, 532, 304, 140, 47, 10, 1, 5741, 4059, 2865, 2002, 1350, 836, 444, 187, 57, 11, 1
Offset: 0

Views

Author

Paul Barry, May 05 2005

Keywords

Comments

This triangle gives the iterated partial sums of the Pell sequence A000129(n+1), n>=0. - Wolfdieter Lang, Oct 05 2014

Examples

			The triangle T(n,k) begins:
n\k    0    1    2    3    4   5   6   7  8  9 10 ...
0:     1
1:     2    1
2:     5    3    1
3:    12    8    4    1
4:    29   20   12    5    1
5:    70   49   32   17    6   1
6:   169  119   81   49   23   7   1
7:   408  288  200  130   72  30   8   1
8:   985  696  488  330  202 102  38   9  1
9:  2378 1681 1184  818  532 304 140  47 10  1
10: 5741 4059 2865 2002 1350 836 444 187 57 11  1
... Reformatted and extended. - _Wolfdieter Lang_, Oct 05 2014
-----------------------------------------------------
Recurrence from the Z-sequence (see the formula above) for T(0,n) in terms of the entries of row n-1. For example, 29 = T(4,0) = 2*12 + 1*8 + (-1)*4 + 1*1 = 29. - _Wolfdieter Lang_, Oct 05 2014
		

Crossrefs

Cf. A000129, A001333, A106514 (row sums), A106515 (antidiagonal sums), A248156.

Programs

  • Magma
    [ (&+[Binomial(n+1, 2*j+k+1)*2^j: j in [0..Floor((n+1)/2)]]) : k in [0..n], n in [0..12]]; // G. C. Greubel, Aug 05 2021
    
  • Mathematica
    T[n_, k_]= Sum[Binomial[n+1, 2*j+k+1]*2^j, {j, 0, Floor[(n+1)/2]}];
    Table[T[n, k], {n,0,12}, {k,0,n}]//Flatten (* G. C. Greubel, Aug 05 2021 *)
  • Sage
    @CachedFunction
    def T(n, k):
        if (k<0 or k>n): return 0
        elif (k==0): return lucas_number1(n+1, 2, -1)
        else: return T(n-1,k-1) + T(n-1,k)
    flatten([[T(n, k) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, Aug 05 2021

Formula

Riordan array (1/(1-2*x-x^2), x/(1-x)).
Number triangle T(n,0) = A000129(n+1), T(n,k) = T(n-1,k-1) + T(n-1,k).
T(n,k) = Sum_{j=0..floor((n+1)/2)} binomial(n+1, 2*j+k+1)*2^j.
Sum_{k=0..n} T(n, k) = A106514(n).
Sum_{k=0..floor(n/2)} T(n-k, k) = A106515(n).
T(n,k) = 3*T(n-1,k) + T(n-1,k-1) - T(n-2,k) - 2*T(n-2,k-1) - T(n-3,k) - T(n-3,k-1), T(0,0)=1, T(1,0)=2, T(1,1)=1, T(n,k)=0 if k<0 or if k>n. - Philippe Deléham, Jan 14 2014
From Wolfdieter Lang, Oct 05 2014: (Start)
O.g.f. for row polynomials R(n,x) = Sum_{k=0..n} T(n,k)*x^k: (1 - z)/((1 - 2*z - z^2)*(1 - (1+x)*z)).
O.g.f. column m: (1/(1 - 2*z - z^2))*(z/(1 - z))^m, m >= 0. (Riordan property).
The alternating row sums are shown in A001333.
A-sequence: [1, 1] (see the three term recurrence given above). Z-sequence has o.g.f. (2 + 3*x)/(1 + x), [2, 1, repeat(-1,1)] (unsigned A054977). See the W. Lang link under A006232 for Riordan A- and Z-sequences.
The inverse Riordan triangle is shown in A248156. (End)

A254667 The nonnegative numbers with 2 instead of 1.

Original entry on oeis.org

0, 2, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62
Offset: 0

Views

Author

Paul Curtz, Feb 04 2015

Keywords

Comments

An autosequence of the first kind is a sequence whose main diagonal in the difference table is A000004 = 0's.
This is the case for a(n).
Difference table of a(n):
0, 2, 2, 3, 4, 5, ...
2, 0, 1, 1, 1, 1, ...
-2, 1, 0, 0, 0, 0, ...
3, -1, 0, 0, 0, 0, ...
-4, 1, 0, 0, 0, 0, ...
5, -1, 0, 0, 0, 0, ...
etc.
The inverse binomial transform of a(n) is (-1)^(n+1)*a(n).
0 followed by A000012(n) is not in the OEIS. See A054977.
What is the meaning of a(n)?
Among many others, A015441 is an autosequence of the first kind.
General form for such autosequence.
Starting from the first upper diagonal s0, s1, s2, s3, s4, ...,
the autosequence is
0, s0, s0, s0 + s1, s0 + 2*s1, s0 + 3*s1 + s2, s0 + 4*s1 + 3*s2, ... .
After 0, the corresponding coefficients are A011973(n).

Examples

			G.f. = 2*x + 2*x^2 + 3*x^3 + 4*x^4 + 5*x^5 + 6*x^6 + 7*x^7 + 8*x^8 + ...
		

Crossrefs

Programs

  • Magma
    m:=25; R:=PowerSeriesRing(Integers(), m); Coefficients(R!((2*x-2*x^2+x^3)/(1-x)^2)); // G. C. Greubel, Aug 03 2018
  • Mathematica
    CoefficientList[Series[(2*x-2*x^2+x^3)/(1-x)^2, {x, 0, 60}], x] (* G. C. Greubel, Aug 03 2018 *)
    a[ n_] := n + Boole[n == 1]; (* Michael Somos, Aug 19 2018 *)
    Join[{0,2},Range[2,70]] (* Harvey P. Dale, Oct 10 2024 *)
  • PARI
    {a(n) = n + (n==1)}; /* Michael Somos, Feb 09 2015 */
    

Formula

a(n) = (A164558(n) + (-1)^(n+1)*A164555(n))/A027642(n).
a(n) = A063524(n) + A001477(n). - David A. Corneth, Aug 03 2018
G.f.: (2*x - 2*x^2 + x^3) / (1 - x)^2. - Michael Somos, Feb 09 2015

A237447 Infinite square array: row 1 is the positive integers 1, 2, 3, ..., and on any subsequent row n, n is moved to the front: n, 1, ..., n-1, n+1, n+2, ...

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Feb 10 2014

Keywords

Comments

Row n is the lexicographically earliest permutation of positive integers beginning with n. This also holds for the reverse colexicographic order, thus A007489(n-1) gives the position of n-th row of this array (which is one-based) in zero-based arrays A195663 & A055089.
The finite n X n square matrices in sequence A237265 converge towards this infinite square array.
Rows can be constructed also simply as follows: The first row is A000027 (natural numbers, also known as positive integers). For the n-th row, n=2, ..., pick n out from the terms of A000027 and move it to the front. This will create a permutation with one cycle of length n, in cycle notation: (1 n n-1 n-2 ... 3 2), which is the inverse of (1 2 ... n-1 n).
There are A000110(n) ways to choose n permutations from the n first rows of this table so that their composition is identity (counting all the different composition orders). This comment is essentially the same as my May 01 2006 comment on A000110, please see there for more information. - Antti Karttunen, Feb 10 2014
Also, for n > 1, the whole symmetric group S_n can be generated with just two rows, row 2, which is transposition (1 2), and row n, which is the inverse of cycle (1 ... n). See Rotman, p. 24, Exercise 2.9 (iii).

Examples

			The top left 9 X 9 corner of this infinite square array:
  1 2 3 4 5 6 7 8 9
  2 1 3 4 5 6 7 8 9
  3 1 2 4 5 6 7 8 9
  4 1 2 3 5 6 7 8 9
  5 1 2 3 4 6 7 8 9
  6 1 2 3 4 5 7 8 9
  7 1 2 3 4 5 6 8 9
  8 1 2 3 4 5 6 7 9
  9 1 2 3 4 5 6 7 8
Note how this is also the 9th finite subsquare of the sequence A237265, which can be picked from its terms A237265(205) .. A237265(285), where 205 = 1+A000330(9-1), the starting offset for that 9th subsquare in A237265.
		

References

  • Joseph J. Rotman, An Introduction to the Theory of Groups, 4th ed., Springer-Verlag, New York, 1995. First chapter, pp. 1-19 [For a general introduction], and from chapter 2, problem 2.9, p. 24.

Crossrefs

Transpose: A237448.
Topmost row and the leftmost column: A000027. Second column: A054977. Central diagonal: A028310 (note the different starting offsets).
Antidiagonal sums: A074148.
This array is the infinite limit of the n X n square matrices in A237265.

Programs

  • Maple
    T:= proc(r,c) if c > r then c elif c=1 then r else c-1 fi end proc:
    seq(seq(T(r,n-r),r=1..n-1),n=1..20); # Robert Israel, May 09 2017
  • Mathematica
    Table[Function[n, If[k == 1, n, k - Boole[k <= n]]][m - k + 1], {m, 15}, {k, m, 1, -1}] // Flatten (* Michael De Vlieger, May 09 2017 *)
  • PARI
    A237447(n,k=0)=if(k, if(k>1, k-(k<=n), n), A237447(A002260(n), A004736(n))) \\ Yields the element [n,k] of the matrix, or the n-th term of the "linearized" sequence if no k is given. - M. F. Hasler, Mar 09 2014
  • Scheme
    (define (A237447 n) (+ (* (A010054 n) (A002024 n)) (* (- 1 (A010054 n)) (- (A004736 n) (if (>= (A002260 n) (A004736 n)) 1 0)))))
    ;; Another variant based on Cano's A237265.
    (define (A237447 n) (let* ((row (A002260 n)) (col (A004736 n)) (sss (max row col)) (sof (+ 1 (A000330 (- sss 1))))) (A237265 (+ sof (* sss (- row 1)) (- col 1)))))
    

Formula

When col > row, T(row,col) = col, when 1 < col <= row, T(row,col) = col-1, and when col=1, T(row,1) = row.
a(n) = A010054(n) * A002024(n) + (1-A010054(n)) * (A004736(n) - [A002260(n) >= A004736(n)]). [This gives the formula for this entry represented as a one-dimensional sequence. Here the expression inside Iverson brackets results 1 only when the row index (A002260) is greater than or equal to the column index (A004736), otherwise zero. A010054 is the characteristic function for the triangular numbers, A000217.]
T(row,col) = A237265((A000330(max(row,col)-1)+1) + (max(row,col)*(row-1)) + (col-1)). [Takes the infinite limit of n X n matrices of A237265.]
G.f. as array: g(x,y) = (1 - 4*x*y + 3*x*y^2 + x^2*y - x*y^3)*x*y/((1-x*y)*(1-x)^2*(1-y)^2). - Robert Israel, May 09 2017

A244422 Quasi-Riordan triangle ((2-z)/(1-z), -z^2/(1-z)). Row reversed monic Chebyshev T-polynomials without vanishing columns.

Original entry on oeis.org

2, 1, 0, 1, -2, 0, 1, -3, 0, 0, 1, -4, 2, 0, 0, 1, -5, 5, 0, 0, 0, 1, -6, 9, -2, 0, 0, 0, 1, -7, 14, -7, 0, 0, 0, 0, 1, -8, 20, -16, 2, 0, 0, 0, 0, 1, -9, 27, -30, 9, 0, 0, 0, 0, 0, 1, -10, 35, -50, 25, -2, 0, 0, 0, 0, 0, 1, -11, 44, -77, 55, -11, 0, 0, 0, 0, 0, 0, 1, -12, 54, -112, 105, -36, 2, 0, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Wolfdieter Lang, Aug 08 2014

Keywords

Comments

This is a signed version of the triangle A061896.
The coefficient table for the monic Chebyshev polynomials of the first kind R(n, x) = 2*T(n, x/2) is given in A127672. For the T-polynomials see A053120. The present table is obtained from the row reversed coefficient table A127672 by deleting all odd numbered columns which have only zeros, and appending in the rows numbered n >= 1 zeros in order to obtain a triangle. This becomes the quasi-Riordan triangle T = ((2-z)/(1-z), -z^2/(1-z)). This means that the o.g.f. of the row polynomials Rrev(n, x) := sqrt(x)^n*R(n, 1/sqrt(x)) = Sum_{k=0..n} T(n, k)*x^k have o.g.f. (2-z)/(1 - z + x*z^2) like for ordinary Riordan triangles. However this is not a Riordan triangle (or lower triangular infinite dimensional matrix) in the usual sense because it is not invertible. Therefore, this lower triangular matrix is not a member of the Riordan group.
The row sums give repeat(2,1,-1,-2,-1) which is A057079(n+1), n >= 0. The alternating row sums give the Lucas numbers A000032.

Examples

			The triangle T(n,k) begins:
  n\k  0   1   2     3    4     5  6   7  8  9 10 11
  0:   2
  1:   1   0
  2:   1  -2   0
  3:   1  -3   0     0
  4:   1  -4   2     0    0
  5:   1  -5   5     0    0     0
  6:   1  -6   9    -2    0     0  0
  7:   1  -7  14    -7    0     0  0   0
  8:   1  -8  20   -16    2     0  0   0  0
  9:   1  -9  27   -30    9     0  0   0  0  0
  10:  1 -10  35   -50   25    -2  0   0  0  0  0
  11:  1 -11  44   -77   55   -11  0   0  0  0  0  0
  ...
Rrev(3, x) = 1 - 3*x = sqrt(x)^3*R(3,1/sqrt(x)) = sqrt(x)^3*(-3/sqrt(x) + 1/sqrt(x)^3 ) = -3*x + 1.
Rrev(4, x) = 1 - 4*x + 2*x^2 = sqrt(x)^4*(2 - 4/sqrt(x)^2 + 1/sqrt(x)^4) = 2*x^2 - 4*x + 1.
Recurrence: T(4,1) = T(3, 1) - T(2, 0) = -3 -1 = -4.
		

Crossrefs

Formula

T(n,k) = [x^k] Rrev(n, x), k=0, 1, ..., n, with the row polynomials Rrev(n, x) = sqrt(x)^n*R(n,1/sqrt(x)), with R(n, x) given in A127672 (monic Chebyshev polynomials of the first kind).
O.g.f. row polynomials Rrev(n,x) = Sum_{k=0..n} T(n,k)*x^k: (2-z)/(1 - z + x*z^2) (quasi-Riordan).
O.g.f. for column number k entries with leading zeros: ((2-x)/(1-x))*(-x^2/(1-x))^k, k > = 0. See A054977, -A000027, A000096, -A005581, A005582, -A005583, A005584.
Recurrence: T(n,k) = T(n-1, k) - T(n-2, k-1), n >= k >= 1, T(n,k) = 0 if n < k, T(0,0) = 2, T(n,0) = 1 if n>=1, (Compare with A061896).
For n >= 1 the entries without trailing zeros are given by T(n,k) = (-1)^k*(n/(n-k))*binomial(n-k,k) where k=0..floor(n/2).

A026490 Length of n-th run of identical symbols in A026465.

Original entry on oeis.org

1, 1, 2, 3, 2, 1, 2, 1, 2, 3, 2, 3, 2, 3, 2, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2, 3, 2, 3, 2, 3, 2, 1, 2, 1, 2, 3, 2, 3, 2, 3, 2, 1, 2, 1, 2, 3, 2, 3, 2, 3, 2, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2, 3, 2, 3, 2, 3, 2, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2, 3
Offset: 1

Views

Author

Keywords

Comments

From Jean-Paul Allouche and Michel Dekking, Sep 08 2019: (Start)
This sequence is a morphic sequence, i.e., the letter to letter image of a fixed point of a morphism. The morphism is defined on a four-letter alphabet:
1 -> 322, 2 -> 1212, 3 -> 323232, 4 -> 412.
The letter-to-letter map is given by 1 -> 1, 2 -> 2, 3 -> 3, 4 -> 1. The fixed point is the fixed point with prefix 4.
How is this obtained? Note that A026465 only has runs of the forms 2, 11 and 222. A026465 itself is the fixed point of the morphism alpha: 1 -> 121, 2 -> 12221.
The images of the runs under alpha are alpha(2) = 12221, alpha(11) = 121121, alpha(222) = 122211222112221. Coding the runs with their lengths this induces a morphism on the coded runs: 1 -> 32, 2 -> 1212, 3 -> 323232.
Here we use the fact that all three alpha-images have 1 as a prefix and as a suffix. This yields the 2 (coding of 11) at the end of the three images 32, 1212, 323232. The letter 4 is then added to deal with the somewhat strange fact that a(1)=1, a(2)=1. Strange, because the word 11 occurs nowhere else in (a(n)).
Actually, one can show in a similar way, using the square of the morphism 1 -> 2, 2 -> 211 instead of the morphism alpha, that (a(n+1)) = 1,2,3,2,1,2,...
is a purely morphic sequence, fixed point of the morphism 1 -> 123, 2 -> 212, 3 -> 1232323.
One sees from this (by projecting 1, 3 -> 1, 2 -> 2) that (a(n)) has the property a(2n+1) = 2 for all n > 1. Also, by removing the 2's, one sees that the sequence of 1's and 3's is the fixed point of the morphism 1 -> 131, 3 -> 13331, which is the sequence A080426.
(End)
Because the absolute difference between any pair of adjacent terms is 1 (excluding the first pair of adjacent terms), the length of n-th runs of this sequence is A054977, that is, 2 followed by an infinite sequence of 1's. - Keith J. Bauer, Feb 10 2024

Crossrefs

Programs

  • Haskell
    import Data.List (group)
    a026490 n = a026490_list !! (n-1)
    a026490_list = map length $ group a026465_list
    -- Reinhard Zumkeller, Jul 15 2014
    
  • Mathematica
    Length /@ Split[Length /@ Split[ThueMorse[Range[0, 200]]]] (* Vladimir Reshetnikov, Apr 27 2016 *)
  • Python
    def A026490(n):
        if n==1: return 1
        if n&1: return 2
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            kmin = kmax >> 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x):
            c, s = x, bin(x)[2:]
            l = len(s)
            for i in range(l&1,l,2):
                c -= int(s[i])+int('0'+s[:i],2)
            return c
        m = n>>1
        return bisection(lambda x:f(x)+m,m,m)-bisection(lambda x:f(x)+m-1,m-1,m-1)-1 # Chai Wah Wu, Jan 29 2025

Formula

a(1)=1, a(2n) = A080426(n) for all n > 0, a(2n+1) = 2 for all n > 1. - Jean-Paul Allouche and Michel Dekking, Sep 08 2019
Previous Showing 11-20 of 38 results. Next