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

A000034 Period 2: repeat [1, 2]; a(n) = 1 + (n mod 2).

Original entry on oeis.org

1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2
Offset: 0

Views

Author

Keywords

Comments

Also continued fraction for (sqrt(3)+1)/2 (cf. A040001) and base-3 digital root of n+1 (cf. A007089, A010888). - Henry Bottomley, Jul 05 2001
The sequence 1,-2,-1,2,1,-2,-1,2,... with g.f. (1-2x)/(1+x^2) has a(n) = cos(Pi*n/2)-2*sin(Pi*n/2). - Paul Barry, Oct 18 2004
Hankel transform is [1,-3,0,0,0,0,0,0,0,...]. - Philippe Deléham, Mar 29 2007
4/33 = 0.121212... - Eric Desbiaux, Nov 03 2008
Let A be the Hessenberg matrix of order n, defined by: A[1,j]=A[i,i]:=1, A[i,i-1]=-1, and A[i,j]=0 otherwise. Then, for n>=1, a(n-1) = charpoly(A,2). - Milan Janjic, Jan 24 2010
First differences of A032766. - Tom Edgar, Jul 17 2014
Denominator of the harmonic mean of the first n triangular numbers. - Colin Barker, Nov 13 2014
This is the lexicographically earliest sequence of positive integers such that no polynomial of degree d can be fitted to d+2 consecutive terms (equivalently, such that no iterated difference is zero). - Pontus von Brömssen, Dec 26 2021 [See A300002 for the case where not only consecutive terms are considered. - Pontus von Brömssen, Jan 03 2023]
Number of maximum antichains in the power set of {1,2,...,n} partially ordered by set inclusion. For even n, there is a unique maximum antichain formed by all subsets of size n/2; for odd n, there are two maximum antichains, one formed by all subsets of size (n-1)/2 and the other formed by all subsets of size (n+1)/2. See the David Guichard link below for a proof. - Jianing Song, Jun 19 2022

References

  • Jozsef Beck, Combinatorial Games, Cambridge University Press, 2008.
  • J.-M. De Koninck and A. Mercier, 1001 Problèmes en Théorie Classique des Nombres, Problème 545 pages 73 and 260, Ellipses, Paris 2004.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. sequences listed in Comments section of A283393.

Programs

Formula

G.f.: (1+2*x)/(1-x^2).
a(n) = 2^((1-(-1)^n)/2) = 2^(ceiling(n/2) - floor(n/2)). - Paul Barry, Jun 03 2003
a(n) = (3-(-1)^n)/2; a(n) = 1 + (n mod 2) = 3-a(n-1) = a(n-2) = a(-n).
a(n) = gcd(n-1, n+1). - Paul Barry, Sep 16 2004
Binomial transform of A123344, inverse binomial transform of A003945. - Philippe Deléham, Jun 04 2007
a(n) = A134451(n+1). - Reinhard Zumkeller, Oct 27 2007
a(n) = if(n=0,1,if(mod(a(n-1),2)=0,a(n-1)/2,(3*a(n-1)+1)/2)). See Collatz conjecture. - Paul Barry, Mar 31 2008
a(n) = 2^n (mod 3). - Vincenzo Librandi, Feb 05 2011
a(n) = A000035(n) + 1. - M. F. Hasler, Jan 13 2012
a(n) = abs(sin(n*Pi/2) - 2*cos(n*Pi/2)). - Mohammad K. Azarian, Mar 12 2012
a(n) = A010704(n) / 3. - Reinhard Zumkeller, Jul 03 2012
a(n) = floor((4/33)*10^(n+1)) mod 10. - Hieronymus Fischer, Jan 03 2013
a(n) = floor((5/8)*3^(n+1)) mod 3. - Hieronymus Fischer, Jan 03 2013
a(n) = floor((n+1)*3/2) - floor((n)*3/2). - Hailey R. Olafson, Jul 23 2014
a(n) = denominator(n/2). - Wesley Ivan Hurt, Sep 11 2014
Dirichlet g.f.: zeta(s)*(1 + 1/2^s). - Mats Granvik, Jul 18 2016
E.g.f.: 2*sinh(x) + cosh(x). - Ilya Gutkovskiy, Jul 18 2016
a(n) = A010693(n) - 1. - Filip Zaludek, Oct 29 2016
a(n) = n + 1 - 2*floor(n/2). - Lorenzo Sauras Altuzarra, Jun 28 2019
Limit_{n->oo} (1/n)*Sum_{k=1..n} a(k) = 3/2 (De Koninck reference). - Bernard Schott, Nov 09 2021

Extensions

Better definition from M. F. Hasler, Jan 13 2012

A010685 Period 2: repeat (1,4).

Original entry on oeis.org

1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1
Offset: 0

Views

Author

Keywords

Comments

Continued fraction of (1 + sqrt(2))/2. - R. J. Mathar, Nov 21 2011
This sequence can be generated by an infinite number of formulas all having the form a^(b*n) mod c subject to the following conditions. The number a can be congruent to either 2,3, or 4 mod 5 (A047202). If a is congruent to 2 or 3 mod 5, then b can be any number of the form 4k+2 and c = 5 or 15. If a is congruent to 4 mod 5, then b can be any number of the form 2k+1 and c = 5. For example: a(n) = 29^(13*n) mod 5, a(n) = 24^(11*n) mod 5, and a(n) = 22^(10*n) mod 15. - Gary Detlefs, May 19 2014

Crossrefs

Cf. sequences listed in Comments section of A283393.
Cf. A047202.

Programs

  • Magma
    [Modexp(4,n,5): n in [0..100]]; // G. C. Greubel, Nov 22 2021
  • Maple
    A010685 := proc(n)
        if type(n,'even') then
            1 ;
        else
            4;
        end if;
    end proc: # R. J. Mathar, Aug 03 2015
  • Mathematica
    Table[(5-3(-1)^n)/2, {n, 0, 100}] (* Wesley Ivan Hurt, Mar 26 2014 *)
    PadRight[{},120,{1,4}] (* Harvey P. Dale, Aug 08 2022 *)
  • PARI
    values(m)=my(v=[]);for(i=1,m,v=concat([1,4],v));v; /* Anders Hellström, Aug 03 2015 */
    
  • Sage
    [power_mod(4,n,5)for n in range(0,81)] # Zerinvary Lajos, Nov 26 2009
    

Formula

a(2n) = 1, a(2n+1) = 4.
From Paul Barry, Jun 03 2003: (Start)
G.f.: (1+4*x)/((1-x)*(1+x)).
E.g.f.: (5*exp(x) - 3*exp(-x))/2.
a(n) = (5 - 3*(-1)^n)/2.
a(n) = 4^((1-(-1)^n)/2) = 2^(1-(-1)^n) = 2/(2^((-1)^n)).
a(n) = 4^(ceiling(n/2) - floor(n/2)). (End)
a(n) = gcd((n-1)^2, (n+1)^2). - Paul Barry, Sep 16 2004
a(n) = A160700(A000302(n)). - Reinhard Zumkeller, Jun 10 2009
a(n) = 4^n mod 5. - Zerinvary Lajos, Nov 26 2009
a(n) = 4^(n mod 2). - Wesley Ivan Hurt, Mar 29 2014

A010689 Periodic sequence: Repeat 1, 8.

Original entry on oeis.org

1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1
Offset: 0

Views

Author

Keywords

Comments

Also the digital root of 8^n. Also the decimal expansion of 2/11 = 0.181818181818... - Cino Hilliard, Dec 31 2004
Interleaving of A000012 and A010731. - Klaus Brockhaus, Apr 02 2010
Continued fraction expansion of (2 + sqrt(6))/4. - Klaus Brockhaus, Apr 02 2010
Digital root of the powers of any number congruent to 8 mod 9. - Alonso del Arte, Jan 26 2014

Examples

			0.18181818181818181818181818181818181818181...
		

References

  • Cecil Balmond, Number 9: The Search for the Sigma Code. Munich, New York: Prestel (1998): 203.

Crossrefs

Cf. A000012 (all 1's sequence), A010731 (all 8's sequence), A174925 (decimal expansion of (2 + sqrt(6))/4). [Klaus Brockhaus, Apr 02 2010]
Cf. Digital roots of powers of c mod 9: c = 2, A153130; c = 4, A100402; c = 5, A070366; c = 7, A070403.
Cf. sequences listed in Comments section of A283393.
Cf. A010888.

Programs

Formula

From Paul Barry, Sep 16 2004: (Start)
G.f.: (1 + 8*x)/((1 - x)*(1 + x)).
a(n) = (9 - 7*(-1)^n)/2.
a(n) = 8^(ceiling(n/2) - floor(n/2)).
a(n) = gcd((n-1)^3, (n+1)^3). (End)
E.g.f.: cosh(x) + 8*sinh(x). - Stefano Spezia, Feb 09 2025
a(n) = A010888(8*a(n-1)). - Stefano Spezia, Mar 20 2025

Extensions

Definition edited and keywords cons, cofr added by Klaus Brockhaus, Apr 02 2010

A129203 a(n) = numerator(3/(n+1)^3)*(3/2 + (-1)^n/2).

Original entry on oeis.org

6, 3, 2, 3, 6, 1, 6, 3, 2, 3, 6, 1, 6, 3, 2, 3, 6, 1, 6, 3, 2, 3, 6, 1, 6, 3, 2, 3, 6, 1, 6, 3, 2, 3, 6, 1, 6, 3, 2, 3, 6, 1, 6, 3, 2, 3, 6, 1, 6, 3, 2, 3, 6, 1, 6, 3, 2, 3, 6, 1, 6, 3, 2, 3, 6, 1, 6, 3, 2, 3, 6, 1, 6, 3, 2, 3, 6, 1, 6, 3, 2, 3, 6, 1
Offset: 0

Views

Author

Paul Barry, Apr 03 2007

Keywords

Comments

(1/(2*Pi))*Integral_{t=0..2*Pi} exp(i*(n+1)*t)*((t-Pi)/i)^3 = (A129202(n)*Pi^2 - a(n))/A129196(n), i=sqrt(-1).
Periodic with period 6. - Alois P. Heinz, Oct 03 2012

Crossrefs

Cf. sequences listed in Comments section of A283393.

Programs

  • GAP
    List(List([0..10],n->3/(n+1)^3*(3/2+(-1)^n/2)),NumeratorRat); # Muniru A Asiru, Jul 01 2018
  • Magma
    [Numerator(3/(n+1)^3)*(3/2 + (-1)^n/2): n in [1..100]]; // Vincenzo Librandi, Jul 01 2018
    
  • Magma
    &cat [[6, 3, 2, 3, 6, 1]^^20]; // Vincenzo Librandi, Jul 01 2018
    
  • Maple
    a:= n-> [6, 3, 2, 3, 6, 1][irem(n, 6)+1]:
    seq(a(n), n=0..119);  # Alois P. Heinz, Oct 03 2012
  • Mathematica
    Array[Numerator[3/(# + 1)^3] (3/2 + (-1)^#/2) &, 105, 0] (* or *)
    PadRight[{}, 105, {6, 3, 2, 3, 6, 1}] (* Michael De Vlieger, Jun 30 2018 *)
    CoefficientList[ Series[-(x^5 + 6x^4 + 3x^3 + 2x^2 + 3x + 6)/(x^6 - 1), {x, 0,
       105}], x] (* or *)
    LinearRecurrence[{0, 0, 0, 0, 0, 1}, {6, 3, 2, 3, 6, 1}, 105] (* Robert G. Wilson v, Jul 28 2018 *)
  • PARI
    a(n)=[6, 3, 2, 3, 6, 1][n%6+1] \\ Charles R Greathouse IV, Oct 28 2014
    
  • Sage
    def Gauss_factorial(N, n): return mul(j for j in (1..N) if gcd(j, n) == 1)
    def A129203(n): return Gauss_factorial(3, n+1)
    [A129203(j) for j in (0..71)] # Peter Luschny, Oct 01 2012
    

Formula

G.f.: (6 + 3*x + 2*x^2 + 3*x^3 + 6*x^4 + x^5)/(1 - x^6).
a(n) = cos(2*Pi*n/3) + sqrt(3)*sin(2*Pi*n/3) + cos(Pi*n/3)/3 - sqrt(3)*sin(Pi*n/3)/3 + 7*cos(Pi*n)/6 + 7/2.
a(n) = numerator(6/(n+1)^2). - Paul Barry, Apr 03 2007
a(n) = denominator of coefficient of x^6 in the Maclaurin expansion of -exp(-(n+1)*x^2). - Francesco Daddi, Aug 04 2011
a(n) = 3_(n+1)! = Gauss_factorial(3, n+1) = Product_{1<=j<=3, gcd(j,n+1)=1} j. - Peter Luschny, Oct 01 2012
a(n) = denominator((n+1)/6). - Jon Hearn, Nov 10 2013
a(n) = denominator of 2*(1/(12*n)+1)*n^n; related to gamma function approximation for positive integers less the factor sqrt(Pi/2)/(exp(n)*sqrt(n)). - Thomas Blankenhorn, Jun 21 2018
a(n) = 6/gcd(n+1,6). - Ridouane Oudra, Jul 29 2022

A129197 a(n) = numerator( 3*(3+(-1)^n)/(n+1)^3 ).

Original entry on oeis.org

12, 3, 4, 3, 12, 1, 12, 3, 4, 3, 12, 1, 12, 3, 4, 3, 12, 1, 12, 3, 4, 3, 12, 1, 12, 3, 4, 3, 12, 1, 12, 3, 4, 3, 12, 1, 12, 3, 4, 3, 12, 1, 12, 3, 4, 3, 12, 1, 12, 3, 4, 3, 12, 1, 12, 3, 4, 3, 12, 1, 12, 3, 4, 3, 12, 1, 12, 3, 4, 3, 12, 1, 12, 3, 4, 3, 12, 1
Offset: 0

Views

Author

Paul Barry, Apr 02 2007

Keywords

Comments

Denominator of 3*(3+(-1)^n)/(n+1)^3 is A129196.

Crossrefs

Cf. sequences listed in Comments section of A283393.

Programs

  • Mathematica
    Table[3 (3+(-1)^n)/(n+1)^3,{n,0,80}]//Numerator (* Harvey P. Dale, Sep 26 2020 *)

Formula

G.f.: (12 + 3*x + 4*x^2 + 3*x^3 + 12*x^4 + x^5)/(1 - x^6).
Period 6: repeat [12, 3, 4, 3, 12, 1].
Showing 1-5 of 5 results.