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.

Previous Showing 11-20 of 58 results. Next

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

Original entry on oeis.org

0, 1, 1, 3, 4, 7, 9, 13, 16, 21, 25, 31, 36, 43, 49, 57, 64, 73, 81, 91, 100, 111, 121, 133, 144, 157, 169, 183, 196, 211, 225, 241, 256, 273, 289, 307, 324, 343, 361, 381, 400, 421, 441, 463, 484, 507, 529, 553, 576, 601, 625, 651, 676, 703, 729, 757, 784, 813
Offset: 0

Views

Author

Keywords

Comments

As a Molien series this arises as (1+x^12)/((1-x^4)*(1-x^8)^2).
Starting (1, 3, 4, ...) = row sums of an infinite triangle with alternate columns of (1, 2, 3, ...) and (1, 0, 0, 0, ...). - Gary W. Adamson, May 14 2010
a(n) is also the number of inequivalent (modulo C_4 rotations) square n X n grids with squares coming in two colors and one square has one of the colors. See the formula from A054772. - Wolfdieter Lang, Oct 03 2016
Also the genus of the complete bipartite graph K_{n+2,n+2}. - Eric W. Weisstein, Jan 19 2018

Examples

			From _Gary W. Adamson_, May 14 2010: (Start)
First few rows of the generating triangle =
1;
2, 1;
3, 0, 1;
4, 0, 2, 1;
5, 0, 3, 0, 1;
6, 0, 4, 0, 2, 1;
7, 0, 5, 0, 3, 0, 1;
8, 0, 6, 0, 4, 0, 2, 1;
...
Example: a(7) = 13 = (6 + 0 + 4 + 0 + 2 + 1). (End)
x + x^2 + 3*x^3 + 4*x^4 + 7*x^5 + 9*x^6 + 13*x^7 + 16*x^8 + 21*x^9 + ...
		

Crossrefs

First differences give A028242. Cf. A035104, A035106.
A002061(n)=a(2*n-1). A035104(n)=a(n+7)-12. A035106(n)=a(n+3)-1.
Column 1 of A195040. - Omar E. Pol, Sep 28 2011
Cf. A054772, column 2.

Programs

  • Haskell
    a004652 = ceiling . (/ 4) . fromIntegral . (^ 2)
    a004652_list = 0 : 1 : zipWith (+) a004652_list [1..]
    -- Reinhard Zumkeller, Dec 18 2013
  • Magma
    [Ceiling(n^2/4): n in [0..60] ]; // Vincenzo Librandi, Aug 19 2011
    
  • Maple
    with(combstruct):ZL:=[st,{st=Prod(left,right),left=Set(U,card=r),right=Set(U,card=2)}, unlabeled]: subs(r=1,stack): seq(count(subs(r=2,ZL),size=m+3),m=0..57) ; # Zerinvary Lajos, Mar 09 2007
  • Mathematica
    CoefficientList[Series[x (1 - x + x^2)/((1 - x)^2*(1 - x^2)), {x, 0, 57}], x] (* Michael De Vlieger, Oct 03 2016 *)
    Table[Ceiling[n^2/4], {n, 0, 20}] (* Eric W. Weisstein, Jan 19 2018 *)
    Ceiling[Range[0, 20]^2/4] (* Eric W. Weisstein, Jan 19 2018 *)
    LinearRecurrence[{2, 0, -2, 1}, {1, 1, 3, 4}, {0, 20}] (* Eric W. Weisstein, Jan 19 2018 *)
  • PARI
    {a(n) = ceil(n^2 / 4)}
    

Formula

a(n) = ceiling(n^2/4).
a(-n) = a(n).
G.f.: x * (1 - x + x^2) / ((1 - x)^2 * (1 - x^2)).
a(n) = a(n-1) + a(n-2) - a(n-3) + 1. a(2*n) = n^2, a(2*n-1) = n^2 - n + 1. - Michael Somos, Apr 21 2000
Interleaves square numbers with centered polygonal numbers: a(2*n)=A000290(n), a(2*n+1)=A002061(n+1). - Paul Barry, Mar 13 2003
For n > 1: a(n) is the digit reversal of n in base A008619(n), where a(n) is written in base 10. - Naohiro Nomoto, Mar 15 2004
a(n) = a(n-2) + n - 1. - Paul Barry, Jul 14 2004
Euler transform of length 6 sequence [ 1, 2, 1, 0, 0, -1]. - Michael Somos, Apr 03 2007
Starting (1, 3, 4, 7, 9, 13, ...), row sums of triangle A135840. - Gary W. Adamson, Dec 01 2007
a(n) = (3/8)*(-1)^(n+1) + 5/8 - (3/4)*(n+1) + (1/4)*(n+2)*(n+1). - Richard Choulet, Nov 27 2008
a(n) = n^2/4 - 3*((-1)^n-1)/8. - Omar E. Pol, Sep 28 2011
a(n) = -n + floor( (n+1)(n+3)/4 ). - Wesley Ivan Hurt, Jun 23 2013
a(n) = A054772(n, 1) = A054772(n, n^2-1), n >= 1. - Wolfdieter Lang, Oct 03 2016
E.g.f.: (x*(x + 1)*exp(x) + 3*sinh(x))/4. - Ilya Gutkovskiy, Oct 03 2016
a(n) = binomial(floor((n+3)/2),2) + binomial(floor((n+(-1)^n)/2),2). - Yuchun Ji, Feb 03 2021

A035106 1, together with numbers of the form k*(k+1) or k*(k+2), k > 0.

Original entry on oeis.org

1, 2, 3, 6, 8, 12, 15, 20, 24, 30, 35, 42, 48, 56, 63, 72, 80, 90, 99, 110, 120, 132, 143, 156, 168, 182, 195, 210, 224, 240, 255, 272, 288, 306, 323, 342, 360, 380, 399, 420, 440, 462, 483, 506, 528, 552, 575, 600, 624, 650, 675, 702, 728, 756, 783, 812, 840
Offset: 1

Views

Author

N. J. A. Sloane, revised Oct 30 2001

Keywords

Comments

Largest integer m such that every permutation (p_1, ..., p_n) of (1, ..., n) satisfies p_i * p_{i+1} >= m for some i, 1 <= i <= n-1. Equivalently, smallest integer m such that there exists a permutation (p_1, ..., p_n) of (1, ..., n) satisfying p_i * p_{i+1} <= m for every i, 1 <= i <= n-1.
Also, nonsquare positive integers m such that floor(sqrt(m)) divides m. - Max Alekseyev, Nov 27 2006
Also, for n>1, a(n) is the number of non-isomorphic simple connected undirected graphs having n+1 edges and a longest path of length n. - Nathaniel Gregg, Nov 02 2021

Examples

			n=5: we must arrange the numbers 1..5 so that the max of the products of pairs of adjacent terms is minimized. The answer is 51324, with max product = 8, so a(5) = 8.
		

Crossrefs

First differences give (essentially) A028242.
Bisections: A002378 (pronic numbers) and A005563.

Programs

  • GAP
    Concatenation([1], List([2..60], n-> (2*n*(n+2) +3*((-1)^n -1))/8)); # G. C. Greubel, Jun 10 2019
  • Haskell
    import Data.List.Ordered (union)
    a035106 n = a035106_list !! (n-1)
    a035106_list = 1 : tail (union a002378_list a005563_list)
    -- Reinhard Zumkeller, Oct 05 2015
    
  • Magma
    [1] cat [(2*n*(n+2) +3*((-1)^n -1))/8: n in [2..60]]; // G. C. Greubel, Jun 10 2019
    
  • Mathematica
    Join[{1},LinearRecurrence[{2,0,-2,1},{2,3,6,8},60]] (* or *) Join[{1}, Table[ If[EvenQ[n],(n(n+2))/4,((n-1)(n+3))/4],{n,2,60}]] (* Harvey P. Dale, May 03 2012 *)
  • PARI
    my(x='x+O('x^60)); Vec(x*(x^4-2*x^3+x^2-1)/((x-1)^3*(x+1))) \\ Altug Alkan, Oct 23 2015
    
  • PARI
    A035106(n)=!(n-1)+floor((n^2)/4+n/2); \\ R. J. Cano, Jul 24 2023
    
  • Sage
    [1]+[(2*n*(n+2) +3*((-1)^n -1))/8 for n in (2..60)] # G. C. Greubel, Jun 10 2019
    

Formula

For n > 1, a(n) = n*(n+2)/4 if n is even and (n-1)*(n+3)/4 if n is odd. - Jud McCranie, Oct 25 2001
a(n) = a(n-1) + a(n-2) - a(n-3) + 1 = A002620(n+2) + A004526(n+2). - Henry Bottomley, Mar 08 2000
a(n+2) = (2*n^2 + 12*n + 3*(-1)^n + 13)/8, with a(1)=1, i.e., a(n+2) = (n+2)*(n+4)/4 if n is even and (n+1)*(n+5)/4 if n is odd. - Vladeta Jovovic, Oct 23 2001
From Cecilia Rossiter (cecilia(AT)noticingnumbers.net), Dec 14 2004: (Start)
a(n) = a(n-2) + (n-1), where a(1) = 0, a(2) = 0.
a(n) = (2*(n+1)^2 + 3*(-1)^n - 5)/8, n>=2, with a(1)=1. (End)
For n > 1, a(n) = floor((n+1)^4/(4*(n+1)^2+1)). - Gary Detlefs, Feb 11 2010
For n > 1, a(n) = n + ceiling((1/4)*(n-1)^2) - 1. - Clark Kimberling, Jan 07 2011; corrected by Arkadiusz Wesolowski, Sep 25 2012
a(1)=1, a(2)=2, a(3)=3, a(4)=6, a(5)=8; for n > 5, a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4). - Harvey P. Dale, May 03 2012
G.f.: x + x^2*(2-x) / ( (1+x)*(1-x)^3 ) = x*(x^4 - 2*x^3 + x^2 - 1)/((x-1)^3*(x+1)). - Vladeta Jovovic, Oct 23 2001; Harvey P. Dale, May 03 2012
a(n) = floor(n/2)*(1 + ceiling(n/2)), a(1) = 1. - Arkadiusz Wesolowski, Sep 25 2012
a(n) = ceiling((n-1)*(n+3)/4), n > 1. - Wesley Ivan Hurt, Jun 14 2013
a(n+1) - a(n) = A052938(n-2) for n > 1. - Reinhard Zumkeller, Oct 06 2015
E.g.f.: (8*x + 3*exp(-x) - (3-6*x-2*x^2)*exp(x))/8. - G. C. Greubel, Jun 10 2019
Sum_{n>=1} 1/a(n) = 11/4. - Amiram Eldar, Sep 24 2022

Extensions

Edited by Max Alekseyev, Oct 09 2015
Definition modified to allow for the initial 1. - N. J. A. Sloane, May 17 2016

A178218 Numbers of the form 2k^2-2k+1 or 2k^2-1.

Original entry on oeis.org

1, 5, 7, 13, 17, 25, 31, 41, 49, 61, 71, 85, 97, 113, 127, 145, 161, 181, 199, 221, 241, 265, 287, 313, 337, 365, 391, 421, 449, 481, 511, 545, 577, 613, 647, 685, 721, 761, 799, 841, 881, 925, 967, 1013, 1057, 1105, 1151, 1201, 1249
Offset: 1

Views

Author

Eddie Gutierrez, Dec 19 2010

Keywords

Comments

Numbers which when squared are used as entries in magic squares. A sequence of numbers whose difference is an interleaved array consisting of 4,6,8,10,12,... and a second sequence 2,4,6,8,10,... . Each entry when squared produces an entry into a tuple used as the right diagonal in a magic square. The difference between square entries produces a third sequence 24,24,120,120,336,336,720,720,1320,1320,..., numbers divisible by 24 and generating the sequence of natural number squares.

Crossrefs

Programs

  • Magma
    I:=[1, 5, 7, 13]; [n le 4 select I[n] else 2*Self(n-1)-2*Self(n-3)+Self(n-4): n in [1..60]]; // Vincenzo Librandi, Jun 09 2012
    
  • Mathematica
    Join[{1}, Flatten[Table[{(n^2 + 1)/2, (n^2 + 2 n - 1)/2}, {n, 3, 50, 2}]]]
    Table[(2 n (n + 2) + 3 (-1)^n + 1)/4, {n, 49}] (* Bruno Berselli, Apr 04 2012 *)
    CoefficientList[Series[(1+3*x-3*x^2+x^3)/((1-x)^3*(1+x)),{x,0,60}],x] (* Vincenzo Librandi, Jun 09 2012 *)
    LinearRecurrence[{2,0,-2,1},{1,5,7,13},60] (* Harvey P. Dale, Jun 09 2019 *)
  • Maxima
    A178218[1]:1$
    A178218[n]:=n*(n+1)-A178218[n-1]$
    makelist(A178218[n],n,1,30); /* Martin Ettl, Nov 01 2012 */
  • Python
    a = 1
    for n in range(2,77):
        print(a, end=",")
        a = n*(n+1) - a
    # Alex Ratushnyak, Aug 03 2012
    

Formula

From Colin Barker, Apr 04 2012: (Start)
a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4).
G.f.: x*(1+3*x-3*x^2+x^3)/((1-x)^3*(1+x)). (End)
a(n) = (2n(n+2)+3(-1)^n+1)/4. - Bruno Berselli, Apr 04 2012
From Philippe Deléham, Jun 08 2012: (Start)
2*a(2n)^2 = a(2n-1)^2 + a(2n+1)^2.
(a(2n)+a(2n-1))*A028242(2n) = (a(2n)+a(2n+1))*A028242(2n+1). (End)
a(1)=1, a(n) = n*(n+1) - a(n-1). - Alex Ratushnyak, Aug 03 2012
E.g.f.: ((x^2 + 3*x + 2)*cosh(x) + (x^2 + 3*x - 1)*sinh(x) - 2)/2. - Stefano Spezia, Feb 22 2024

A110660 Oblong (promic) numbers repeated.

Original entry on oeis.org

0, 0, 2, 2, 6, 6, 12, 12, 20, 20, 30, 30, 42, 42, 56, 56, 72, 72, 90, 90, 110, 110, 132, 132, 156, 156, 182, 182, 210, 210, 240, 240, 272, 272, 306, 306, 342, 342, 380, 380, 420, 420, 462, 462, 506, 506, 552, 552, 600, 600, 650, 650, 702, 702, 756, 756, 812, 812
Offset: 0

Views

Author

Reinhard Zumkeller, Aug 05 2005

Keywords

Comments

a(floor(n/2)) = A002378(n).
Sum of the even numbers among the smallest parts in the partitions of 2n into two parts (see example). - Wesley Ivan Hurt, Jul 25 2014
For n > 0, a(n-1) is the sum of the smallest parts of the partitions of 2n into two distinct even parts. - Wesley Ivan Hurt, Dec 06 2017

Examples

			a(4) = 6; The partitions of 2*4 = 8 into two parts are: (7,1), (6,2), (5,3), (4,4). The sum of the even numbers from the smallest parts of these partitions gives: 2 + 4 = 6.
a(5) = 6; The partitions of 2*5 = 10 into two parts are: (9,1), (8,2), (7,3), (6,4), (5,5). The sum of the even numbers from the smallest parts of these partitions gives: 2 + 4 = 6.
		

Crossrefs

Cf. A109613.
Partial sums give A006584.

Programs

Formula

a(n) = floor(n/2) * (floor(n/2)+1).
a(n) = A028242(n) * A110654(n).
a(n) = A008805(n-2)*2, with A008805(-2) = A008805(-1) = 0.
From Wesley Ivan Hurt, Jul 25 2014: (Start)
G.f.: 2*x^2/((1-x)^3*(1+x)^2);
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5), for n > 4;
a(n) = (2*n^2 + 2*n - 1 + (2*n + 1)*(-1)^n)/8. (End)
a(n) = Sum_{i=1..n; i even} i. - Olivier Pirson, Nov 05 2017

Extensions

Typo in description (Name) fixed by Harvey P. Dale, Jul 09 2021

A198442 Number of sequences of n coin flips that win on the last flip, if the sequence of flips ends with (1,1,0) or (1,0,0).

Original entry on oeis.org

0, 0, 2, 3, 6, 8, 12, 15, 20, 24, 30, 35, 42, 48, 56, 63, 72, 80, 90, 99, 110, 120, 132, 143, 156, 168, 182, 195, 210, 224, 240, 255, 272, 288, 306, 323, 342, 360, 380, 399, 420, 440, 462, 483, 506, 528, 552, 575, 600, 624, 650, 675, 702, 728, 756, 783, 812
Offset: 1

Views

Author

Paul Weisenhorn, Oct 25 2011

Keywords

Comments

If the sequence ends with (1,1,0) Abel wins; if it ends with (1,0,0) Kain wins.
Abel(n) = A002620(n-1) = (2*n*(n - 2) + 1 - (-1)^n)/8.
Kain(n) = A004526(n-1) = floor((n - 1)/2).
Win probability for Abel = sum(Abel(n)/2^n) = 2/3.
Win probability for Kain = sum(Kain(n)/2^n) = 1/3.
Mean length of the game = sum(n*a(n)/2^n) = 16/3.
Essentially the same as A035106. - R. J. Mathar, Oct 27 2011
The sequence 2*a(n) is denoted as chi(n) by McKee (1994) and is the degree of the division polynomial f_n as a polynomial in x. He notes that "If x is given weight 1, a is given weight 2, and b is given weight 3, then all the terms in f_n(a, b, x) have weight chi(n)". - Michael Somos, Jan 09 2015
In Duistermaat (2010), at the end of section 11.2 The Elliptic Billiard, on page 492 the number of k-periodic fibers counted with multiplicities of the QRT root is given by equation (11.2.8) as "1/4 k^2 + 3{k/2}(1 - {k/2}) - 1 = n^2 - 1 when k = 2n, n^2 + n when k = 2n+1, for every integer k." - Michael Somos, Mar 14 2023

Examples

			For n = 6 the a(6) = 8 solutions are (0,0,0,1,1,0), (0,1,0,1,1,0),(0,0,1,1,1,0), (1,0,1,1,1,0), (0,1,1,1,1,0),(1,1,1,1,1,0) for Abel and
  (0,0,0,1,0,0), (0,1,0,1,0,0) for Kain.
G.f. = 2*x^3 + 3*x^4 + 6*x^5 + 8*x^6 + 12*x^7 + 15*x^8 + 20*x^9 + ...
		

References

  • J. J. Duistermaat, Discrete Integrable Systems, 2010, Springer Science+Business Media.
  • A. Engel, Wahrscheinlichkeitsrechnung und Statistik, Band 2, Klett, 1978, pages 25-26.

Crossrefs

Programs

  • Magma
    [(2*n^2-5-3*(-1)^n)/8: n in [1..60]]; // Vincenzo Librandi, Oct 28 2011
    
  • Maple
    for n from 1 by 2 to 99 do
      a(n):=(n^2-1)/4:
      a(n+1):=(n+1)^2/4-1:
    end do:
    seq(a(n),n=1..100);
  • Mathematica
    a[ n_] := Quotient[ n^2 - 1, 4]; (* Michael Somos, Jan 09 2015 *)
  • PARI
    a(n)=([1,1,0,0,0,0;0,0,1,1,0,0;0,1,0,0,1,0;0,0,0,1,1,0;0,0,0,0,0,2;0,0,0,0,0,2]^n)[1,5] \\ Charles R Greathouse IV, Oct 26 2011
    
  • PARI
    {a(n) = (n^2 - 1) \ 4}; /* Michael Somos, Jan 09 2015 */
    
  • Perl
    sub a {
        my ($t, $n) = (0, shift);
        for (0..((1<<$n)-1)) {
            my $str = substr unpack("B32", pack("N", $_)), -$n;
            $t++ if ($str =~ /1.0$/ and not $str =~ /1.0./);
        }
        return $t
    } # Charles R Greathouse IV, Oct 26 2011
    
  • Sage
    def A198442():
        yield 0
        x, y = 0, 2
        while True:
           yield x
           x, y = x + y, x//y + 1
    a = A198442(); print([next(a) for i in range(57)]) # Peter Luschny, Dec 22 2015

Formula

a(n) = (2*n^2 - 5 - 3*(-1)^n)/8.
a(2*n) = n^2 - 1; a(2*n+1) = n*(n + 1).
a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4) with n>=4.
G.f.: x^3*(2 - x)/((1 + x)*(1 - x)^3). - R. J. Mathar, Oct 27 2011
a(n) = a(-n) for all n in Z. a(0) = -1. - Michael Somos, Jan 09 2015
0 = a(n)*(+a(n+1) - a(n+2)) + a(n+1)*(-1 - a(n+1) + a(n+2)) for all n in Z. - Michael Somos, Jan 09 2015
1 = a(n) - a(n+1) - a(n+2) + a(n+3), 2 = a(n) - 2*a(n+2) + a(n+4) for all n in Z. - Michael Somos, Jan 09 2015
a(n) = A002620(n+2) - A052928(n+2) for n >= 1. (Note A265611(n) = A002620(n+1) + A052928(n+1) for n >= 1.) - Peter Luschny, Dec 22 2015
a(n+1) = A110654(n)^2 + A110654(n)*(2 - (n mod 2)), n >= 0. - Fred Daniel Kline, Jun 08 2016
a(n) = A004526(n)*A004526(n+3). - Fred Daniel Kline, Aug 04 2016
a(n) = floor((n^2 - 1)/4). - Bruno Berselli, Mar 15 2021

Extensions

a(12) inserted by Charles R Greathouse IV, Oct 26 2011

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

Original entry on oeis.org

1, 3, 2, 4, 3, 5, 4, 6, 5, 7, 6, 8, 7, 9, 8, 10, 9, 11, 10, 12, 11, 13, 12, 14, 13, 15, 14, 16, 15, 17, 16, 18, 17, 19, 18, 20, 19, 21, 20, 22, 21, 23, 22, 24, 23, 25, 24, 26, 25, 27, 26, 28, 27, 29, 28, 30, 29, 31, 30, 32, 31, 33, 32, 34, 33, 35, 34, 36, 35, 37, 36, 38, 37, 39
Offset: 0

Views

Author

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

Keywords

Crossrefs

Cf. A028242 (same sequence with 1,0,2 prefix).
Cf. A035106.

Programs

  • GAP
    List([0..30], n-> (2*n+7-3*(-1)^n)/4); # G. C. Greubel, Oct 18 2019
  • Haskell
    a052938 n = a052938_list !! n
    a052938_list = 1 : 3 : 2 : zipWith (-) [5..] a052938_list
    -- Reinhard Zumkeller, Oct 06 2015
    
  • Magma
    [(2*n+7-3*(-1)^n)/4: n in [0..30]]; // G. C. Greubel, Oct 18 2019
    
  • Magma
    R:=PowerSeriesRing(Integers(), 75); Coefficients(R!( (1 + 2*x - 2*x^2)/( (1+x)*(1-x)^2 ))); // Marius A. Burtea, Oct 18 2019
    
  • Maple
    spec := [S,{S=Prod(Union(Sequence(Z),Z,Z),Sequence(Prod(Z,Z)))},unlabeled ]: seq(combstruct[count ](spec,size=n), n=0..20);
    seq((2*n+7-3*(-1)^n)/4, n=0..30); # G. C. Greubel, Oct 18 2019
  • Mathematica
    LinearRecurrence[{1,1,-1},{1,3,2},80] (* Harvey P. Dale, Apr 10 2019 *)
  • PARI
    a(n)=([0,1,0; 0,0,1; -1,1,1]^n*[1;3;2])[1,1] \\ Charles R Greathouse IV, Sep 02 2015
    
  • Sage
    [(2*n+7-3*(-1)^n)/4 for n in (0..30)] # G. C. Greubel, Oct 18 2019
    

Formula

G.f.: (1+2*x-2*x^2)/((1+x)*(1-x)^2).
a(n) = -a(n-1) + n + 3, with a(0)=1.
a(n) = (3*(-1)^(n+1) + 2*n + 7)/4.
A112034(n) = 3*2^a(n); a(n) = A109613(n+2) - A084964(n). - Reinhard Zumkeller, Aug 27 2005
a(n) = A035106(n+3) - A035106(n+2). - Reinhard Zumkeller, Oct 06 2015
a(n) = A060762(n+1) - 1. - Filip Zaludek, Nov 19 2016
E.g.f.: ((5+x)*sinh(x) + (2+x)*cosh(x))/2. - G. C. Greubel, Oct 18 2019

Extensions

More terms from James Sellers, Jun 06 2000

A285721 Square array read by antidiagonals: A(n,k) = number of steps in simple Euclidean algorithm for gcd(n,k) to reach the termination test n=k, read by antidiagonals as A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), etc.

Original entry on oeis.org

0, 1, 1, 2, 0, 2, 3, 2, 2, 3, 4, 1, 0, 1, 4, 5, 3, 3, 3, 3, 5, 6, 2, 3, 0, 3, 2, 6, 7, 4, 1, 4, 4, 1, 4, 7, 8, 3, 4, 2, 0, 2, 4, 3, 8, 9, 5, 4, 4, 5, 5, 4, 4, 5, 9, 10, 4, 2, 1, 4, 0, 4, 1, 2, 4, 10, 11, 6, 5, 5, 4, 6, 6, 4, 5, 5, 6, 11, 12, 5, 5, 3, 5, 3, 0, 3, 5, 3, 5, 5, 12, 13, 7, 3, 5, 1, 2, 7, 7, 2, 1, 5, 3, 7, 13, 14, 6, 6, 2, 6, 3, 5, 0, 5, 3, 6, 2, 6, 6, 14
Offset: 1

Views

Author

Antti Karttunen, May 03 2017

Keywords

Examples

			The top left 18 X 18 corner of the array:
   0, 1, 2, 3, 4, 5, 6, 7, 8,  9, 10, 11, 12, 13, 14, 15, 16, 17
   1, 0, 2, 1, 3, 2, 4, 3, 5,  4,  6,  5,  7,  6,  8,  7,  9,  8
   2, 2, 0, 3, 3, 1, 4, 4, 2,  5,  5,  3,  6,  6,  4,  7,  7,  5
   3, 1, 3, 0, 4, 2, 4, 1, 5,  3,  5,  2,  6,  4,  6,  3,  7,  5
   4, 3, 3, 4, 0, 5, 4, 4, 5,  1,  6,  5,  5,  6,  2,  7,  6,  6
   5, 2, 1, 2, 5, 0, 6, 3, 2,  3,  6,  1,  7,  4,  3,  4,  7,  2
   6, 4, 4, 4, 4, 6, 0, 7, 5,  5,  5,  5,  7,  1,  8,  6,  6,  6
   7, 3, 4, 1, 4, 3, 7, 0, 8,  4,  5,  2,  5,  4,  8,  1,  9,  5
   8, 5, 2, 5, 5, 2, 5, 8, 0,  9,  6,  3,  6,  6,  3,  6,  9,  1
   9, 4, 5, 3, 1, 3, 5, 4, 9,  0, 10,  5,  6,  4,  2,  4,  6,  5
  10, 6, 5, 5, 6, 6, 5, 5, 6, 10,  0, 11,  7,  6,  6,  7,  7,  6
  11, 5, 3, 2, 5, 1, 5, 2, 3,  5, 11,  0, 12,  6,  4,  3,  6,  2
  12, 7, 6, 6, 5, 7, 7, 5, 6,  6,  7, 12,  0, 13,  8,  7,  7,  6
  13, 6, 6, 4, 6, 4, 1, 4, 6,  4,  6,  6, 13,  0, 14,  7,  7,  5
  14, 8, 4, 6, 2, 3, 8, 8, 3,  2,  6,  4,  8, 14,  0, 15,  9,  5
  15, 7, 7, 3, 7, 4, 6, 1, 6,  4,  7,  3,  7,  7, 15,  0, 16,  8
  16, 9, 7, 7, 6, 7, 6, 9, 9,  6,  7,  6,  7,  7,  9, 16,  0, 17
  17, 8, 5, 5, 6, 2, 6, 5, 1,  5,  6,  2,  6,  5,  5,  8, 17,  0
		

Crossrefs

One less than A072030.
Row 2 & column 2: A028242 (but with starting offset 1).
Row 3 & column 3 (from zero onward) seems to be A226576.
Compare also to arrays A049834, A113881, A219158.

Programs

  • Python
    def A(n, k): return 0 if n==k else 1 + A(abs(n - k), min(n, k))
    for n in range(1, 21): print([A(n - k + 1, k) for k in range(1, n + 1)]) # Indranil Ghosh, May 03 2017
  • Scheme
    (define (A285721 n) (A285721bi (A002260 n) (A004736 n)))
    (define (A285721bi row col) (cond ((= row col) 0) ((> row col) (+ 1 (A285721bi (- row col) col))) (else (+ 1 (A285721bi row (- col row))))))
    ;; Alternatively:
    (define (A285721bi row col) (if (= row col) 0 (+ 1 (A285721bi (abs (- row col)) (min col row)))))
    ;; Another implementation, as an one-dimensional sequence:
    (definec (A285721 n) (if (zero? (A285722 n)) 0 (+ 1 (A285721 (A285722 n)))))
    

Formula

If n = k, then A(n,k) = 0, if n > k, then A(n,k) = 1 + A(n-k,k), otherwise [when n < k], A(n,k) = 1 + A(n,k-n).
Or alternatively, when n <> k, A(n,k) = 1 + A(abs(n-k),min(n,k)).
A(n,k) = A072030(n,k)-1.
As an one-dimensional sequence:
a(n) = 0 if A285722(n) = 0, otherwise a(n) = 1 + a(A285722(n)). [Here A285722 is also used as an one-dimensional sequence.]

A030451 a(2*n) = n, a(2*n+1) = n+2.

Original entry on oeis.org

0, 2, 1, 3, 2, 4, 3, 5, 4, 6, 5, 7, 6, 8, 7, 9, 8, 10, 9, 11, 10, 12, 11, 13, 12, 14, 13, 15, 14, 16, 15, 17, 16, 18, 17, 19, 18, 20, 19, 21, 20, 22, 21, 23, 22, 24, 23, 25, 24, 26, 25, 27, 26, 28, 27, 29, 28, 30, 29, 31, 30, 32, 31, 33, 32, 34, 33, 35, 34, 36, 35, 37, 36, 38, 37
Offset: 0

Views

Author

Daniel Smith (2true(AT)gte.net)

Keywords

Comments

Previous name was: Once started, this mixes the natural numbers and the natural numbers shifted by 1.
Smallest number of integer-sided squares needed to tile a 2 X n rectangle. a(5) = 4:
..._...
| | |_|
|_|___||. - _Alois P. Heinz, Jun 12 2013

Crossrefs

Cf. A168361 (first differences), A198442 (partial sums).
Row m=2 of A113881, A219158.
Essentially the same as A028242.

Programs

  • Maple
    a:= n-> iquo(n, 2, 'r') +[0, 2][r+1]:
    seq(a(n), n=0..80);  # Alois P. Heinz, Jun 12 2013
  • Mathematica
    Riffle[# + 1, #] &@ Range[0, 37] (* or *)
    Table[3/4 - (-1)^n 3/4 + n/2, {n, 0, 72}] (* or *)
    CoefficientList[Series[(2 x - x^2)/((1 - x) (1 - x^2)), {x, 0, 72}], x] (* Michael De Vlieger, Apr 25 2016 *)
  • PARI
    a(n)=n\2+2*(n%2)

Formula

a(n) = 3/4 -(-1)^n*3/4 +n/2.
G.f.: (2*x-x^2)/((1-x)*(1-x^2)).
a(2n) = n, a(2n+1) = n+2.
a(n+2) = a(n)+1.
a(n) = -a(-3-n).
a(n) = A110570(n,2) for n>1. - Reinhard Zumkeller, Jul 28 2005
a(n) = (n+1)-a(n-1) with n>0, a(0)=0. - Vincenzo Librandi, Nov 18 2010
a(n) = Sum_{k=1..n} (-1)^(n+k)*(k+1). - Arkadiusz Wesolowski, Nov 23 2012
a(n+1) = (a(0) + a(1) + ... + a(n))/a(n) for n>0. This formula with different initial conditions produces A008619. - Ivan Neretin, Apr 25 2016
E.g.f.: (x*exp(x) + 3*sinh(x))/2. - Ilya Gutkovskiy, Apr 25 2016
Sum_{n>=1} (-1)^n/a(n) = 1. - Amiram Eldar, Oct 04 2022

Extensions

New name (using existing formula) from Joerg Arndt, Apr 26 2016

A327371 Triangle read by rows where T(n,k) is the number of unlabeled simple graphs with n vertices and exactly k endpoints (vertices of degree 1).

Original entry on oeis.org

1, 1, 0, 1, 0, 1, 2, 0, 2, 0, 5, 1, 3, 1, 1, 16, 6, 7, 2, 3, 0, 78, 35, 25, 8, 7, 2, 1, 588, 260, 126, 40, 20, 6, 4, 0, 8047, 2934, 968, 263, 92, 25, 13, 3, 1, 205914, 53768, 11752, 2434, 596, 140, 47, 12, 5, 0, 10014882, 1707627, 240615, 34756, 5864, 1084, 256, 58, 21, 4, 1
Offset: 0

Views

Author

Gus Wiseman, Sep 04 2019

Keywords

Examples

			Triangle begins:
     1;
     1,    0;
     1,    0,   1;
     2,    0,   2,   0;
     5,    1,   3,   1,  1;
    16,    6,   7,   2,  3,  0;
    78,   35,  25,   8,  7,  2,  1;
   588,  260, 126,  40, 20,  6,  4, 0;
  8047, 2934, 968, 263, 92, 25, 13, 3, 1;
  ...
		

Crossrefs

Row sums are A000088.
Row sums without the first column are A141580.
Columns k = 0..2 are A004110, A325115, A325125.
Column k = n is A059841.
Column k = n - 1 is A028242.
The labeled version is A327369.
The covering case is A327372.

Programs

  • PARI
    permcount(v) = {my(m=1, s=0, k=0, t); for(i=1, #v, t=v[i]; k=if(i>1&&t==v[i-1], k+1, 1); m*=t*k; s+=t); s!/m}
    edges(v) = {sum(i=2, #v, sum(j=1, i-1, gcd(v[i], v[j]))) + sum(i=1, #v, v[i]\2)}
    G(n)={sum(k=0, n, my(s=0); forpart(p=k, s+=permcount(p) * 2^edges(p) * prod(i=1, #p, (1 - x^p[i])/(1 - (x*y)^p[i]) + O(x*x^(n-k)))); x^k*s/k!)*(1-x^2*y)/(1-x^2*y^2)}
    T(n)={my(v=Vec(G(n))); vector(#v, n, Vecrev(v[n], n))}
    my(A=T(10)); for(n=1, #A, print(A[n])) \\ Andrew Howroyd, Jan 22 2021

Formula

Column-wise partial sums of A327372.

Extensions

Terms a(21) and beyond from Andrew Howroyd, Sep 05 2019

A123231 Row sums of A123230.

Original entry on oeis.org

1, 2, 1, 3, 2, 5, 3, 8, 5, 13, 8, 21, 13, 34, 21, 55, 34, 89, 55, 144, 89, 233, 144, 377, 233, 610, 377, 987, 610, 1597, 987, 2584, 1597, 4181, 2584, 6765, 4181, 10946, 6765, 17711, 10946, 28657, 17711, 46368, 28657, 75025, 46368, 121393, 75025, 196418
Offset: 1

Views

Author

Roger L. Bagula, Oct 06 2006

Keywords

Comments

All terms are Fibonacci numbers A000045: a(2n-1) = Fibonacci(n), a(2n) = Fibonacci(n+2), a(2n-1) = a(2n+2). - Alexander Adamchuk, Oct 08 2006

Crossrefs

Programs

  • GAP
    a:=[1,2,1,3];; for n in [5..50] do a[n]:=a[n-2]+a[n-4]; od; a; # Muniru A Asiru, Oct 12 2018
  • Magma
    m:=50; R:=PowerSeriesRing(Integers(), m); Coefficients(R!(x*(1 + 2*x + x^3)/(1 - x^2 - x^4))); // G. C. Greubel, Oct 12 2018
    
  • Maple
    seq(coeff(series(-x*(1+2*x+x^3)/(x^4+x^2-1),x,n+1), x, n), n = 1 .. 50); # Muniru A Asiru, Oct 12 2018
  • Mathematica
    p[0, x] = 1; p[1, x] = x + 1; p[k_, x_] := p[k, x] = x*p[k - 1, x] + (-1)^(n + 1)p[k - 2, x]; Table[Sum[CoefficientList[p[n, x], x][[m]], {m, 1, n + 1}], {n, 0, 20}]
    Rest[Flatten[Reverse/@Partition[Fibonacci[Range[30]],2,1]]] (* Harvey P. Dale, Mar 19 2013 *)
  • PARI
    vector(50, n, fibonacci(3/4 -(-1)^(n+1)*3/4 +(n+1)/2)) \\ G. C. Greubel, Oct 12 2018
    

Formula

From Alexander Adamchuk, Oct 08 2006: (Start)
a(n) = Fibonacci(A028242(n+2)).
a(n) = Fibonacci(A030451(n+1)).
a(n) = Fibonacci(3/4 -(-1)^(n+1)*3/4 +(n+1)/2). (End)
a(n) = A053602(n+1) = A097594(n-5). - R. J. Mathar, Mar 08 2011
G.f. -x*(1+2*x+x^3) / ( -1+x^2+x^4 ). - R. J. Mathar, Mar 08 2011
a(n) = a(n-2) + a(n-4). - Muniru A Asiru, Oct 12 2018

Extensions

More terms from Alexander Adamchuk, Oct 08 2006
Previous Showing 11-20 of 58 results. Next