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-2 of 2 results.

A066983 a(n+2) = a(n+1) + a(n) + (-1)^n, with a(1) = a(2) = 1.

Original entry on oeis.org

1, 1, 1, 3, 3, 7, 9, 17, 25, 43, 67, 111, 177, 289, 465, 755, 1219, 1975, 3193, 5169, 8361, 13531, 21891, 35423, 57313, 92737, 150049, 242787, 392835, 635623, 1028457, 1664081, 2692537, 4356619, 7049155, 11405775, 18454929, 29860705, 48315633, 78176339
Offset: 1

Views

Author

Benoit Cloitre, Jan 27 2002

Keywords

Comments

Length of strings given by a successive substitution of a "modified" Kolakoski-(3, 1) sequence. Starting with 1, using the rule "string begins with 1 if previous string ends with 3, string begins with 3 if previous string ends with 1" then applying the classical Kolakoski-(3,1) rule. This gives: 1 -> 3 -> 111 -> 313 -> 1113111 -> 313111313 -> 11131113131113111 and the length of string are 1, 1, 3, 3, 7, 9, 17, ... At step n, length = a(n+1). This substitution leads to two sequences: 1, 1, 1, 3, 1, 1, 1, 3, 1, 3, 1, 1, 1, ... and 3, 1, 3, 1, 1, 1, 3, 1, 3, 1, 1, 1, 3, ... - Benoit Cloitre, Jun 01 2004
Lengths of comparators in subsequent layers of correction network F_n. - Grzegorz Stachowiak (gst(AT)ii.uni.wroc.pl), Nov 28 2004
Convolution of F(n+1) and A105812(n). Action of inverse of sequence array for F(n-1)*(-1)^n on F(n+1). - Paul Barry, Oct 29 2006

References

  • Omur Deveci, The Pell-Padovan sequences and the Jacobsthal-Padovan sequences in finite groups, Utilitas Mathematica, 98 (2015), 257-270.

Crossrefs

Programs

  • GAP
    a:=[1,1];; for n in [3..40] do a[n]:=a[n-1]+a[n-2]+(-1)^n; od; a; # Muniru A Asiru, Aug 09 2018
    
  • Magma
    [n le 2 select 1 else Self(n-1)+Self(n-2)+(-1)^n: n in [1..50]]; // Vincenzo Librandi, Aug 13 2018
    
  • Maple
    seq(coeff(series(x*(1+x-x^2)/((1+x)*(1-x-x^2)), x,n+1),x,n),n=1..40); # Muniru A Asiru, Aug 09 2018
  • Mathematica
    Table[ Floor[ GoldenRatio^(k-1) ] - Floor[ GoldenRatio^(k-1) / Sqrt[5] ], {k, 1, 100} ]  (* Federico Provvedi, Mar 26 2013 *)
    LinearRecurrence[{0, 2, 1}, {1, 1, 1}, 40] (* Vincenzo Librandi, Aug 13 2018 *)
  • PARI
    { for (n=1, 250, if (n>2, a=a1 + a2 + (-1)^n; a2=a1; a1=a, a=a1=1; a=a2=1); write("b066983.txt", n, " ", a) ) } \\ Harry J. Smith, Apr 15 2010
    
  • PARI
    vector(40, n, 2*fibonacci(n-2) + (-1)^n) \\ G. C. Greubel, Dec 26 2019
    
  • Python
    from sympy import fibonacci
    def A066983(n): return (fibonacci(n-2)<<1)+(-1 if n&1 else 1) # Chai Wah Wu, May 05 2025
  • Sage
    [2*fibonacci(n-2) + (-1)^n for n in (1..40)] # G. C. Greubel, Dec 26 2019
    

Formula

For n > 4, a(n-2) = floor(2 * phi^n/sqrt(5)) + (1 + (-1)^n)/2.
a(n) = 2 * Fibonacci(n-2) + (-1)^n. - Vladeta Jovovic, Mar 19 2003
G.f.: x*(1+x-x^2)/((1+x)*(1-x-x^2)). - Paul Barry, Oct 29 2006
a(n) = A066629(n-2) - A066629(n-3), n > 2. - R. J. Mathar, Jan 14 2009
a(n) = floor(phi^(n-1)) - floor(phi^(n-1)/sqrt(5)). - Federico Provvedi, Mar 26 2013
a(1) = a(2) = a(3) = 1; for n > 3, a(n) = 2*a(n-2) + a(n-3). - Taras Goy, Aug 03 2018
a(n) = (-1)^n + (-1 - 3/sqrt(5))*((1/2)*(1 - sqrt(5)))^n + (-1 + 3/sqrt(5))*((1/2)*(1 + sqrt(5)))^n. - Stefano Spezia, Jul 22 2019

Extensions

Deleted certain dangerous or potentially dangerous links. - N. J. A. Sloane, Jan 30 2021

A105810 Inverse of a Fibonacci-Pascal matrix A105809.

Original entry on oeis.org

1, -1, 1, 0, -2, 1, 1, 2, -3, 1, -2, -1, 5, -4, 1, 3, -1, -6, 9, -5, 1, -4, 4, 5, -15, 14, -6, 1, 5, -8, -1, 20, -29, 20, -7, 1, -6, 13, -7, -21, 49, -49, 27, -8, 1, 7, -19, 20, 14, -70, 98, -76, 35, -9, 1, -8, 26, -39, 6, 84, -168, 174, -111, 44, -10, 1, 9, -34, 65, -45, -78, 252, -342, 285, -155, 54, -11, 1
Offset: 0

Views

Author

Paul Barry, May 04 2005

Keywords

Comments

First column is A105811, row sums are A105812, antidiagonal sums are (-1)^n.

Examples

			The triangle T(n,m) begins:
n\m   0   1   2    3   4    5    6    7     8    9   10  11  12 13 ...
0:    1
1:   -1   1
2:    0  -2   1
3:    1   2  -3    1
4:   -2  -1   5   -4   1
5:    3  -1  -6    9  -5    1
6:   -4   4   5  -15  14   -6    1
7:    5  -8  -1   20 -29   20   -7    1
8:   -6  13  -7  -21  49  -49   27   -8     1
9:    7 -19  20   14 -70   98  -76   35    -9    1
10:  -8  26 -39    6  84 -168  174 -111    44  -10    1
11:   9 -34  65  -45 -78  252 -342  285  -155   54  -11   1
12: -10  43 -99  110  33 -330  594 -627   440 -209   65 -12   1
13:  11 -53 142 -209  77  363 -924 1221 -1067  649 -274  77 -13  1
... Reformatted and extended - _Wolfdieter Lang_, Oct 04 2014
-----------------------------------------------------------------------
Recurrence for T(n, 0) with row n-1 entries from Z-sequence (see a link given above): 3 = T(5, 0) = -(1*(-2) + 1*(-1) + 1*5 + 2*(-4) + 3*1) = 3.
		

Crossrefs

Cf. A105809, A105811, A105812, A248155 (alternating row sum). - Wolfdieter Lang, Oct 04 2014

Programs

  • Maple
    C := proc (n, k) if 0 <= k and k <= n then factorial(n)/(factorial(k)*factorial(n-k)) else 0 end if
    end proc:
    for n from 0 to 10 do
        seq((-1)^(n+k)*(C(n, n-k) - add(C(n-i, n-k-i), i = 2..n)), k = 0..n);
    end do; # Peter Bala, Mar 21 2018

Formula

Riordan array ((1+x-x^2)/(1+x)^2, x/(1+x)); Number triangle T(n, 0)=A105811(n), T(n, m)=-T(n-1, m-1)+T(n-1, m).
From Wolfdieter Lang, Oct 04 2014: (Start)
O.g.f. for row polynomials R(n,x) = sum(T(n,m)*x^m,m=0..n): (1 + z - z^2)/((1+z)*(1+(1-x)*z)) (Riordan property).
O.g.f. column m: x^m*(1 + x - x^2)/(1 + x)^(m+2), m >= 0.
The A-sequence of this Riordan triangle is [1, -1]. See the above given recurrence for T(n,m) for n>=1. The Z-sequence has o.g.f. -(1 - x^2)/(1 - x - x^2) and is -A132916(n+5) = -[1, 1, 1, 2, 3, 5, 8, 13, 21, 34,...]. See the W. Lang link under A006232 for Riordan A- and Z-sequences. (End)
T(n,k) = (-1)^(n+k)*(C(n, n-k) - Sum_{i = 2..n} C(n-i, n-k-i)), where C(n,k) = n!/(k!*(n-k)!) for 0 <= k <= n, otherwise 0. - Peter Bala, Mar 21 2018
Showing 1-2 of 2 results.