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 12 results. Next

A176271 The odd numbers as a triangle read by rows.

Original entry on oeis.org

1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 121, 123, 125, 127, 129, 131
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 13 2010

Keywords

Comments

A108309(n) = number of primes in n-th row.

Examples

			From _Philippe Deléham_, Oct 03 2011: (Start)
Triangle begins:
   1;
   3,  5;
   7,  9, 11;
  13, 15, 17, 19;
  21, 23, 25, 27, 29;
  31, 33, 35, 37, 39, 41;
  43, 45, 47, 49, 51, 53, 55;
  57, 59, 61, 63, 65, 67, 69, 71;
  73, 75, 77, 79, 81, 83, 85, 87, 89; (End)
		

Crossrefs

Programs

  • Haskell
    a176271 n k = a176271_tabl !! (n-1) !! (k-1)
    a176271_row n = a176271_tabl !! (n-1)
    a176271_tabl = f 1 a005408_list where
       f x ws = us : f (x + 1) vs where (us, vs) = splitAt x ws
    -- Reinhard Zumkeller, May 24 2012
    
  • Magma
    [n^2-n+2*k-1: k in [1..n], n in [1..15]]; // G. C. Greubel, Mar 10 2024
    
  • Maple
    A176271 := proc(n,k)
        n^2-n+2*k-1 ;
    end proc: # R. J. Mathar, Jun 28 2013
  • Mathematica
    Table[n^2-n+2*k-1, {n,15}, {k,n}]//Flatten (* G. C. Greubel, Mar 10 2024 *)
  • SageMath
    flatten([[n^2-n+2*k-1 for k in range(1,n+1)] for n in range(1,16)]) # G. C. Greubel, Mar 10 2024

Formula

T(n, k) = n^2 - n + 2*k - 1 for 1 <= k <= n.
T(n, k) = A005408(n*(n-1)/2 + k - 1).
T(2*n-1, n) = A016754(n-1) (main diagonal).
T(2*n, n) = A000466(n).
T(2*n, n+1) = A053755(n).
T(n, k) + T(n, n-k+1) = A001105(n), 1 <= k <= n.
T(n, 1) = A002061(n), central polygonal numbers.
T(n, 2) = A027688(n-1) for n > 1.
T(n, 3) = A027690(n-1) for n > 2.
T(n, 4) = A027692(n-1) for n > 3.
T(n, 5) = A027694(n-1) for n > 4.
T(n, 6) = A048058(n-1) for n > 5.
T(n, n-3) = A108195(n-2) for n > 3.
T(n, n-2) = A082111(n-2) for n > 2.
T(n, n-1) = A014209(n-1) for n > 1.
T(n, n) = A028387(n-1).
Sum_{k=1..n} T(n, k) = A000578(n) (Nicomachus's theorem).
Sum_{k=1..n} (-1)^(k-1)*T(n, k) = (-1)^(n-1)*A065599(n) (alternating sign row sums).
Sum_{j=1..n} (Sum_{k=1..n} T(j, k)) = A000537(n) (sum of first n rows).

A028884 a(n) = (n + 3)^2 - 8.

Original entry on oeis.org

1, 8, 17, 28, 41, 56, 73, 92, 113, 136, 161, 188, 217, 248, 281, 316, 353, 392, 433, 476, 521, 568, 617, 668, 721, 776, 833, 892, 953, 1016, 1081, 1148, 1217, 1288, 1361, 1436, 1513, 1592, 1673, 1756, 1841, 1928, 2017, 2108, 2201, 2296, 2393
Offset: 0

Views

Author

Keywords

Comments

From Klaus Purath, Jan 04 2023: (Start)
The product of two consecutive terms belongs to the sequence: a(n)*a(n+1) = a(a(n)+n) = (a(n)+n)*(a(n+1)-n-1) + 1.
a(n) is never divisible by primes given in A003629.
Each odd prime factor p divides exactly 2 out of any p consecutive terms. If a(i) and a(k) form such a pair that are divisible by p, then i + k == -6 (mod p).
The prime factors are listed in A038873 and the primes in A028886.
For n > 0, this is a proper subsequence of A079896.
Conjecture: a(n) = A079896(A265284(n-1)). -
(End)

Examples

			From _Stefano Spezia_, Nov 08 2022: (Start)
Illustrations for n = 0..4:
          *       * * *     * * * * *
      a(0) = 1    *   *     *       *
                  * * *     *   *   *
                a(1) = 8    *       *
                            * * * * *
                            a(2) = 17
.
   * * * * * * *    * * * * * * * * *
   *           *    *               *
   *   *   *   *    *   *   *   *   *
   *           *    *               *
   *   *   *   *    *   *   *   *   *
   *           *    *               *
   * * * * * * *    *   *   *   *   *
     a(3) = 28      *               *
                    * * * * * * * * *
                        a(4) = 41
(End)
		

Crossrefs

Programs

Formula

a(n) = a(n-1) + 2*n + 5 (with a(0) = 1). - Vincenzo Librandi, Aug 05 2010
a(n) = A028560(n) + 1; A014616(n) = floor(a(n+1)/4). - Reinhard Zumkeller, Apr 07 2013
G.f.: (-1 - 5*x + 4*x^2)/(x - 1)^3. - R. J. Mathar, Mar 24 2013
Sum_{n >= 0} 1/a(n) = 51/112 - Pi*cot(2*Pi*sqrt(2))/(4*sqrt(2)) = 1.3839174974448... . - Vaclav Kotesovec, Apr 10 2016
E.g.f.: (1 + 7*x + x^2)*exp(x). - G. C. Greubel, Aug 19 2017
Sum_{n >= 0} (-1)^n/a(n) = (-19 + 14*sqrt(2)*Pi*cosec(2*sqrt(2)*Pi))/112. - Amiram Eldar, Nov 04 2020
From Klaus Purath, Jan 04 2023: (Start)
a(n) = 2*a(n-1) - a(n-2) + 2, n >= 2.
a(n) = A082111(n) + n.
a(n) = A190576(n+1) - n. (End)
From Amiram Eldar, Feb 05 2024: (Start)
Product_{n>=1} (1 - 1/a(n)) = 7*Pi/(45*sqrt(2)*sin(2*sqrt(2)*Pi)).
Product_{n>=0} (1 + 1/a(n)) = (4*sqrt(14)/9)*sin(sqrt(7)*Pi)/sin(2*sqrt(2)*Pi). (End)

Extensions

Definition corrected by Omar E. Pol, Jul 27 2009

A199898 T(n,k)=Number of -k..k arrays x(0..n-1) of n elements with zero sum, and adjacent elements not both strictly positive and not both strictly negative.

Original entry on oeis.org

1, 1, 3, 1, 5, 7, 1, 7, 15, 15, 1, 9, 25, 49, 33, 1, 11, 37, 111, 159, 75, 1, 13, 51, 209, 461, 533, 171, 1, 15, 67, 351, 1043, 2035, 1783, 391, 1, 17, 85, 545, 2031, 5725, 8823, 6027, 899, 1, 19, 105, 799, 3573, 13363, 30199, 39053, 20437, 2077, 1, 21, 127, 1121, 5839
Offset: 1

Views

Author

R. H. Hardin Nov 11 2011

Keywords

Comments

Table starts
....1.....1......1.......1........1........1.........1.........1..........1
....3.....5......7.......9.......11.......13........15........17.........19
....7....15.....25......37.......51.......67........85.......105........127
...15....49....111.....209......351......545.......799......1121.......1519
...33...159....461....1043.....2031.....3573......5839......9021......13333
...75...533...2035....5725....13363....27457.....51395.....89577.....147547
..171..1783...8823...30199....82555...193689....406575....783989....1413739
..391..6027..39053..164993...536967..1462859...3500269...7584081...15191479
..899.20437.172355..890299..3409609.10651367..28684325..68971571..151640029
.2077.69665.767425.4877477.22163661.80142549.245319361.661158741.1611184533

Examples

			Some solutions for n=7 k=6
..1....3....3....4...-3....4....4....0....3....3...-3...-6....4...-5....0....4
.-3...-4...-4...-6....5...-2...-6....6...-3...-5....0....3...-4....5...-3...-5
..0....1....2....2...-3....4....4...-5....0....4....3...-1....0...-4....5....1
.-1....0...-3....0....0...-1...-3....3....4....0....0....6....5....6....0...-1
..4....0....2....0....1....0....0...-6...-1....2...-2...-2...-6...-3...-3....5
.-6...-4...-2....3...-6...-5...-4....5....3....0....2....4....3....4....6....0
..5....4....2...-3....6....0....5...-3...-6...-4....0...-4...-2...-3...-5...-4
		

Crossrefs

Column 1 is A136029(n+1)
Row 3 is A082111

Formula

Empirical for rows:
T(1,k) = 1
T(2,k) = 2*k + 1
T(3,k) = k^2 + 5*k + 1
T(4,k) = (4/3)*k^3 + 6*k^2 + (20/3)*k + 1
T(5,k) = (11/12)*k^4 + (49/6)*k^3 + (193/12)*k^2 + (41/6)*k + 1
T(6,k) = (11/10)*k^5 + (55/6)*k^4 + (55/2)*k^3 + (173/6)*k^2 + (37/5)*k + 1
T(7,k) = (151/180)*k^6 + (163/15)*k^5 + (377/9)*k^4 + (395/6)*k^3 + (7429/180)*k^2 + (93/10)*k + 1

A181510 Number of permutations of the multiset {1,1,2,2,3,3,...,n+1,n+1} avoiding the permutation patterns {132, 231, 2134}.

Original entry on oeis.org

6, 18, 34, 54, 78, 106, 138, 174, 214, 258, 306, 358, 414, 474, 538, 606, 678, 754, 834, 918, 1006, 1098, 1194, 1294, 1398, 1506, 1618, 1734, 1854, 1978, 2106, 2238, 2374, 2514, 2658, 2806, 2958, 3114, 3274, 3438, 3606, 3778, 3954, 4134, 4318, 4506, 4698, 4894
Offset: 1

Views

Author

Lara Pudwell, Oct 25 2010

Keywords

Comments

a(n) is also the surface ares of the n-th solid in the following recursive construction:
The first solid is a unit cube (hence a(1)=6).
To form the n-th solid from the (n-1)st solid, construct a row of 2n-1 cubes, then center the (n-1)st solid on top of this row. (For example, the second solid is a row of 3 unit cubes, with a single unit cube centered on top of the middle cube. This construction has surface area a(2)=18.)
The sequence provides all nonnegative integers m such that 2*m + 13 is a square. - Bruno Berselli, Mar 01 2013

Examples

			For n=1, the permutations of {1,1,2,2} avoiding the patterns {132, 231, 2134} are {1122, 1212, 1221, 2112, 2121, 2211}.
For n=2, the permutations of {1,1,2,2,3,3} avoiding the patterns {132, 231, 2134} are {112233, 121233, 122133, 211233, 212133, 221133, 311223, 312123, 312213, 321123, 321213, 322113, 331122, 331212, 331221, 332112, 332121, 332211}.
		

Crossrefs

Programs

Formula

a(n) = 2*n^2 + 6*n - 2.
From Bruno Berselli, Oct 29 2010: (Start)
G.f.: 2*x*(3-x^2)/(1-x)^3.
a(n) - 3*a(n-1) + 3*a(n-2) - a(n-3) = 0 for n > 3.
a(n) = 2*A014209(n) = 2*A082111(n-1) + 4 = A051936(2*n+2) + n + 4. (End)
Sum_{n>=1} 1/a(n) = 2/3 + Pi*tan(sqrt(13)*Pi/2)/(2*sqrt(13)). - Amiram Eldar, Dec 23 2022
E.g.f.: 2*(exp(x)*(x^2 + 4*x - 1) + 1). - Elmo R. Oliveira, Nov 17 2024

A108306 Expansion of (3*x+1)/(1-3*x-3*x^2).

Original entry on oeis.org

1, 6, 21, 81, 306, 1161, 4401, 16686, 63261, 239841, 909306, 3447441, 13070241, 49553046, 187869861, 712268721, 2700415746, 10238053401, 38815407441, 147160382526, 557927369901, 2115263257281, 8019571881546, 30404505416481, 115272231894081
Offset: 0

Views

Author

Creighton Dement, Jul 24 2005

Keywords

Comments

Binomial transform is A055271. May be seen as a ibasefor-transform of the zero-sequence A000004 with respect to the floretion given in the program code.
The sequence is the INVERT transform of (1, 5, 10, 20, 40, 80, 160, ...) and can be obtained by extracting the upper left terms of matrix powers of [(1,5); (1,2)]. These results are a case (a=5, b=2) of the conjecture: The INVERT transform of a sequence starting (1, a, a*b, a*b^2, a*b^3, ...) is equivalent to extracting the upper left terms of powers of the 2x2 matrix [(1,a); (1,b)]. - Gary W. Adamson, Jul 31 2016
From Klaus Purath, Mar 09 2023: (Start)
For any terms (a(n), a(n+1)) = (x, y), -3*x^2 - 3*x*y + y^2 = 15*(-3)^n = A082111(2)*(-3)^n. This is valid in general for all recursive sequences (t) with constant coefficients (3,3) and t(0) = 1: -3*x^2 - 3*x*y + y^2 = A082111(t(1)-4)*(-3)^n.
By analogy to this, for three consecutive terms (x, y, z) of any sequence (t) of the form (3,3) with t(0) = 1: y^2 - x*z = A082111(t(1)-4)*(-3)^n. (End)

Crossrefs

Cf. A055271.
Cf. A084057.

Programs

  • Magma
    I:=[1,6]; [n le 2 select I[n] else 3*Self(n-1)+3*Self(n-2): n in [1..30]]; // Vincenzo Librandi, Aug 01 2016
  • Maple
    seriestolist(series((3*x+1)/(1-3*x-3*x^2), x=0,25));
  • Mathematica
    CoefficientList[Series[(3 x + 1) / (1 - 3 x - 3 x^2), {x, 0, 40}], x] (* Vincenzo Librandi, Aug 01 2016 *)

Formula

Recurrence: a(0)=1; a(1)=6; a(n) = 3a(n-1) + 3a(n-2) - N-E. Fahssi, Apr 20 2008

A082110 Array A(n,k) = (k*n)^2 + 5*(k*n) + 1, read by antidiagonals.

Original entry on oeis.org

1, 1, 1, 1, 7, 1, 1, 15, 15, 1, 1, 25, 37, 25, 1, 1, 37, 67, 67, 37, 1, 1, 51, 105, 127, 105, 51, 1, 1, 67, 151, 205, 205, 151, 67, 1, 1, 85, 205, 301, 337, 301, 205, 85, 1, 1, 105, 267, 415, 501, 501, 415, 267, 105, 1, 1, 127, 337, 547, 697, 751, 697, 547, 337, 127, 1
Offset: 0

Views

Author

Paul Barry, Apr 04 2003

Keywords

Examples

			Square array, A(n, k), begins as:
  1,   1,   1,   1,    1,    1,    1,    1,    1, ... A000012;
  1,   7,  15,  25,   37,   51,   67,   85,  105, ... A082111;
  1,  15,  37,  67,  105,  151,  205,  267,  337, ... A082112;
  1,  25,  67, 127,  205,  301,  415,  547,  697, ...
  1,  37, 105, 205,  337,  501,  697,  925, 1185, ...
  1,  51, 151, 301,  501,  751, 1051, 1401, 1801, ...
  1,  67, 205, 415,  697, 1051, 1477, 1975, 2545, ...
  1,  85, 267, 547,  925, 1401, 1975, 2647, 3417, ...
  1, 105, 337, 697, 1185, 1801, 2545, 3417, 4417, ...
Antidiagonals, T(n, k), begins as:
  1;
  1,  1;
  1,  7,   1;
  1, 15,  15,   1;
  1, 25,  37,  25,   1;
  1, 37,  67,  67,  37,   1;
  1, 51, 105, 127, 105,  51,   1;
  1, 67, 151, 205, 205, 151,  67,  1;
  1, 85, 205, 301, 337, 301, 205, 85,  1;
		

Crossrefs

Programs

  • Magma
    [(k*(n-k))^2 + 5*(k*(n-k)) + 1: k in [0..n], n in [0..13]]; // G. C. Greubel, Dec 22 2022
    
  • Mathematica
    T[n_, k_]:= (k*(n-k))^2 + 5*(k*(n-k)) + 1;
    Table[T[n,k], {n,0,13}, {k,0,n}]//Flatten (* G. C. Greubel, Dec 22 2022 *)
  • SageMath
    def A082110(n,k): return (k*(n-k))^2 + 5*(k*(n-k)) + 1
    flatten([[A082110(n,k) for k in range(n+1)] for n in range(14)]) # G. C. Greubel, Dec 22 2022

Formula

A(n, k) = (k*n)^2 + 5*(k*n) + 1 (Square array).
A(k, n) = A(n, k).
A(2, k) = A082111(k).
A(3, k) = A082112(k).
A(n, n) = T(2*n, n) = A082113(n) (main diagonal).
T(n, k) = (k*(n-k))^2 + 5*k*(n-k) + 1 (number triangle).
Sum_{k=0..n} T(n, k) = A082114(n) (diagonal sums of the array).
From G. C. Greubel, Dec 22 2022: (Start)
T(n, n-k) = T(n, k).
Sum_{k=0..n} (-1)^k*T(n, k) = (1 - 3*n)*(1 + (-1)^n)/2. (End)

A038893 Odd primes p such that 21 is a square mod p.

Original entry on oeis.org

3, 5, 7, 17, 37, 41, 43, 47, 59, 67, 79, 83, 89, 101, 109, 127, 131, 151, 163, 167, 173, 193, 211, 227, 251, 257, 269, 277, 293, 311, 331, 337, 353, 373, 379, 383, 419, 421, 457, 461, 463, 467, 479, 487, 499, 503
Offset: 1

Views

Author

Keywords

Comments

These primes correspond to the representation of the two classes of discriminant 21 of binary quadratic forms with principal reduced forms [1, 3, -3] and [3, 3, -1]. The first class represents the primes given in A141159 (or A139492). The second class gives the prime 3 (which divides 21), and primes congruent to 2 (mod 3) and also to 3, 5, 6 (mod 7). The solution of x^2 - 21 == 0 (mod p) leads to the representative primitive parallel forms for discriminant 21 and representation of primes p. - Wolfdieter Lang, Jun 19 2019
Prime factors of A082111 and excluding the 3, prime factors of A004538. - Klaus Purath, Jan 04 2023

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[100]], JacobiSymbol[21, #] != -1 &] (* Vincenzo Librandi, Sep 07 2012 *)
  • PARI
    isok(p) = (p>2) && isprime(p) && issquare(Mod(21, p)); \\ Michel Marcus, Jun 19 2019

Extensions

Name clarified by Michel Marcus, Jun 22 2019

A185877 Array T given by T(n,k) = k^2 +(2*n-3)*k -2*n +3, by antidiagonals.

Original entry on oeis.org

1, 3, 1, 7, 5, 1, 13, 11, 7, 1, 21, 19, 15, 9, 1, 31, 29, 25, 19, 11, 1, 43, 41, 37, 31, 23, 13, 1, 57, 55, 51, 45, 37, 27, 15, 1, 73, 71, 67, 61, 53, 43, 31, 17, 1, 91, 89, 85, 79, 71, 61, 49, 35, 19, 1, 111, 109, 105, 99, 91, 81, 69, 55, 39, 21, 1, 133, 131, 127, 121, 113, 103, 91, 77, 61, 43, 23, 1, 157, 155, 151, 145, 137, 127, 115, 101, 85, 67, 47, 25, 1, 183, 181, 177, 171, 163, 153, 141, 127, 111, 93, 73, 51, 27, 1
Offset: 1

Views

Author

Clark Kimberling, Feb 05 2011

Keywords

Comments

A member of the accumulation chain ... < A185879 < A185877 < A185878 < A185880 < ... (See A144112 for the definition of accumulation array).

Examples

			Northwest corner:
  1, 3,  7, 13, 21
  1, 5, 11, 19, 29
  1, 7, 15, 25, 45
  1, 9, 19, 31, 45
		

Crossrefs

Row 1 to 3: A002061, A028387, A082111.
diag (1,5,...): A056108;
diag (3,11,...): A056106;
diag (7,19,...): A003215;
diag (13,29,...): A144391;
diag (1,7,...): A003215;
diag (1,9,...): A144390.

Programs

  • Mathematica
    (* This program generates A185877, its accumulation array A185878, and its weight array A185879. *)
    f[n_,0]:=0;f[0,k_]:=0;
    f[n_,k_]:=k^2+(2n-3)k-2n+3;
    TableForm[Table[f[n,k],{n,1,10},{k,1,15}]] (* A185877 *)
    Table[f[n-k+1,k],{n,14},{k,n,1,-1}]//Flatten
    s[n_,k_]:=Sum[f[i,j],{i,1,n},{j,1,k}]; (* accumulation array of {f(n,k)} *)
    FullSimplify[s[n,k]]  (* formula for A185878 *)
    TableForm[Table[s[n,k],{n,1,10},{k,1,15}]]
    Table[s[n-k+1,k],{n,14},{k,n,1,-1}]//Flatten
    w[m_,n_]:=f[m,n]+f[m-1,n-1]-f[m,n-1]-f[m-1,n]/;Or[m>0,n>0];
    TableForm[Table[w[n,k],{n,1,10},{k,1,15}]] (* A185879 *)
    Table[w[n-k+1,k],{n,14},{k,n,1,-1}]//Flatten

Formula

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

A190576 a(n) = n^2 + 5*n - 5.

Original entry on oeis.org

1, 9, 19, 31, 45, 61, 79, 99, 121, 145, 171, 199, 229, 261, 295, 331, 369, 409, 451, 495, 541, 589, 639, 691, 745, 801, 859, 919, 981, 1045, 1111, 1179, 1249, 1321, 1395, 1471, 1549, 1629, 1711, 1795, 1881, 1969, 2059, 2151, 2245, 2341
Offset: 1

Views

Author

Keywords

Comments

Also a(n) = n^2 + 9*n + 9 if the offset is changed to -1. - R. J. Mathar, May 18 2011

Crossrefs

Cf. sequences of the form n^2 + k*n - k : A000290 (k=0), A028387 (k=1), A028872 (k=2), A082111 (k=3), A028884 (k=4).

Programs

Formula

G.f.: x*(-1 - 6*x + 5*x^2) / (x-1)^3. - R. J. Mathar, May 18 2011
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3); a(1)=1, a(2)=9, a(3)=19. - Harvey P. Dale, May 28 2015
Sum_{n>=1} 1/a(n) = 199/495 + Pi*tan(3*sqrt(5)*Pi/2)/(3*sqrt(5)). - Amiram Eldar, Jan 18 2021

A099867 a(n) = 5*a(n-1) - a(n-2) for n>1, a(0)=1, a(1)=9.

Original entry on oeis.org

1, 9, 44, 211, 1011, 4844, 23209, 111201, 532796, 2552779, 12231099, 58602716, 280782481, 1345309689, 6445765964, 30883520131, 147971834691, 708975653324, 3396906431929, 16275556506321, 77980876099676, 373628823992059, 1790163243860619, 8577187395311036
Offset: 0

Views

Author

Creighton Dement, Oct 28 2004

Keywords

Comments

From Klaus Purath, Mar 07 2023: (Start)
For any two terms (a(n), a(n+1)) = (x, y), x^2 - 5*x*y + y^2 = 37 = A082111(4). This is valid in general for all recursive sequences (t) with constant coefficients (5,-1) and t(0) = 1: x^2 - 5*x*y + y^2 = A082111(t(1)-5). This includes and interprets the Feb 04 2014 comment in A004253 by Colin Barker.
By analogy to all this, for three consecutive terms (x, y, z) of any sequence (t) of the form (5,-1) with t(0) = 1: y^2 - x*z = A082111(t(1)-5). (End)

Crossrefs

Programs

  • Magma
    I:=[1,9]; [n le 2 select I[n] else 5*Self(n-1)-Self(n-2): n in [1..30]]; // Vincenzo Librandi, Jul 30 2015
    
  • Mathematica
    a[0] = 1; a[1] = 9; a[n_] := a[n] = 5 a[n - 1] - a[n - 2]; Table[ a[n], {n, 0, 21}] (* Robert G. Wilson v, Dec 14 2004 *)
    LinearRecurrence[{5, -1}, {1, 9}, 30] (* or *) CoefficientList[Series[(1 + 4 x)/(1 - 5 x + x^2), {x, 0, 30}], x] (* Harvey P. Dale, Jun 26 2011 *)
  • PARI
    Vec((1+4*x) / (1-5*x+x^2) + O(x^30)) \\ Colin Barker, Mar 31 2017

Formula

|2*a(n) + A099868(n) - A003501(n+1)| = 20*A004254(n).
From R. J. Mathar, Sep 11 2008: (Start)
G.f.: (1+4*x) / (1-5*x+x^2).
a(n) = A004254(n+1) + 4*A004254(n).
(End)
a(n) = 2^(-1-n)*((5-sqrt(21))^n*(-13+sqrt(21)) + (5+sqrt(21))^n*(13+sqrt(21))) / sqrt(21). - Colin Barker, Mar 31 2017
Showing 1-10 of 12 results. Next