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

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

Original entry on oeis.org

0, 1, 1, 4, 5, 9, 16, 25, 41, 68, 109, 177, 288, 465, 753, 1220, 1973, 3193, 5168, 8361, 13529, 21892, 35421, 57313, 92736, 150049, 242785, 392836, 635621, 1028457, 1664080, 2692537, 4356617, 7049156, 11405773, 18454929, 29860704, 48315633, 78176337, 126491972, 204668309, 331160281, 535828592
Offset: 0

Views

Author

Waldemar Puszkarz, Mar 12 2015

Keywords

Comments

This is a minimally modified Fibonacci sequence (A000045) in that it preserves characteristic properties of the original sequence: a(n) is a function of the sum of the preceding two terms, the ratio of two consecutive terms tends to the Golden Mean, and the initial two terms are the same as in the Fibonacci sequence. See A253197 and A253198 for other members of this family.

Examples

			For n = 2, a(2) = 0 + 1 + (1 + (-1)^(0 + 1)) = 1.
For n = 3, a(3) = 1 + 1 + (1 + (-1)^(1 + 1)) = 4.
For n = 4, a(4) = 1 + 4 + (1 + (-1)^(1 + 4)) = 5.
For n = 5, a(5) = 4 + 5 + (1 + (-1)^(4 + 5)) = 9.
		

Crossrefs

Programs

  • Magma
    [n le 2 select (n-1) else Self(n-1)+Self(n-2)+(1+(-1)^(Self(n-1)+Self(n-2))): n in [1..45] ]; // Vincenzo Librandi, Mar 24 2015
  • Mathematica
    RecurrenceTable[{a[n]==a[n-1]+a[n-2] +(1+(-1)^(a[n-1]+a[n-2])), a[0]==0, a[1]==1}, a, {n, 0, 50}]
    CoefficientList[Series[x (1 + 2 x^2 - x^3) / ((1 - x) (1 + x + x^2) (1 - x - x^2)), {x, 0, 70}], x] (* Vincenzo Librandi, Mar 24 2015 *)
    LinearRecurrence[{1,1,1,-1,-1},{0,1,1,4,5},50] (* Harvey P. Dale, Mar 26 2019 *)
  • PARI
    concat(0, Vec(x*(1+2*x^2-x^3)/((1-x)*(1+x+x^2)*(1-x-x^2)) + O(x^30))) \\ Michel Marcus, Mar 23 2015
    

Formula

a(n) = a(n-1) + a(n-2) + (1 + (-1)^(a(n-1) + a(n-2))), a(0)=0, a(1)=1.
G.f.: x*(1+2*x^2-x^3)/((1-x)*(1+x+x^2)*(1-x-x^2)). - Joerg Arndt, Mar 16 2015
a(n) = a(n-1) + a(n-2) + a(n-3) - a(n-4) - a(n-5) for n>4. - Colin Barker, Mar 28 2015
a(n) = 2*Fibonacci(n) - (1 if n != 0 (mod 3)). - Nicolas Bělohoubek, Sep 29 2021

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

Original entry on oeis.org

0, 1, 2, 4, 5, 10, 16, 25, 42, 68, 109, 178, 288, 465, 754, 1220, 1973, 3194, 5168, 8361, 13530, 21892, 35421, 57314, 92736, 150049, 242786, 392836, 635621, 1028458, 1664080, 2692537, 4356618, 7049156, 11405773, 18454930, 29860704, 48315633, 78176338, 126491972, 204668309, 331160282, 535828592
Offset: 0

Views

Author

Waldemar Puszkarz, Mar 24 2015

Keywords

Comments

This is a minimally modified Fibonacci sequence (A000045) in that it preserves characteristic properties of the original sequence: a(n) is a function of the sum of the preceding two terms, the ratio of two consecutive terms tends to the Golden Mean, and the initial two terms are the same as in the Fibonacci sequence. See A253197 and A255978 for other members of this family.

Examples

			For n=2, a(2) = 0 + 1 - (-1)^1 = 0 + 1 + 1 = 2.
For n=3, a(3) = 1 + 2 - (-1)^3 = 1 + 2 + 1 = 4.
For n=4, a(4) = 2 + 4 - (-1)^6 = 2 + 4 - 1 = 5.
		

Crossrefs

Programs

  • Magma
    [n le 2 select (n-1) else Self(n-1) + Self(n-2) - (-1)^(Self(n-1) + Self(n-2)): n in [1..50] ]; // Vincenzo Librandi, Mar 28 2015
    
  • Mathematica
    RecurrenceTable[{a[n]==a[n-1]+a[n-2] -(-1)^(a[n-1]+a[n-2]), a[0]==0, a[1]==1}, a, {n, 0, 50}]
    LinearRecurrence[{1,1,1,-1,-1},{0,1,2,4,5},50] (* Harvey P. Dale, Mar 17 2019 *)
  • PARI
    concat(0, Vec(-x*(2*x^3-x^2-x-1)/((x-1)*(x^2+x-1)*(x^2+x+1)) + O(x^100))) \\ Colin Barker, Mar 28 2015

Formula

a(n) = a(n-1) + a(n-2) - (-1)^(a(n-1) + a(n-2)), a(0)=0, a(1)=1.
a(n) = a(n-1) + a(n-2) + a(n-3) - a(n-4) - a(n-5) for n>4. - Colin Barker, Mar 28 2015
G.f.: -x*(2*x^3-x^2-x-1) / ((x-1)*(x^2+x-1)*(x^2+x+1)). - Colin Barker, Mar 28 2015
a(n) = 2*A000045(n) - A079978(n+2). - Nicolas Bělohoubek, Aug 16 2021

A258318 Number of distinct numbers in rows 0 through n of triangle A258197.

Original entry on oeis.org

1, 1, 2, 2, 4, 5, 7, 9, 12, 16, 20, 24, 29, 34, 41, 44, 50, 57, 66, 74, 83, 91, 102, 112, 124, 135, 148, 161, 174, 187, 201, 214, 230, 246, 263, 279, 296, 313, 331, 349, 369, 388, 408, 428, 450, 471, 494, 516, 540, 563, 588, 612, 637, 662, 689, 715, 741, 769
Offset: 0

Views

Author

Reinhard Zumkeller, May 26 2015

Keywords

Crossrefs

Programs

  • Haskell
    import Data.Set (singleton, insert, size)
    a258318 n = a258318_list !! n
    a258318_list = f 2 a258197_tabl $ singleton 0 where
       f k (xs:xss) zs = g (take (div k 2) xs) zs where
         g []     ys = size ys : f (k + 1) xss ys
         g (x:xs) ys = g xs (insert x ys)
Showing 1-3 of 3 results.