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

A027383 a(2*n) = 3*2^n - 2; a(2*n+1) = 2^(n+2) - 2.

Original entry on oeis.org

1, 2, 4, 6, 10, 14, 22, 30, 46, 62, 94, 126, 190, 254, 382, 510, 766, 1022, 1534, 2046, 3070, 4094, 6142, 8190, 12286, 16382, 24574, 32766, 49150, 65534, 98302, 131070, 196606, 262142, 393214, 524286, 786430, 1048574, 1572862, 2097150, 3145726, 4194302, 6291454
Offset: 0

Views

Author

Keywords

Comments

Number of balanced strings of length n: let d(S) = #(1's) - #(0's), # == count in S, then S is balanced if every substring T of S has -2 <= d(T) <= 2.
Number of "fold lines" seen when a rectangular piece of paper is folded n+1 times along alternate orthogonal directions and then unfolded. - Quim Castellsaguer (qcastell(AT)pie.xtec.es), Dec 30 1999
Also the number of binary strings with the property that, when scanning from left to right, once the first 1 is seen in position j, there must be a 1 in positions j+2, j+4, ... until the end of the string. (Positions j+1, j+3, ... can be occupied by 0 or 1.) - Jeffrey Shallit, Sep 02 2002
a(n-1) is also the Moore lower bound on the order of a (3,n)-cage. - Eric W. Weisstein, May 20 2003 and Jason Kimberley, Oct 30 2011
Partial sums of A016116. - Hieronymus Fischer, Sep 15 2007
Equals row sums of triangle A152201. - Gary W. Adamson, Nov 29 2008
From John P. McSorley, Sep 28 2010: (Start)
a(n) = DPE(n+1) is the total number of k-double-palindromes of n up to cyclic equivalence. See sequence A180918 for the definitions of a k-double-palindrome of n and of cyclic equivalence. Sequence A180918 is the 'DPE(n,k)' triangle read by rows where DPE(n,k) is the number of k-double-palindromes of n up to cyclic equivalence. For example, we have a(4) = DPE(5) = DPE(5,1) + DPE(5,2) + DPE(5,3) + DPE(5,4) + DPE(5,5) = 0 + 2 + 2 + 1 + 1 = 6.
The 6 double-palindromes of 5 up to cyclic equivalence are 14, 23, 113, 122, 1112, 11111. They come from cyclic equivalence classes {14,41}, {23,32}, {113,311,131}, {122,212,221}, {1112,2111,1211,1121}, and {11111}. Hence a(n)=DPE(n+1) is the total number of cyclic equivalence classes of n containing at least one double-palindrome.
(End)
From Herbert Eberle, Oct 02 2015: (Start)
For n > 0, there is a red-black tree of height n with a(n-1) internal nodes and none with less.
In order a red-black tree of given height has minimal number of nodes, it has exactly 1 path with strictly alternating red and black nodes. All nodes outside this height defining path are black.
Consider:
mrbt5 R
/ \
/ \
/ \
/ B
/ / \
mrbt4 B / B
/ \ B E E
/ B E E
mrbt3 R E E
/ \
/ B
mrbt2 B E E
/ E
mrbt1 R
E E
(Red nodes shown as R, blacks as B, externals as E.)
Red-black trees mrbt1, mrbt2, mrbt3, mrbt4, mrbt5 of respective heights h = 1, 2, 3, 4, 5; all minimal in the number of internal nodes, namely 1, 2, 4, 6, 10.
Recursion (let n = h-1): a(-1) = 0, a(n) = a(n-1) + 2^floor(n/2), n >= 0.
(End)
Also the number of strings of length n with the digits 1 and 2 with the property that the sum of the digits of all substrings of uneven length is not divisible by 3. An example with length 8 is 21221121. - Herbert Kociemba, Apr 29 2017
a(n-2) is the number of achiral n-bead necklaces or bracelets using exactly two colors. For n=4, the four arrangements are AAAB, AABB, ABAB, and ABBB. - Robert A. Russell, Sep 26 2018
Partial sums of powers of 2 repeated 2 times, like A200672 where is 3 times. - Yuchun Ji, Nov 16 2018
Also the number of binary words of length n with cuts-resistance <= 2, where, for the operation of shortening all runs by one, cuts-resistance is the number of applications required to reach an empty word. Explicitly, these are words whose sequence of run-lengths, all of which are 1 or 2, has no odd-length run of 1's sandwiched between two 2's. - Gus Wiseman, Nov 28 2019
Also the number of up-down paths with n steps such that the height difference between the highest and lowest points is at most 2. - Jeremy Dover, Jun 17 2020
Also the number of non-singleton integer compositions of n + 2 with no odd part other than the first or last. Including singletons gives A052955. This is an unsorted (or ordered) version of A351003. The version without even (instead of odd) interior parts is A001911, complement A232580. Note that A000045(n-1) counts compositions without odd parts, with non-singleton case A077896, and A052952/A074331 count non-singleton compositions without even parts. Also the number of compositions y of n + 1 such that y_i = y_{i+1} for all even i. - Gus Wiseman, Feb 19 2022

Examples

			After 3 folds one sees 4 fold lines.
Example: a(3) = 6 because the strings 001, 010, 100, 011, 101, 110 have the property.
Binary: 1, 10, 100, 110, 1010, 1110, 10110, 11110, 101110, 111110, 1011110, 1111110, 10111110, 11111110, 101111110, 111111110, 1011111110, 1111111110, 10111111110, ... - _Jason Kimberley_, Nov 02 2011
Example: Partial sums of powers of 2 repeated 2 times:
a(3) = 1+1+2 = 4;
a(4) = 1+1+2+2 = 6;
a(5) = 1+1+2+2+4 = 10.
_Yuchun Ji_, Nov 16 2018
		

References

  • John P. McSorley: Counting k-compositions of n with palindromic and related structures. Preprint, 2010. [John P. McSorley, Sep 28 2010]

Crossrefs

Moore lower bound on the order of a (k,g) cage: A198300 (square); rows: A000027 (k=2), this sequence (k=3), A062318 (k=4), A061547 (k=5), A198306 (k=6), A198307 (k=7), A198308 (k=8), A198309 (k=9), A198310 (k=10), A094626 (k=11); columns: A020725 (g=3), A005843 (g=4), A002522 (g=5), A051890 (g=6), A188377 (g=7). - Jason Kimberley, Oct 30 2011
Cf. A000066 (actual order of a (3,g)-cage).
Bisections are A033484 (even) and A000918 (odd).
a(n) = A305540(n+2,2), the second column of the triangle.
Numbers whose binary expansion is a balanced word are A330029.
Binary words counted by cuts-resistance are A319421 or A329860.
The complementary compositions are counted by A274230(n-1) + 1, with bisections A060867 (even) and A134057 (odd).
Cf. A000346, A000984, A001405, A001700, A011782 (compositions).
The following sequences are all essentially the same, in the sense that they are simple transformations of each other, with A029744 = {s(n), n>=1}, the numbers 2^k and 3*2^k, as the parent: A029744 (s(n)); A052955 (s(n)-1), A027383 (s(n)-2), A354788 (s(n)-3), A347789 (s(n)-4), A209721 (s(n)+1), A209722 (s(n)+2), A343177 (s(n)+3), A209723 (s(n)+4); A060482, A136252 (minor differences from A354788 at the start); A354785 (3*s(n)), A354789 (3*s(n)-7). The first differences of A029744 are 1,1,1,2,2,4,4,8,8,... which essentially matches eight sequences: A016116, A060546, A117575, A131572, A152166, A158780, A163403, A320770. The bisections of A029744 are A000079 and A007283. - N. J. A. Sloane, Jul 14 2022

Programs

  • Haskell
    import Data.List (transpose)
    a027383 n = a027383_list !! n
    a027383_list = concat $ transpose [a033484_list, drop 2 a000918_list]
    -- Reinhard Zumkeller, Jun 17 2015
    
  • Magma
    [2^Floor((n+2)/2)+2^Floor((n+1)/2)-2: n in [0..50]]; // Vincenzo Librandi, Aug 16 2011
    
  • Maple
    a[0]:=0:a[1]:=1:for n from 2 to 100 do a[n]:=2*a[n-2]+2 od: seq(a[n], n=1..41); # Zerinvary Lajos, Mar 16 2008
  • Mathematica
    a[n_?EvenQ] := 3*2^(n/2)-2; a[n_?OddQ] := 2^(2+(n-1)/2)-2; Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Oct 21 2011, after Quim Castellsaguer *)
    LinearRecurrence[{1, 2, -2}, {1, 2, 4}, 41] (* Robert G. Wilson v, Oct 06 2014 *)
    Table[Length[Select[Tuples[{0,1},n],And[Max@@Length/@Split[#]<=2,!MatchQ[Length/@Split[#],{_,2,ins:1..,2,_}/;OddQ[Plus[ins]]]]&]],{n,0,15}] (* Gus Wiseman, Nov 28 2019 *)
  • PARI
    a(n)=2^(n\2+1)+2^((n+1)\2)-2 \\ Charles R Greathouse IV, Oct 21 2011
    
  • Python
    def a(n): return 2**((n+2)//2) + 2**((n+1)//2) - 2
    print([a(n) for n in range(43)]) # Michael S. Branicky, Feb 19 2022

Formula

a(0)=1, a(1)=2; thereafter a(n+2) = 2*a(n) + 2.
a(2n) = 3*2^n - 2 = A033484(n);
a(2n-1) = 2^(n+1) - 2 = A000918(n+1).
G.f.: (1 + x)/((1 - x)*(1 - 2*x^2)). - David Callan, Jul 22 2008
a(n) = Sum_{k=0..n} 2^min(k, n-k).
a(n) = 2^floor((n+2)/2) + 2^floor((n+1)/2) - 2. - Quim Castellsaguer (qcastell(AT)pie.xtec.es)
a(n) = 2^(n/2)*(3 + 2*sqrt(2) + (3-2*sqrt(2))*(-1)^n)/2 - 2. - Paul Barry, Apr 23 2004
a(n) = A132340(A052955(n)). - Reinhard Zumkeller, Aug 20 2007
a(n) = A052955(n+1) - 1. - Hieronymus Fischer, Sep 15 2007
a(n) = A132666(a(n+1)) - 1. - Hieronymus Fischer, Sep 15 2007
a(n) = A132666(a(n-1)+1) for n > 0. - Hieronymus Fischer, Sep 15 2007
A132666(a(n)) = a(n-1) + 1 for n > 0. - Hieronymus Fischer, Sep 15 2007
G.f.: (1 + x)/((1 - x)*(1 - 2*x^2)). - David Callan, Jul 22 2008
a(n) = 2*( (a(n-2)+1) mod (a(n-1)+1) ), n > 1. - Pierre Charland, Dec 12 2010
a(n) = A136252(n-1) + 1, for n > 0. - Jason Kimberley, Nov 01 2011
G.f.: (1+x*R(0))/(1-x), where R(k) = 1 + 2*x/( 1 - x/(x + 1/R(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Aug 16 2013
a(n) = 2^((2*n + 3*(1-(-1)^n))/4)*3^((1+(-1)^n)/2) - 2. - Luce ETIENNE, Sep 01 2014
a(n) = a(n-1) + 2^floor((n-1)/2) for n>0, a(0)=1. - Yuchun Ji, Nov 23 2018
E.g.f.: 3*cosh(sqrt(2)*x) - 2*cosh(x) + 2*sqrt(2)*sinh(sqrt(2)*x) - 2*sinh(x). - Stefano Spezia, Apr 06 2022

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Mar 24 2000
Replaced definition with a simpler one. - N. J. A. Sloane, Jul 09 2022

A014217 a(n) = floor(phi^n), where phi = (1+sqrt(5))/2 is the golden ratio.

Original entry on oeis.org

1, 1, 2, 4, 6, 11, 17, 29, 46, 76, 122, 199, 321, 521, 842, 1364, 2206, 3571, 5777, 9349, 15126, 24476, 39602, 64079, 103681, 167761, 271442, 439204, 710646, 1149851, 1860497, 3010349, 4870846, 7881196, 12752042, 20633239, 33385281, 54018521, 87403802
Offset: 0

Views

Author

Keywords

Comments

a(n) = floor(lim_{k->oo} Fibonacci(k)/Fibonacci(k-n)). - Jon Perry, Jun 10 2003
For n > 1, a(n) is the maximum element in the continued fraction for A000045(n)*phi. - Benoit Cloitre, Jun 19 2005
a(n) is also the curvature (rounded down) of the circle inscribed in the n-th kite arranged in a spiral, starting with a unit circle, as shown in the illustration in the links section. - Kival Ngaokrajang, Aug 29 2013
a(n) is the n-th Lucas number (A000032) if n is odd, and a(n) is the n-th Lucas number minus 1 if n is even. (Mario Catalani's formula below expresses this fact.) This is related to the fact that the powers of phi approach the values of the Lucas numbers, the odd powers from above and the even powers from below. - Geoffrey Caveney, Apr 18 2014
a(n) is the sum of the last summands over all Arndt compositions of n (see the Checa link). - Daniel Checa, Dec 25 2023
a(n) is the number of (saturated or unsaturated) substituted N-heterocycles in chemistry (N = nitrogen). That means the number of matchings in a cycle graph when the two maximum matchings in every cycle with an even number of vertices are indistinguishable (because the corresponding resonance structures in the molecule are equivalent). - Stefan Schuster, Mar 20 2025

Crossrefs

Programs

  • Haskell
    a014217 n = a014217_list !! n
    a014217_list = 1 : 1 : zipWith (+)
       a000035_list (zipWith (+) a014217_list $ tail a014217_list)
    -- Reinhard Zumkeller, Jan 06 2012
    
  • Magma
    [Floor( ((1+Sqrt(5))/2)^n ): n in [0..100]]; // Vincenzo Librandi, Apr 16 2011
    
  • Maple
    A014217 := proc(n)
        option remember;
        if n <= 3 then
            op(n+1,[1,1,2,4]) ;
        else
            procname(n-1)+2*procname(n-2)-procname(n-3)-procname(n-4) ;
        end if;
    end proc: # R. J. Mathar, Jun 23 2013
    #
    a:= n-> (<<0|1|0|0>, <0|0|1|0>, <0|0|0|1>, <-1|-1|2|1>>^n. <<1, 1, 2, 4>>)[1, 1]:
    seq(a(n), n=0..40);  # Alois P. Heinz, Oct 12 2017
  • Mathematica
    Table[Floor[GoldenRatio^n], {n, 0, 36}] (* Vladimir Joseph Stephan Orlovsky, Dec 12 2008 *)
    LinearRecurrence[{1, 2, -1, -1}, {1, 1, 2, 4}, 40] (* Jean-François Alcover, Nov 05 2017 *)
  • PARI
    my(x='x+O('x^44)); Vec((1-x^2+x^3)/((1+x)*(1-x)*(1-x-x^2))) \\ Joerg Arndt, Jul 10 2023
    
  • Python
    from sympy import floor, sqrt
    def A014217(n): return floor(((1+sqrt(5))/2)**n) # Chai Wah Wu, Dec 17 2021
  • Sage
    [floor(golden_ratio^n) for n in range(37)] # Danny Rorabaugh, Apr 19 2015
    

Formula

a(n) = a(n-1) + 2*a(n-2) - a(n-3) - a(n-4).
a(n) = a(n-1) + a(n-2) + (1-(-1)^n)/2 = a(n-1) + a(n-2) + A000035(n).
a(n) = A000032(n) - (1 + (-1)^n)/2. - Mario Catalani (mario.catalani(AT)unito.it), Jan 17 2003
G.f.: (1-x^2+x^3)/((1+x)*(1-x)*(1-x-x^2)). - R. J. Mathar, Sep 06 2008
a(2n-1) = (Fibonacci(4n+1)-2)/Fibonacci(2n+2). - Gary Detlefs, Feb 16 2011
a(n) = floor(Fibonacci(2n+3)/Fibonacci(n+3)). - Gary Detlefs, Feb 28 2011
a(2n) = Fibonacci(2*n-1) + Fibonacci(2*n+1) - 1. - Gary Detlefs, Mar 10 2011
a(n+2*k) - a(n) = A203976(k)*A000032(n+k) if k odd, a(n+2*k) - a(n) = A203976(k)*A000045(n+k) if k even, for k > 0. - Paul Curtz, Jun 05 2013
a(n) = A052952(n) - A052952(n-2) + A052952(n-3). - R. J. Mathar, Jun 13 2013
a(n+6) - a(n-6) = 40*A000045(n), case k=6 of my formula above. - Paul Curtz, Jun 13 2013
From Paul Curtz, Jun 17 2013: (Start)
a(n-3) + a(n+3) = A153382(n).
a(n-1) + a(n+2) = A022319(n). (End)
For k > 0, a(2k) = A169985(2k)-1 and a(2k+1) = A169985(2k+1) (which is equivalent to Catalani's 2003 formula). - Danny Rorabaugh, Apr 15 2015
a(n) = ((-1)^(1+n)-1)/2 + ((1-sqrt(5))/2)^n + ((1+sqrt(5))/2)^n. - Colin Barker, Nov 05 2017
a(n) = floor(2*sinh(n*arccsch(2))). - Federico Provvedi, Feb 23 2022
E.g.f.: 2*exp(x/2)*cosh(sqrt(5)*x/2) - cosh(x). - Stefano Spezia, Jul 26 2022
a(n) = floor(Fibonacci(n)*phi) + Fibonacci(n-1) = A074331(n) + A000045(n-1) = A052952(n-1) + A000045(n-1). This is the case k=1 of the formula (also found in A128440): floor(k * phi^n) = floor(Fibonacci(n)*k*phi) + Fibonacci(n-1) * k. - Chunqing Liu, Oct 03 2023

Extensions

Corrected by T. D. Noe, Nov 09 2006
Edited by N. J. A. Sloane, Aug 29 2008 at the suggestion of R. J. Mathar

A052952 a(n) = Fibonacci(n+2) - (1-(-1)^n)/2.

Original entry on oeis.org

1, 1, 3, 4, 8, 12, 21, 33, 55, 88, 144, 232, 377, 609, 987, 1596, 2584, 4180, 6765, 10945, 17711, 28656, 46368, 75024, 121393, 196417, 317811, 514228, 832040, 1346268, 2178309, 3524577, 5702887, 9227464, 14930352, 24157816, 39088169, 63245985, 102334155
Offset: 0

Views

Author

encyclopedia(AT)pommard.inria.fr, Jan 25 2000

Keywords

Comments

Equals row sums of triangle A173284. - Gary W. Adamson, Feb 14 2010
The Kn21 sums (see A180662 for definition) of the 'Races with Ties' triangle A035317 produce this sequence. - Johannes W. Meijer, Jul 20 2011
a(n-1), for n >= 1, gives the number of compositions of n with relative prime parts, and parts not exceeding 2. See the row sums of triangle A030528 where for even n the leading 1 is missing. - Wolfdieter Lang, Jul 27 2023

Examples

			G.f. = 1 + x + 3*x^2 + 4*x^3 + 8*x^4 + 12*x^5 + 21*x^6 + 33*x^7 + ...
		

Crossrefs

Partial sums of A008346, first differences of A129696.
Cf. also A000032, A000045, A030528.

Programs

  • GAP
    List([0..40], n-> Fibonacci(n+2) -(1-(-1)^n)/2); # G. C. Greubel, Jul 10 2019
  • Haskell
    a052952 n = a052952_list !! n
    a052952_list = 1 : 1 : zipWith (+)
       a059841_list (zipWith (+) a052952_list $ tail a052952_list)
    -- Reinhard Zumkeller, Jan 06 2012
    
  • Magma
    [Fibonacci(n+2)-(1-(-1)^n)/2: n in [0..40]]; // Vincenzo Librandi, Dec 02 2016
    
  • Maple
    A052952 :=proc(n)
        option remember;
        local t1;
        if n <= 1 then
            return 1 ;
        fi:
        if n mod 2 = 1 then
            t1:=0
        else
            t1:=1;
        fi:
        procname(n-1)+procname(n-2)+t1;
    end proc;
    seq(A052952(n), n=0..40) ; # N. J. A. Sloane, May 25 2008
  • Mathematica
    Table[Fibonacci[n+2] -(1-(-1)^n)/2, {n, 0, 40}] (* Vincenzo Librandi, Dec 02 2016 *)
    Sum[(-1)^k*Fibonacci[Range[2,41], 1-k], {k,0,1}] (* G. C. Greubel, Oct 21 2019 *)
    CoefficientList[Series[1/((1-x-x^2)*(1-x^2)),{x,0,40}],x] (* Harvey P. Dale, Sep 12 2020 *)
  • PARI
    {a(n) = fibonacci(n+2) - n%2};
    
  • Sage
    [fibonacci(n+2) -(1-(-1)^n)/2 for n in (0..40)] # G. C. Greubel, Jul 10 2019
    

Formula

G.f.: 1/((1-x-x^2)*(1-x^2)).
a(n) = A074331(n+1).
a(n) = A054450(n+1, 1) (second column of triangle).
a(n) = 2*a(n-2) + a(n-3) + 1, with a(0)=1, a(1)=1, a(2)=3.
a(n) = Sum_{alpha=RootOf(-1+z+z^2)} (3+alpha)*alpha^(-1-n)/3 - Sum_{beta=RootOf(-1+z^2)} beta^(-1-n)/2.
a(2*k) = Sum_{j=0..k} F(2*j+1) = F(2*(k+1)) for k >= 0; a(2*k-1) = Sum_{j=0..k} F(2*j) = F(2*k+1)-1 for k >= 1 (F = A000045, Fibonacci numbers).
a(n) = a(n-1) + a(n-2) + (1+(-1)^n)/2.
a(n) = Sum_{k=0..floor(n/2)} binomial(n-k+1, k). - Paul Barry, Oct 23 2004
a(n) = floor(phi^(n+2) / sqrt(5)), where phi is the golden ratio: phi = (1+sqrt(5))/2. - Reinhard Zumkeller, Apr 19 2005
a(n) = Fibonacci(n+1) + a(n-2) with n>1, a(0)=a(1)=1. - Zerinvary Lajos, Mar 17 2008
a(n) = floor(Fibonacci(n+3)^2/Fibonacci(n+4)). - Gary Detlefs, Nov 29 2010
a(n) = (A001595(n+3) - A066983(n+4))/2. - Gary Detlefs, Dec 19 2010
a(4*n) = F(4*n+2); a(4*n+1) = F(4*n+3) - 1; a(4*n+2) = F(4*n+4); a(4*n+3) = F(4*n+5) - 1. - Johannes W. Meijer, Jul 20 2011
a(n+1) = a(n) + a(n-1) + A059841(n+1). - Reinhard Zumkeller, Jan 06 2012
a(n) = floor(|F((1+i)*(n+2))|), n >= 0, with the complex Fibonacci function F: C -> C, z -> F(z) with F(z) := (exp(log(phi)*z) - exp(i*Pi*z)*exp(-log(phi)*z))/(2*phi-1) with the modulus |z|, the imaginary unit i and the golden section phi:=(1+sqrt(5))/2. A Conjecture: For F(z) see, e.g., the T. Koshy reference. ch. 45, p. 523, where F is called f, given in A000045. - Wolfdieter Lang, Jul 24 2012
5*a(n) = (L(n+3)-1)*(L(n+4)+3) -14 -Sum_{k=0..n} L(k+1)*L(k+5) = (L(n+3)-1)*(L(n+4)+3) -L(2*n+7) +A168309(n), where L=A000032. - J. M. Bergot, Jun 13 2014
a(n) = floor(phi*Fibonacci(n+1)), where phi is the golden section. - Michel Dekking, Dec 02 2016
a(n) = -(-1)^n * a(-4-n) for all n in Z. - Michael Somos, Dec 03 2016
a(n) = Sum_{k=0..n} Sum_{i=0..n} C(n-k-1,k-i). - Wesley Ivan Hurt, Sep 21 2017
a(n) = floor(1/(Sum_{k>=n+4} 1/Fibonacci(k))) [Ohtsuka and Nakamura]. - Michel Marcus, Aug 09 2018
a(n) = floor(abs(chebyshevU(n/2, 3/2))). - Federico Provvedi, Feb 23 2022
E.g.f.: exp(x/2)*(5*cosh(sqrt(5)*x/2) + 3*sqrt(5)*sinh(sqrt(5)*x/2))/5 - sinh(x). - Stefano Spezia, Mar 09 2024

Extensions

Additional formulas and more terms from Wolfdieter Lang, May 02 2000
Better description from Olivier Gérard, Jun 05 2001

A001350 Associated Mersenne numbers.

Original entry on oeis.org

0, 1, 1, 4, 5, 11, 16, 29, 45, 76, 121, 199, 320, 521, 841, 1364, 2205, 3571, 5776, 9349, 15125, 24476, 39601, 64079, 103680, 167761, 271441, 439204, 710645, 1149851, 1860496, 3010349, 4870845, 7881196, 12752041, 20633239, 33385280, 54018521, 87403801, 141422324
Offset: 0

Views

Author

Keywords

Comments

a(n) is last term in the period of the continued fraction expansion of phi^n (phi being the golden number). E.g.: n=10, phi^10=[122,1,121,1,121,1,121,...] (and the period may only have 1 or 2 terms). Also, a(n) = floor(phi^n)-((n+1) mod 2), or a(n) = A014217(n)-((n+1) mod 2). - Thomas Baruchel, Nov 05 2002 [continued fraction value corrected by Jon E. Schoenfield, Jan 20 2019]
a(n) is the resultant of the polynomials x^2-x-1 and x^(n+1)-x^n-1 for n >= 1. - Richard Choulet, Aug 05 2007
This is a divisibility sequence; that is, if n divides m, then a(n) divides a(m). - Michael Somos, Feb 12 2012
Gives the number of arrangements of black and white beads on a necklace with a total of n beads satisfying (1) there is at least one black bead (2) between any two black beads the number of white beads is even and (3) rotations and flippings of a necklace are considered distinct (see Butler). - Peter Bala, Mar 06 2014
This is the case P1 = 1, P2 = 0, Q = -1 of the 3-parameter family of 4th-order linear divisibility sequences found by Williams and Guy. - Peter Bala, Mar 31 2014
The resultant of the (s_2, s_2+n) pair, where s_n(X) is X^n-X-1, is -a(n). See Rush link. - Michel Marcus, Sep 30 2019

Examples

			G.f. = x + x^2 + 4*x^3 + 5*x^4 + 11*x^5 + 16*x^6 + 29*x^7 + 45*x^8 + 76*x^9 + ...
n=1: a(9)/a(3) = 76/4 = 19; a(18)/a(6) = 5776/16 = 361 = 19^2. - _Bob Selcoe_, Jun 01 2014
		

References

  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Magma
    [Floor(-(1 - ((1 + Sqrt(5))/2)^n - (-(1 + Sqrt(5))/2)^(-n) + (-1)^n)): n in [0..40]]; // Vincenzo Librandi, Aug 15 2011
    
  • Maple
    A001350 := n -> add(binomial(k-1, 2*k-n)*n/(n-k), k=0..n-1);
    seq(A001350(n), n=0..39); # Peter Luschny, Sep 26 2014
  • Mathematica
    Clear[f, n]; f[n_] = -(1 - ((1 + Sqrt[5])/2)^n - (-(1 + Sqrt[5])/2)^(-n) + (-1)^n); Table[FullSimplify[ExpandAll[f[n]]], {n, 0, 30}] (* Roger L. Bagula and Gary W. Adamson, Nov 26 2008 *)
    a[ n_] := LucasL[n] - 1 - (-1)^n; (* Michael Somos, May 18 2015 *)
    a[ n_] := SeriesCoefficient[ x D[ Log[ 1 + x / (1 - x - x^2)], x], {x, 0, n}]; (* Michael Somos, May 18 2015 *)
    LinearRecurrence[{1, 2, -1, -1}, {0, 1, 1, 4}, 40] (* Jean-François Alcover, Jan 07 2019 *)
  • PARI
    {a(n) = fibonacci(n+1) + fibonacci(n-1) - 1 - (-1)^n};
    
  • PARI
    {a(n) = my(w = quadgen(5)); simplify( -(w^n - 1) * ((-1/w)^n - 1))}; /* Michael Somos, Feb 12 2012 */
    
  • Python
    from sympy import lucas
    def A001350(n): return lucas(n)-((n&1^1)<<1) # Chai Wah Wu, Sep 23 2023

Formula

G.f.: x*(1+x^2)/((1-x^2)*(1-x-x^2)). - Simon Plouffe in his 1992 dissertation
a(n) = a(n-1) + a(n-2) + 1 -(-1)^n. a(-n) = (-1)^n * a(n).
a(n) = A050140(Fibonacci(n)). - Thomas Baruchel, Nov 05 2002
Convolution of F(n) and {1, 0, 2, 0, 2, ...}. a(n) = Sum_{k=0..n} ((1+(-1)^k)-0^k)*F(n-k) = Sum_{k=0..n} F(k)*((1+(-1)^(n-k))-0^(n-k)). - Paul Barry, Jul 19 2004
a(n) = 2*A074331(n) - A000045(n). - Paul Barry, Jul 19 2004
a(n) = Lucas_number(n) - 1 - (-1)^n = A000032(n) - 1 - (-1)^n. - Hieronymus Fischer, Feb 18 2006
a(n) = -(1 - ((1 + sqrt(5))/2)^n - (-(1 + sqrt(5))/2)^(-n) + (-1)^n). - Roger L. Bagula and Gary W. Adamson, Nov 26 2008
a(n) = n * Sum_{k=1..n} (Sum_{i=ceiling((n-k)/2)..(n-k)} (binomial(i,n-k-i)*binomial(k+i-1,k-1))/k*(-1)^(k+1)), n>0. - Vladimir Kruchinin, Sep 03 2010
a(n) = a(n-1) + 2*a(n-2) - a(n-3) - a(n-4). - Colin Barker, Apr 11 2014
a(n) = sqrt(A152152(n)). - Colin Barker, Apr 11 2014
a(n) = a(2*n)/A000032(n) when n is odd; a(n) = a(2*n)/(A000032(n+2)) when n is even. - Bob Selcoe, Jun 01 2014
a(12n+6)/a(4n+2) = (a(6n+3)/a(2n+1))^2. - Bob Selcoe, Jun 01 2014
a(n) = Sum_{k=0..n-1} binomial(k-1, 2*k-n)*n/(n-k). - Peter Luschny, Sep 26 2014
From Peter Bala, Mar 19 2015: (Start)
a(n) = -(alpha^n - 1)*(beta^n - 1), where alpha = 1/2*(1 + sqrt(5)) and beta = (1/2)*(1 - sqrt(5)).
a(n) = -det(I - M^n) where I is the 2 X 2 identity matrix and M = [ 1, 1; 1, 0 ]. Cf. A129744.
exp( Sum_{n >= 1} a(n)*x^n/n ) = 1 + Sum_{n >= 1} Fibonacci(n)*x^n. Cf. A004146. (End)
a(n) = A052952(n-1) + A052952(n-3). - R. J. Mathar, Jul 02 2018
a(n) = (L(2*n+1) - L(n+1)) mod (L(n+1)-1) for n > 0 where L(k)=A000032(k). - Art Baker, Jan 17 2019
a(n) = Sum_{j=n..2*n-1} L(j) mod Sum_{j=0..n-1} L(j) where L(j)=A000032(j). - Art Baker, Jan 20 2019
Convolution of (1, 0, 3, 0, 5, 0, 7, ...) and (1, 1, 1, 2, 3, 5, 8, 13, ...). - Gary W. Adamson, Jul 08 2019
a(n) = Sum_{d|n} d*A060280(d) = Sum_{d|n} A031367(d). [Baake, Roberts, Weiss, eq(2)]. - R. J. Mathar, Oct 19 2021

Extensions

Additional comments from Michael Somos, Aug 01 2002

A007179 Dual pairs of integrals arising from reflection coefficients.

Original entry on oeis.org

0, 1, 1, 4, 6, 16, 28, 64, 120, 256, 496, 1024, 2016, 4096, 8128, 16384, 32640, 65536, 130816, 262144, 523776, 1048576, 2096128, 4194304, 8386560, 16777216, 33550336, 67108864, 134209536, 268435456, 536854528, 1073741824, 2147450880, 4294967296, 8589869056
Offset: 0

Views

Author

Keywords

Examples

			From _Gus Wiseman_, Feb 26 2022: (Start)
Also the number of integer compositions of n with at least one odd part. For example, the a(1) = 1 through a(5) = 16 compositions are:
  (1)  (1,1)  (3)      (1,3)      (5)
              (1,2)    (3,1)      (1,4)
              (2,1)    (1,1,2)    (2,3)
              (1,1,1)  (1,2,1)    (3,2)
                       (2,1,1)    (4,1)
                       (1,1,1,1)  (1,1,3)
                                  (1,2,2)
                                  (1,3,1)
                                  (2,1,2)
                                  (2,2,1)
                                  (3,1,1)
                                  (1,1,1,2)
                                  (1,1,2,1)
                                  (1,2,1,1)
                                  (2,1,1,1)
                                  (1,1,1,1,1)
(End)
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Column k=2 of A309748.
Odd bisection is A000302.
Even bisection is A006516 = 2^(n-1)*(2^n - 1).
The complement is counted by A077957, internal version A027383.
The internal case is A274230, even bisection A134057.
A000045(n-1) counts compositions without odd parts, non-singleton A077896.
A003242 counts Carlitz compositions.
A011782 counts compositions.
A034871, A097805, and A345197 count compositions by alternating sum.
A052952 (or A074331) counts non-singleton compositions without even parts.

Programs

  • Magma
    [Floor(2^n/2-2^(n/2)*(1+(-1)^n)/4): n in [0..40]]; // Vincenzo Librandi, Aug 20 2011
    
  • Maple
    f := n-> if n mod 2 = 0 then 2^(n-1)-2^((n-2)/2) else 2^(n-1); fi;
  • Mathematica
    LinearRecurrence[{2,2,-4},{0,1,1},30] (* Harvey P. Dale, Nov 30 2015 *)
    Table[2^(n-1)-If[EvenQ[n],2^(n/2-1),0],{n,0,15}] (* Gus Wiseman, Feb 26 2022 *)
  • PARI
    Vec(x*(1-x)/((1-2*x)*(1-2*x^2)) + O(x^50)) \\ Michel Marcus, Jan 28 2016

Formula

From Paul Barry, Apr 28 2004: (Start)
Binomial transform is (A000244(n)+A001333(n))/2.
G.f.: x*(1-x)/((1-2*x)*(1-2*x^2)).
a(n) = 2*a(n-1)+2*a(n-2)-4*a(n-3).
a(n) = 2^n/2-2^(n/2)*(1+(-1)^n)/4. (End)
G.f.: (1+x*Q(0))*x/(1-x), where Q(k)= 1 - 1/(2^k - 2*x*2^(2*k)/(2*x*2^k - 1/(1 + 1/(2*2^k - 8*x*2^(2*k)/(4*x*2^k + 1/Q(k+1)))))); (continued fraction). - Sergei N. Gladkovskii, May 22 2013
a(n) = A011782(n+2) - A077957(n) - Gus Wiseman, Feb 26 2022

A074392 a(n) = Lucas(n+1) + (3*(-1)^n - 1)/2.

Original entry on oeis.org

2, 1, 5, 5, 12, 16, 30, 45, 77, 121, 200, 320, 522, 841, 1365, 2205, 3572, 5776, 9350, 15125, 24477, 39601, 64080, 103680, 167762, 271441, 439205, 710645, 1149852, 1860496, 3010350, 4870845, 7881197, 12752041, 20633240, 33385280, 54018522
Offset: 0

Views

Author

Mario Catalani (mario.catalani(AT)unito.it), Aug 22 2002

Keywords

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[(2-x)/(1-x-2*x^2+x^3+x^4), {x, 0, 40}], x]
  • PARI
    Vec((2-x) / ((x-1)*(1+x)*(x^2+x-1)) + O(x^50)) \\ Colin Barker, Jul 12 2017

Formula

a(n) = Sum (L(2i+e), (i=0, 1, .., Floor(n/2))), where L(n) are Lucas numbers and e=2(n/2 - Floor(n/2)).
Convolution of L(n) with the sequence (1, 0, 1, 0, 1, 0, ...)
a(n) = a(n-1) + 2*a(n-2) - a(n-3) - a(n-4) for n>3.
G.f.: ( 2-x ) / ( (x-1)*(1+x)*(x^2+x-1) ).
a(n) = 2*A052952(n)-A052952(n-1). - R. J. Mathar, Oct 04 2013
a(n) = 2^(-1-n) * (3*(-2)^n - 2^n + (1-sqrt(5))^(1+n) + (1+sqrt(5))^(1+n)). - Colin Barker, Jul 12 2017

A099560 a(n) = Sum_{k=0..floor(n/3)} C(n-2k,k-1).

Original entry on oeis.org

0, 0, 0, 1, 1, 1, 3, 4, 5, 9, 13, 18, 28, 41, 59, 88, 129, 188, 277, 406, 594, 872, 1278, 1872, 2745, 4023, 5895, 8641, 12664, 18559, 27201, 39865, 58424, 85626, 125491, 183915, 269542, 395033, 578948, 848491, 1243524, 1822472, 2670964, 3914488
Offset: 0

Views

Author

Paul Barry, Oct 22 2004

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Sum[Binomial[n-2k,k-1],{k,0,Floor[n/3]}],{n,0,50}] (* or *) LinearRecurrence[{1,0,2,-1,0,-1},{0,0,0,1,1,1},50] (* Harvey P. Dale, May 25 2014 *)
    CoefficientList[Series[x^3/((1 - x^3) (1 - x - x^3)), {x,0,50}], x] (* G. C. Greubel, Apr 28 2017 *)
  • PARI
    x='x+O('x^50); concat([0,0,0], Vec(x^3/((1-x^3)*(1-x-x^3)))) \\ G. C. Greubel, Apr 28 2017

Formula

G.f.: x^3/((1-x^3)(1-x-x^3)).
a(n) = a(n-1) + 2*a(n-3) - a(n-4) - a(n-6).
a(n) = a(n-3) + A000930(n-3). - R. J. Mathar, Nov 24 2013
a(n) = A000930(n-2) - A079978(n+1), n>3. - R. J. Mathar, Dec 08 2022

A116387 Expansion of 1/(sqrt(1-2*x-3*x^2)*(2-M(x))), where M(x) is the g.f. of the Motzkin numbers A001006.

Original entry on oeis.org

1, 2, 7, 22, 72, 234, 763, 2486, 8099, 26372, 85833, 279226, 907946, 2951066, 9587981, 31140034, 101104048, 328162170, 1064856217, 3454513274, 11204337056, 36332719182, 117795920249, 381848062066, 1237615088203, 4010710218384
Offset: 0

Views

Author

Paul Barry, Feb 12 2006

Keywords

Comments

Binomial transform of A116383.
The substitution x-> x/(1+x+x^2) in the g.f. (this might be called an inverse Motzkin transform) yields the g.f. of A074331. - R. J. Mathar, Nov 10 2008

Programs

  • GAP
    List([0..30], n-> Sum([0..n], k-> Sum([0..n], j-> Binomial(n, j-k)*Binomial(j, n-j) ))); # G. C. Greubel, May 23 2019
  • Magma
    [(&+[ (&+[Binomial(n, j-k)*Binomial(j, n-j): j in [0..n]]) : k in [0..n]]): n in [0..30]]; // G. C. Greubel, May 23 2019
    
  • Mathematica
    Table[Sum[Binomial[n,j-k]Binomial[j,n-j],{k,0,n},{j,0,n}],{n,0,30}] (* Harvey P. Dale, Feb 08 2012 *)
  • PARI
    {a(n) = sum(k=0,n, sum(j=0,n, binomial(n, j-k)*binomial(j,n-j)))}; \\ G. C. Greubel, May 23 2019
    
  • Sage
    [sum( sum(binomial(n, j-k)*binomial(j,n-j) for j in (0..n)) for k in (0..n)) for n in (0..30)] # G. C. Greubel, May 23 2019
    

Formula

a(n) = Sum_{k=0..n} Sum_{j=0..n} C(n,j-k)*C(j,n-j).
Conjecture: n*(17*n-142)*a(n) + (17*n^2 + 95*n + 138)*a(n-1) + (-391*n^2 + 2488*n - 2908)*a(n-2) + (-17*n^2 - 603*n + 1892)*a(n-3) + 2*(697*n-2021)*(n-4)*a(n-4) + 60*(17*n-47)*(n-4)*a(n-5) = 0. - R. J. Mathar, Nov 15 2011
a(n) ~ (1+sqrt(5))^n * (5+sqrt(5)) / 10. - Vaclav Kotesovec, Feb 08 2014

A259525 First differences of A007318, when Pascal's triangle is seen as flattened list.

Original entry on oeis.org

0, 0, 0, 1, -1, 0, 2, 0, -2, 0, 3, 2, -2, -3, 0, 4, 5, 0, -5, -4, 0, 5, 9, 5, -5, -9, -5, 0, 6, 14, 14, 0, -14, -14, -6, 0, 7, 20, 28, 14, -14, -28, -20, -7, 0, 8, 27, 48, 42, 0, -42, -48, -27, -8, 0, 9, 35, 75, 90, 42, -42, -90, -75, -35, -9, 0, 10, 44, 110
Offset: 0

Views

Author

Reinhard Zumkeller, Jul 18 2015

Keywords

Comments

A214292 gives first differences per row in Pascal's triangle.

Crossrefs

Programs

  • Haskell
    a259525 n = a259525_list !! n
    a259525_list = zipWith (-) (tail pascal) pascal
                               where pascal = concat a007318_tabl
    
  • Magma
    [k eq n select 0 else (n-2*k-1)*Binomial(n,k+1)/(n-k): k in [0..n], n in [0..14]]; // G. C. Greubel, Apr 25 2024
    
  • Mathematica
    Table[If[k==n, 0, ((n-2*k-1)/(n-k))*Binomial[n,k+1]], {n,0,12}, {k,0, n}]//Flatten (* G. C. Greubel, Apr 25 2024 *)
  • SageMath
    flatten([[binomial(n,k+1) -binomial(n,k) +int(k==n) for k in range(n+1)] for n in range(15)]) # G. C. Greubel, Apr 25 2024

Formula

From G. C. Greubel, Apr 25 2024: (Start)
If viewed as a triangle then:
T(n, k) = binomial(n, k+1) - binomial(n, k), with T(n, n) = 0.
T(n, n-k) = - T(n, k), for 0 <= k < n.
T(2*n, n) = [n=0] - A000108(n).
Sum_{k=0..n} T(n, k) = 0 (row sums).
Sum_{k=0..floor(n/2)} T(n, k) = A047171(n).
Sum_{k=0..n} (-1)^k*T(n, k) = A021499(n).
Sum_{k=0..floor(n/2)} T(n-k, k) = A074331(n-1). (End)

A074475 a(n) = Sum_{j=0..floor(n/2)} T(2*j + q), where T(n) are generalized tribonacci numbers (A001644) and q = n - 2*floor(n/2).

Original entry on oeis.org

3, 1, 6, 8, 17, 29, 56, 100, 187, 341, 630, 1156, 2129, 3913, 7200, 13240, 24355, 44793, 82390, 151536, 278721, 512645, 942904, 1734268, 3189819, 5866989, 10791078, 19847884, 36505953, 67144913, 123498752, 227149616, 417793283
Offset: 0

Views

Author

Mario Catalani (mario.catalani(AT)unito.it), Aug 23 2002

Keywords

Comments

a(n) is the convolution of T(n) with the sequence (1,0,1,0,1,0,...).

Crossrefs

Programs

  • Magma
    R:=PowerSeriesRing(Integers(), 40); Coefficients(R!( (3+x)/(1-2*x^2-2*x^3-x^4) )); // G. C. Greubel, Apr 21 2019
    
  • Mathematica
    CoefficientList[Series[(3+x)/(1-2*x^2-2*x^3-x^4), {x, 0, 40}], x]
    LinearRecurrence[{0,2,2,1},{3,1,6,8},40] (* Harvey P. Dale, Jul 08 2017 *)
  • PARI
    my(x='x+O('x^40)); Vec((3+x)/(1-2*x^2-2*x^3-x^4)) \\ G. C. Greubel, Apr 21 2019
    
  • Sage
    ((3+x)/(1-2*x^2-2*x^3-x^4)).series(x, 40).coefficients(x, sparse=False) # G. C. Greubel, Apr 21 2019

Formula

a(n) = 2*a(n-2) + 2*a(n-3) + a(n-4), a(0)=3, a(1)=1, a(2)=6, a(3)=8.
G.f.: (3+x)/(1-2*x^2-2*x^3-x^4).
Showing 1-10 of 14 results. Next