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-10 of 53 results. Next

A000533 a(0)=1; a(n) = 10^n + 1, n >= 1.

Original entry on oeis.org

1, 11, 101, 1001, 10001, 100001, 1000001, 10000001, 100000001, 1000000001, 10000000001, 100000000001, 1000000000001, 10000000000001, 100000000000001, 1000000000000001, 10000000000000001
Offset: 0

Views

Author

Keywords

Comments

Also, b^n+1 written in base b, for any base b >= 2.
Also, A083318 written in base 2. - Omar E. Pol, Feb 24 2008, Dec 30 2008
Also, palindromes formed from the reflected decimal expansion of the concatenation of 1 and infinite 0's. - Omar E. Pol, Dec 14 2008
It seems that the sequence gives 'all' positive integers m such that m^4 is a palindrome. Note that a(0)^4 = 1 is a palindrome and for n > 0, a(n)^4 = (10^n + 1)^4 = 10^(4n) + 4*10^(3n) + 6*10^(2n) + 4*10^(n) + 1 is a palindrome. - Farideh Firoozbakht, Oct 28 2014
a(n)^2 starts with a(n)+1 for n >= 1. - Dhilan Lahoti, Aug 31 2015
From Peter Bala, Sep 25 2015: (Start)
The simple continued fraction expansion of sqrt(a(2*n)) = [10^n; 2*10^n, 2*10^n, ...] has period 1.
The simple continued fraction expansion of sqrt(a(6*n))/a(2*n) = [10^n - 1; 1, 10^n - 1, 10^n - 1, 1, 2*(10^n - 1), ...] has period 5.
The simple continued fraction expansion of sqrt(a(10*n))/a(2*n) = [10^(3*n) - 10^n; 10^n, 10^n, 2*(10^(3*n) - 10^n), ...] has period 3.
As n increases, these expansions have large partial quotients.
A theorem of Kuzmin in the measure theory of continued fractions says that large partial quotients are the exception in continued fraction expansions.
Empirically, we also see exceptionally large partial quotients in the continued fraction expansions of the m-th root of the numbers a(m*n), for m >= 3. For example, it appears that the continued fraction expansion of a(3*n)^(1/3) begins [10^n; 3*10^(2*n), 10^n, 4.5*10^(2*n), 0.8*10^n, ( 9*10^(2*n + 2) - 144 + 24*(2^mod(n,3) - 1) )/168, ...]. As n increases, the expansion begins with 6 large partial quotients. An example is given below. Cf. A002283, A066138 and A168624.
(End)
a(1) and a(2) are the only prime terms up to n=100000. - Daniel Arribas, Jun 04 2016
Based on factors from A001271, the first abundant number in this sequence should occur in the first M terms, where M is the double factorial M=7607!!. Is any abundant number known in this sequence? - Sergio Pimentel, Oct 04 2019
The (3^5 * 5^2 * 7^2 * 11^2 * 13^2 * 17 * 19 * 23 * 29 * 31 * 37 * 41 * 43 * 47 * 53 * 59 * 61 * 67 * 71 * 73 * 79 * 83 * 89 * 97 * 101 * 103 * 107 * 109 * 113 * 127 * 131 * 137 * 139 * 157 * 163 * 181 * 191 * 241 * 251 * 263)-th term of this sequence is an abundant number. - Jon E. Schoenfield, Nov 19 2019
The only perfect power (i.e., a perfect square, a perfect cube, and so forth) in the present sequence is a(0) by Mihăilescu's theorem (since 10^n is a perfect power not equal to 2^3 - see the links in A001597). - Marco Ripà, Feb 04 2025

Examples

			The continued fraction expansion of a(9)^(1/3) begins [1000; 3000000, 1000, 4500000, 800, 5357142, 1, 6, 14, 6, 1, 5999999, 6, 1, 12, 7, 1, ...] with 5 large partial quotients immediately following the integer part of the number. - _Peter Bala_, Sep 25 2015
		

Crossrefs

Programs

Formula

a(n) = 10^n + 1 - 0^n. - Reinhard Zumkeller, Jun 10 2003
From Paul Barry, Feb 05 2005: (Start)
G.f.: (1-10*x^2)/((1-x)*(1-10*x));
a(n) = Sum_{k=0..n} binomial(n, k)*0^(k(n-k))*10^k. (End)
a(n) = A178500(n) + 1. - Reinhard Zumkeller, May 28 2010
E.g.f.: exp(x) + exp(10*x) - 1. - Ilya Gutkovskiy, Jun 03 2016

A287804 Number of quinary sequences of length n such that no two consecutive terms have distance 1.

Original entry on oeis.org

1, 5, 17, 59, 205, 713, 2481, 8635, 30057, 104629, 364225, 1267923, 4413861, 15365465, 53490097, 186209299, 648230545, 2256616133, 7855718641, 27347281995, 95201200637, 331413874569, 1153716087665, 4016309864843, 13981555011321, 48672509644725
Offset: 0

Views

Author

David Nacin, Jun 01 2017

Keywords

Examples

			For n=2 the a(2)=17=25-8 sequences contain every combination except these eight: 01,10,12,21,23,32,34,43.
		

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{5, -5, -1}, {1, 5, 17}, 50]
  • Python
    def a(n):
        if n in [0,1,2]:
            return [1,5,17][n]
        return 5*a(n-1)-5*a(n-2)-a(n-3)

Formula

a(n) = 5*a(n-1) - 5a(n-2) - a(n-3), a(0)=1, a(1)=5, a(2)=17.
G.f.: (1 - 3*x^2)/(1 - 5*x + 5*x^2 + x^3).

A287819 Number of nonary sequences of length n such that no two consecutive terms have distance 4.

Original entry on oeis.org

1, 9, 71, 561, 4433, 35031, 276827, 2187585, 17287073, 136608591, 1079529611, 8530826457, 67413620993, 532726379847, 4209793089371, 33267280400913, 262889866978817, 2077449112980255, 16416740845208075, 129730917736941417, 1025179795159015841
Offset: 0

Views

Author

David Nacin, Jun 02 2017

Keywords

Examples

			For n=2 the a(2) = 81 - 10 = 71 sequences contain every combination except these ten: 04,40,15,51,26,62,37,73,48,84.
		

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{8, 1, -14}, {1, 9, 71, 561}, 40]
  • Python
    def a(n):
        if n in [0, 1, 2, 3]:
            return [1, 9, 71, 561][n]
        return 8*a(n-1)+a(n-2)-14*a(n-3)

Formula

For n>2, a(n) = 8*a(n-1) + a(n-2) - 14*a(n-3), a(0)=1, a(1)=9, a(2)=71, a(3)=561.
G.f.: (1 + x - 2 x^2 - 2 x^3)/(1 - 8 x - x^2 + 14 x^3).

A008687 Number of 1's in 2's complement representation of -n.

Original entry on oeis.org

0, 1, 1, 2, 1, 3, 2, 2, 1, 4, 3, 3, 2, 3, 2, 2, 1, 5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 3, 2, 2, 1, 6, 5, 5, 4, 5, 4, 4, 3, 5, 4, 4, 3, 4, 3, 3, 2, 5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 3, 2, 2, 1, 7, 6, 6, 5, 6, 5, 5, 4, 6, 5, 5, 4, 5, 4, 4, 3, 6, 5, 5, 4, 5, 4, 4, 3, 5, 4, 4, 3, 4, 3, 3
Offset: 0

Views

Author

Keywords

Comments

a(A127904(n)) = n and a(m) < n for m < A127904(n). - Reinhard Zumkeller, Feb 05 2007
a(n) = A000120(A010078(n)), n>0; a(n) = A023416(A004754(n-1)), n>1. - Reinhard Zumkeller, Dec 04 2015
Conjecture: a(n)+1 is the length of the Hirzebruch (negative) continued fraction for the Stern-Brocot tree fraction A007305(n)/A007306(n). - Andrey Zabolotskiy, Apr 17 2020
Terms a(n); n >= 2 can be generated recursively, as follows. Let S(0) = {1}, then for k >=1, let S(k) = {S(k-1)+1, S(k-1)}, where +1 means +1 on every term of S(k-1); see Example. Each step of the recursion gives the next 2^k terms of the sequence. - David James Sycamore, Jul 15 2024

Examples

			Using the above recursion for a(n); n >= 2, we have:
 S(0) = {1} so a(2) = 1;
 S(1) = {2,1} so a(3,4) = 2,1;
 S(2) = {3,2,2,1}, so a(5,6,7,8) = 3,2,2,1;
As irregular table the sequence for n >= 2 begins:
  1;
  2,1;
  3,2,2,1;
  4,3,3,2,3,2,2,1;
  5,4,4,3,4,3,3,2,4,3,3,2,3,2,2,1;
  6,5,5,4,5,4,4,3,5,4,3,3,4,3,3,2,5,4,4,3,4,3,3,2,4,3,3,2,3,2,2,1;
and so on (the k-th row contains 2^k terms; k>=0). - _David James Sycamore_, Jul 15 2024
		

Crossrefs

This is Guy Steele's sequence GS(4, 3) (see A135416).

Programs

  • Haskell
    a008687 n = a008687_list !! n
    a008687_list = 0 : 1 : c [1] where c (e:es) = e : c (es ++ [e+1,e])
    -- Reinhard Zumkeller, Mar 07 2011
    
  • Mathematica
    a[0] = 0; a[1] = 1; a[n_] := a[n] = Mod[n,2] + a[Mod[n,2] + Floor[n/2]]; Array[a, 96, 0] (* Jean-François Alcover, Aug 12 2017, after Reinhard Zumkeller *)
  • PARI
    a(n) = if(n<2,n, n--; logint(n,2) - hammingweight(n) + 2); \\ Kevin Ryde, Apr 14 2021

Formula

a(n) = A023416(n-1) + 1.
a(n) = if n<=1 then n else (n mod 2) + a((n mod 2) + floor(n/2)). - Reinhard Zumkeller, Feb 05 2007
a(n) = if n<2 then n else a(ceiling(n/2)) + n mod 2. - Reinhard Zumkeller, Jul 25 2006
Min{m: a(m)=n} = if n>0 then A083318(n-1) else 0. - Reinhard Zumkeller, Jul 25 2006

A287825 Number of sequences over the alphabet {0,1,...,9} such that no two consecutive terms have distance 1.

Original entry on oeis.org

1, 10, 82, 674, 5540, 45538, 374316, 3076828, 25291120, 207889674, 1708825732, 14046322404, 115458919774, 949057110644, 7801124426174, 64124215108032, 527092600834054, 4332631742719370, 35613662169258228, 292739611493034596, 2406281042646218328
Offset: 0

Views

Author

David Nacin, Jun 02 2017

Keywords

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{9, -4, -21, 9, 5}, {1, 10, 82, 674, 5540, 45538}, 40]
  • Python
    def a(n):
        if n in [0, 1, 2, 3, 4, 5]:
            return [1, 10, 82, 674, 5540, 45538][n]
        return 9*a(n-1) - 4*a(n-2) - 21*a(n-3) + 9*a(n-4) + 5*a(n-5)

Formula

For n>5, a(n) = 9*a(n-1) - 4*a(n-2) - 21*a(n-3) + 9*a(n-4) + 5*a(n-5), a(0)=1, a(1)=10, a(2)=82, a(3)=674, a(4)=5540, a(5)=45538.
G.f.: (-1 - x + 4*x^2 + 3*x^3 - 3*x^4 - x^5)/(-1 + 9*x - 4*x^2 - 21*x^3 + 9*x^4 + 5*x^5).

A050430 Length of longest palindromic subword of (n base 2).

Original entry on oeis.org

1, 1, 2, 2, 3, 2, 3, 3, 4, 3, 3, 2, 3, 3, 4, 4, 5, 4, 4, 3, 5, 4, 3, 3, 4, 3, 5, 3, 3, 4, 5, 5, 6, 5, 5, 5, 4, 4, 4, 3, 4, 5, 5, 4, 6, 5, 4, 4, 5, 4, 6, 3, 5, 5, 5, 3, 4, 3, 5, 4, 4, 5, 6, 6, 7, 6, 6, 5, 5, 5, 5, 5, 7, 5, 4, 6, 4, 5, 4, 4, 5, 6, 4, 5, 7, 5, 5, 4, 4, 6, 6, 5, 7, 6, 5, 5, 6, 5, 7, 5, 4, 6, 6, 3, 4
Offset: 1

Views

Author

Keywords

Comments

a(A083318(n-1)) = n; a(A193159(k)) = 3, 1 <= k <= 26. [Reinhard Zumkeller, Jul 17 2011]

Examples

			(11 base 2) = 1011, containing the palindrome 101, therefore a(11) = 3.
		

Crossrefs

Cf. A007088; A050431 (base 3), A050432 (base 4), A050433 (base 5).

Programs

  • Haskell
    import Data.Char (intToDigit, digitToInt)
    import Numeric (showIntAtBase)
    a050430 n = a050430_list !! (n-1)
    a050430_list = f 1 where
       f n = g (showIntAtBase 2 intToDigit n "") : f (n+1)
       g zs | zs == reverse zs = length zs
            | otherwise        = max (h $ init zs) (h $ tail zs)
       h zs@('0':_) = g zs
       h zs@('1':_) = a050430 $ foldl (\v d -> digitToInt d + 2*v) 0 zs
    -- Reinhard Zumkeller, Jul 16 2011
  • Maple
    # A050430 Length of longest palindromic factor of n for n in [M1..M2] - from N. J. A. Sloane, Aug 07 2012, revised Aug 11 2012
    isPal := proc(L)
        local d ;
        for d from 1 to nops(L)/2 do
            if op(d, L) <> op(-d, L) then
                return false;
            end if;
        end do:
        return true;
    end proc:
    # start of main program
    ans:=[];
    M1:=0; M2:=64;
    for n from M1 to M2 do
    t1:=convert(n,base,2);
    rec:=0:
    l1:=nops(t1);
    for j1 from 0 to l1-1 do
    for j2 from j1+1 to l1 do
    F1 := [op(j1+1..j2,t1)];
    if (isPal(F1) and j2-j1>rec) then rec:=j2-j1; fi;
    od:
    od:
    ans:=[op(ans),rec]:
    od:
    ans;
  • Mathematica
    f[n_] := Block[{id = IntegerDigits[n, 2]}, k = Length@ id; While[ Union[# == Reverse@# & /@ Partition[id, k, 1]][[-1]] != True, k--]; k]; Array[f, 105] (* Robert G. Wilson v, Jul 16 2011 *)

Formula

a(n) <= min(a(2*n), a(2*n+1)). [Reinhard Zumkeller, Jul 31 2011]

Extensions

Extended by Ray Chandler, Mar 11 2010

A233775 Number of vertices in the n-th row of the Sierpinski gasket (cf. A047999).

Original entry on oeis.org

1, 2, 3, 4, 5, 4, 6, 8, 9, 4, 6, 8, 10, 8, 12, 16, 17, 4, 6, 8, 10, 8, 12, 16, 18, 8, 12, 16, 20, 16, 24, 32, 33, 4, 6, 8, 10, 8, 12, 16, 18, 8, 12, 16, 20, 16, 24, 32, 34, 8, 12, 16, 20, 16, 24, 32, 36, 16, 24, 32, 40, 32, 48, 64, 65, 4, 6, 8, 10, 8, 12
Offset: 0

Views

Author

Omar E. Pol, Dec 16 2013

Keywords

Comments

Partial sums give A233774.
The subsequence of odd terms is A083318. - Gary W. Adamson, Jan 13 2014
Equivalently, this is the coordination sequence for the Sierpinski gasket with respect to the apex. - N. J. A. Sloane, Sep 19 2020

Examples

			Illustration of initial terms:
--------------------------------------------------------
           Diagram            n        a(n)   A233774(n)
--------------------------------------------------------
              *               0         1         1
             /T\
            *---*             1         2         3
           /T\ /T\
          *---*---*           2         3         6
         /T\     /T\
        *---*   *---*         3         4        10
       /T\ /T\ /T\ /T\
      *---*---*---*---*       4         5        15
     /T\             /T\
    *---*           *---*     5         4        19
--------------------------------------------------------
After five stages the number of "black" triangles in the structure is A006046(5) = 11 and the number of "black" triangles in row 5 is A001316(5-1) = 2. The number of vertices in row 5 is equal to 4, so a(5) = 4.
Written as an irregular triangle the sequence begins:
  1;
  2;
  3;
  4,5;
  4,6,8,9;
  4,6,8,10,8,12,16,17;
  4,6,8,10,8,12,16,18,8,12,16,20,16,24,32,33;
  ...
		

Crossrefs

Right border gives A094373.

Programs

Formula

a(0)=1, a(n) = (2^t(n) + 1) * 2^(c(n) - 1) where t(n) = A007814(n) is the number of trailing zeros in the binary representation of n and c(n) = A000120(n) is the total number of ones in the binary representation of n. - Johan Falk, Jun 24 2020

A287839 Number of words of length n over the alphabet {0,1,...,10} such that no two consecutive terms have distance 9.

Original entry on oeis.org

1, 11, 117, 1247, 13289, 141619, 1509213, 16083463, 171399121, 1826575451, 19465548357, 207441511727, 2210673955769, 23558830139779, 251063019088173, 2675542001860183, 28512861152219041, 303857405535211691, 3238164083417650197, 34508642672922983807
Offset: 0

Views

Author

David Nacin, Jun 07 2017

Keywords

Comments

In general, the number of sequences on {0,1,...,10} such that no two consecutive terms have distance 6+k for k in {0,1,2,3,4} has generating function (-1 - x)/(-1 + 10*x + (2*k+1)*x^2).

Crossrefs

Programs

  • Maple
    a:=proc(n) option remember; if n=0 then 1 elif n=1 then 11 elif n=2 then 117 else 10*a(n-1)+7*a(n-2); fi; end: seq(a(n), n=0..30); # Wesley Ivan Hurt, Nov 25 2017
  • Mathematica
    LinearRecurrence[{10, 7}, {1, 11, 117}, 20]
  • PARI
    Vec((1 + x) / (1 - 10*x - 7*x^2) + O(x^30)) \\ Colin Barker, Nov 25 2017
  • Python
    def a(n):
     if n in [0,1,2]:
      return [1, 11, 117][n]
     return 10*a(n-1) + 7*a(n-2)
    

Formula

For n>2, a(n) = 10*a(n-1) + 7*a(n-2), a(0)=1, a(1)=11, a(2)=117.
G.f.: (-1 - x)/(-1 + 10 x + 7 x^2).
a(n) = (((5-4*sqrt(2))^n*(-3+2*sqrt(2)) + (3+2*sqrt(2))*(5+4*sqrt(2))^n)) / (4*sqrt(2)). - Colin Barker, Nov 25 2017

A190939 Subgroups of nimber addition interpreted as binary numbers.

Original entry on oeis.org

1, 3, 5, 9, 15, 17, 33, 51, 65, 85, 105, 129, 153, 165, 195, 255, 257, 513, 771, 1025, 1285, 1545, 2049, 2313, 2565, 3075, 3855, 4097, 4369, 4641, 5185, 6273, 8193, 8481, 8721, 9345, 10305, 12291, 13107, 15555, 16385, 16705, 17025, 17425, 18465, 20485, 21845
Offset: 0

Views

Author

Tilman Piesk, May 24 2011

Keywords

Comments

Each subgroup {0,a,b,...} of nimber addition can be assigned an integer 1+2^a+2^b+...
These integers ordered by size give this sequence.
Without nimbers the sequence may be defined as follows:
The powerset af a set {0,...,n-1} with the symmetric difference as group operation forms the elementary abelian group (Z_2)^n.
The elements of the group can be numbered lexicographically from 0 to 2^n-1, with 0 representing the neutral element:
{}-->0 , {0}-->2^0=1 , {1}-->2^1=2 , {0,1}-->2^0+2^1=3 , ... , {0,...,n-1}-->2^n-1
So the subgroups of (Z_2)^n can be represented by subsets of {0,...,2^n-1}.
So each subgroup {0,a,b,...} of (Z_2)^n can be assigned an integer 1+2^a+2^b+...
For each (Z_2)^n there is a finite sequence of these numbers ordered by size, and it is the beginning of the finite sequence for (Z_2)^(n+1).
This leads to the infinite sequence:
* 1, (1 until here for (Z_2)^0)
* 3, (2 until here for (Z_2)^1)
* 5, 9, 15, (5 until here for (Z_2)^2)
* 17, 33, 51, 65, 85, 105, 129, 153, 165, 195, 255, (16 until here for (Z_2)^3)
* 257, 513, 771, 1025, 1285, 1545, 2049, 2313, 2565, 3075, 3855, 4097, 4369, 4641, 5185, 6273, 8193, 8481, 8721, 9345, 10305, 12291, 13107, 15555, 16385, 16705, 17025, 17425, 18465, 20485, 21845, 23205, 24585, 26265, 26985, 32769, 33153, 33345, 33825, 34833, 36873, 38505, 39321, 40965, 42405, 43605, 49155, 50115, 52275, 61455, 65535, (67 until here for (Z_2)^4)
* 65537, ...
The number of subgroups of (Z_2)^n is 1, 2, 5, 16, 67, 374, 2825, ... (A006116)
Comment from Tilman Piesk, Aug 27 2013: (Start)
Boolean functions correspond to integers, and belong to small equivalence classes (sec). So a sec can be seen as an infinite set of integers (represented in A227722 by the smallest one). Some secs contain only one odd integer. These unique odd integers, ordered by size, are shown in this sequence. (While the smallest integers from these secs are shown in A227963.)
(End)

Examples

			The 5 subgroups of the Klein four-group (Z_2)^2 and corresponding integers are:
{0      }     -->     2^0                     =   1
{0,1    }     -->     2^0 + 2^1               =   3
{0,  2  }     -->     2^0       + 2^2         =   5
{0,    3}     -->     2^0             + 2^3   =   9
{0,1,2,3}     -->     2^0 + 2^1 + 2^2 + 2^3   =  15
		

Crossrefs

Cf. A227963 (the same small equivalence classes represented by entries of A227722)
Cf. A198260 (number of runs of ones in the binary strings)
Subsequences:
Cf. A051179 (2^2^n-1).
Cf. A083318 (2^n+1).
Cf. A001317 (rows of the Sierpinski triangle read like binary numbers).
Cf. A228540 (rows of negated binary Walsh matrices r.l.b.n.).
Cf. A122569 (negated iterations of the Thue-Morse sequence r.l.b.n.).

Extensions

Offset changed to 0 by Tilman Piesk, Jan 25 2012

A248156 Inverse Riordan triangle of A106513: Riordan ((1 - 2*x^2 )/(1 + x), x/(1+x)).

Original entry on oeis.org

1, -2, 1, 1, -3, 1, 0, 4, -4, 1, -1, -4, 8, -5, 1, 2, 3, -12, 13, -6, 1, -3, -1, 15, -25, 19, -7, 1, 4, -2, -16, 40, -44, 26, -8, 1, -5, 6, 14, -56, 84, -70, 34, -9, 1, 6, -11, -8, 70, -140, 154, -104, 43, -10, 1, -7, 17, -3, -78, 210, -294, 258, -147, 53, -11, 1, 8, -24, 20, 75, -288, 504, -552, 405, -200, 64, -12, 1
Offset: 0

Views

Author

Wolfdieter Lang, Oct 05 2014

Keywords

Comments

Row sums have o.g.f. (1 - 2*x)/(1 + x): [1, -1, repeat(-1, 1)].

Examples

			The triangle T(n,k) begins:
  n\k  0   1   2   3    4    5    6    7    8    9
  0:   1
  1:  -2   1
  2:   1  -3   1
  3:   0   4  -4   1
  4:  -1  -4   8  -5    1
  5:   2   3 -12  13   -6    1
  6:  -3  -1  15 -25   19   -7    1
  7:   4  -2 -16  40  -44   26   -8    1
  8:  -5   6  14 -56   84  -70   34   -9    1
  9:   6 -11  -8  70 -140  154 -104   43  -10    1
  ...
For more rows see the link.
Recurrence from A-sequence: T(5,2) = T(4,1) - T(4,2) = -4 - 8 = -12.
Recurrence from the Z-sequence: T(5,0) = -(2*(-1) + 3*(-4) + 7*8 + 17*(-5) + 41*1) = 2.
Standard recurrence for T(n,0): T(3,0) = -2*T(2,0) - T(1,0) = -2*1 - (-2) = 0.
		

Crossrefs

Columns: A248157 (k=0), A248158 (k=1), A248159 (k=2), A248160 (k=3).
Diagonals: A000012 (k=n), A022958(n+3) (k=n-1), -A034856(n-1) (k=n-2), A000297(n-4) (k=n-3), A014309(n-3) (k=n-4).
Sums: (-1)^n*A001611(n) (diagonal), (-1)^n*A083318(n) (alternating sign row).

Programs

  • Magma
    function T(n,k) // T = A248156
      if k eq n then return 1;
      elif k eq 0 then return (-1)^n*(3-n);
      else return T(n-1,k-1) - T(n-1,k);
      end if;
    end function;
    [T(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, May 27 2025
    
  • Mathematica
    T[n_, k_] := SeriesCoefficient[x^k*(1 - 2*x^2)/(1 + x)^(k + 2), {x, 0, n}]; Table[T[n, k], {n, 0, 11}, {k, 0, n}] // Flatten (* Jean-François Alcover, Oct 09 2014 *)
    T[n_, k_]:= T[n, k]= If[k==n,1, If[k==0,(-1)^n*(3-n), T[n-1,k-1]-T[n-1,k]]];
    Table[T[n,k], {n,0,25}, {k,0,n}]//Flatten (* G. C. Greubel, May 27 2025 *)
  • SageMath
    def T(n,k): # T = A248156
        if (k==n): return 1
        elif (k==0): return (-1)^n*(3-n)
        else: return T(n-1,k-1) - T(n-1,k)
    print(flatten([[T(n,k) for k in range(n+1)] for n in range(13)])) # G. C. Greubel, May 27 2025

Formula

O.g.f. row polynomials R(n,x) = Sum_{k=0..n} T(n,k)*x^k = [(-z)^n] (1 - 2*z^2)/( (1 + z)*(1 + (1-x)*z)).
O.g.f. column m: x^m*(1 - 2*x^2)/(1 + x)^(m+2), m >= 0.
The A-sequence is [1, -1], implying the recurrence T(n,k) = T(n-1, k-1) - T(n-1, k), n >= k > = 1.
The Z-sequence is -[2, 3, 7, 17, 41, 99, 239, 577, 1393, ...] = A248161, implying the recurrence T(n, 0) = Sum_{k=0..n-1} T(n-1,k)*Z(k). See the W. Lang link under A006232 for Riordan A- and Z-sequences.
The standard recurrence for the sequence for column k=0 is T(0,0) = 1 and T(n,0) = -2*T(n-1,0) - T(n-2,0), n >= 3, with T(1,0) = -2 and T(2,0) = 1.
From G. C. Greubel, May 27 2025: (Start)
Sum_{k=0..n} T(n, k) = (-1)^(n+1) + 2*([n=0] - [n=1]).
Sum_{k=0..floor(n/2)} (-1)^k*T(n-k, k) = the repeated pattern of [1, -2, 0, 3, -4, 2]. (End)
Showing 1-10 of 53 results. Next