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

A040000 a(0)=1; a(n)=2 for n >= 1.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Dec 11 1999

Keywords

Comments

Continued fraction expansion of sqrt(2) is 1 + 1/(2 + 1/(2 + 1/(2 + ...))).
Inverse binomial transform of Mersenne numbers A000225(n+1) = 2^(n+1) - 1. - Paul Barry, Feb 28 2003
A Chebyshev transform of 2^n: if A(x) is the g.f. of a sequence, map it to ((1-x^2)/(1+x^2))A(x/(1+x^2)). - Paul Barry, Oct 31 2004
An inverse Catalan transform of A068875 under the mapping g(x)->g(x(1-x)). A068875 can be retrieved using the mapping g(x)->g(xc(x)), where c(x) is the g.f. of A000108. A040000 and A068875 may be described as a Catalan pair. - Paul Barry, Nov 14 2004
Sequence of electron arrangement in the 1s 2s and 3s atomic subshells. Cf. A001105, A016825. - Jeremy Gardiner, Dec 19 2004
Binomial transform of A165326. - Philippe Deléham, Sep 16 2009
Let m=2. We observe that a(n) = Sum_{k=0..floor(n/2)} binomial(m,n-2*k). Then there is a link with A113311 and A115291: it is the same formula with respectively m=3 and m=4. We can generalize this result with the sequence whose g.f. is given by (1+z)^(m-1)/(1-z). - Richard Choulet, Dec 08 2009
With offset 1: number of permutations where |p(i) - p(i+1)| <= 1 for n=1,2,...,n-1. This is the identical permutation and (for n>1) its reversal.
Equals INVERT transform of bar(1, 1, -1, -1, ...).
Eventual period is (2). - Zak Seidov, Mar 05 2011
Also decimal expansion of 11/90. - Vincenzo Librandi, Sep 24 2011
a(n) = 3 - A054977(n); right edge of the triangle in A182579. - Reinhard Zumkeller, May 07 2012
With offset 1: minimum cardinality of the range of a periodic sequence with (least) period n. Of course the range's maximum cardinality for a purely periodic sequence with (least) period n is n. - Rick L. Shepherd, Dec 08 2014
With offset 1: n*a(1) + (n-1)*a(2) + ... + 2*a(n-1) + a(n) = n^2. - Warren Breslow, Dec 12 2014
With offset 1: decimal expansion of gamma(4) = 11/9 where gamma(n) = Cp(n)/Cv(n) is the n-th Poisson's constant. For the definition of Cp and Cv see A272002. - Natan Arie Consigli, Sep 11 2016
a(n) equals the number of binary sequences of length n where no two consecutive terms differ. Also equals the number of binary sequences of length n where no two consecutive terms are the same. - David Nacin, May 31 2017
a(n) is the period of the continued fractions for sqrt((n+2)/(n+1)) and sqrt((n+1)/(n+2)). - A.H.M. Smeets, Dec 05 2017
Also, number of self-avoiding walks and coordination sequence for the one-dimensional lattice Z. - Sean A. Irvine, Jul 27 2020

Examples

			sqrt(2) = 1.41421356237309504... = 1 + 1/(2 + 1/(2 + 1/(2 + 1/(2 + ...)))). - _Harry J. Smith_, Apr 21 2009
G.f. = 1 + 2*x + 2*x^2 + 2*x^3 + 2*x^4 + 2*x^5 + 2*x^6 + 2*x^7 + 2*x^8 + ...
11/90 = 0.1222222222222222222... - _Natan Arie Consigli_, Sep 11 2016
		

References

  • A. Beiser, Concepts of Modern Physics, 2nd Ed., McGraw-Hill, 1973.
  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See p. 186.
  • Jan Gullberg, Mathematics from the Birth of Numbers, W. W. Norton & Co., NY & London, 1997, §4.4 Powers and Roots, p. 144.
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, pages 276-278.

Crossrefs

Convolution square is A008574.
See A003945 etc. for (1+x)/(1-k*x).
From Jaume Oliver Lafont, Mar 26 2009: (Start)
Sum_{0<=k<=n} a(k) = A005408(n).
Prod_{0<=k<=n} a(k) = A000079(n). (End)
Cf. A000674 (boustrophedon transform).
Cf. A001333/A000129 (continued fraction convergents).
Cf. A000122, A002193 (sqrt(2) decimal expansion), A006487 (Egyptian fraction).
Cf. Other continued fractions for sqrt(a^2+1) = (a, 2a, 2a, 2a....): A040002 (contfrac(sqrt(5)) = (2,4,4,...)), A040006, A040012, A040020, A040030, A040042, A040056, A040072, A040090, A040110 (contfrac(sqrt(122)) = (11,22,22,...)), A040132, A040156, A040182, A040210, A040240, A040272, A040306, A040342, A040380, A040420 (contfrac(sqrt(442)) = (21,42,42,...)), A040462, A040506, A040552, A040600, A040650, A040702, A040756, A040812, A040870, A040930 (contfrac(sqrt(962)) = (31,62,62,...)).

Programs

  • Haskell
    a040000 0 = 1; a040000 n = 2
    a040000_list = 1 : repeat 2  -- Reinhard Zumkeller, May 07 2012
  • Maple
    Digits := 100: convert(evalf(sqrt(2)),confrac,90,'cvgts'):
  • Mathematica
    ContinuedFraction[Sqrt[2],300] (* Vladimir Joseph Stephan Orlovsky, Mar 04 2011 *)
    a[ n_] := 2 - Boole[n == 0]; (* Michael Somos, Dec 28 2014 *)
    PadRight[{1},120,2] (* or *) RealDigits[11/90, 10, 120][[1]] (* Harvey P. Dale, Jul 12 2025 *)
  • PARI
    {a(n) = 2-!n}; /* Michael Somos, Apr 16 2007 */
    
  • PARI
    a(n)=1+sign(n)  \\ Jaume Oliver Lafont, Mar 26 2009
    
  • PARI
    allocatemem(932245000); default(realprecision, 21000); x=contfrac(sqrt(2)); for (n=0, 20000, write("b040000.txt", n, " ", x[n+1]));  \\ Harry J. Smith, Apr 21 2009
    

Formula

G.f.: (1+x)/(1-x). - Paul Barry, Feb 28 2003
a(n) = 2 - 0^n; a(n) = Sum_{k=0..n} binomial(1, k). - Paul Barry, Oct 16 2004
a(n) = n*Sum_{k=0..floor(n/2)} (-1)^k*binomial(n-k, k)*2^(n-2*k)/(n-k). - Paul Barry, Oct 31 2004
A040000(n) = Sum_{k=0..floor(n/2)} binomial(n-k, k)*(-1)^k*A068875(n-k). - Paul Barry, Nov 14 2004
From Michael Somos, Apr 16 2007: (Start)
Euler transform of length 2 sequence [2, -1].
G.f. A(x) satisfies 0 = f(A(x), A(x^2), A(x^4)) where f(u, v, w) = (u-v)*(u+v) - 2*v*(u-w).
E.g.f.: 2*exp(x) - 1.
a(n) = a(-n) for all n in Z (one possible extension to n<0). (End)
G.f.: (1-x^2)/(1-x)^2. - Jaume Oliver Lafont, Mar 26 2009
G.f.: exp(2*atanh(x)). - Jaume Oliver Lafont, Oct 20 2009
a(n) = Sum_{k=0..n} A108561(n,k)*(-1)^k. - Philippe Deléham, Nov 17 2013
a(n) = 1 + sign(n). - Wesley Ivan Hurt, Apr 16 2014
10 * 11/90 = 11/9 = (11/2 R)/(9/2 R) = Cp(4)/Cv(4) = A272005/A272004, with R = A081822 (or A070064). - Natan Arie Consigli, Sep 11 2016
a(n) = A001227(A000040(n+1)). - Omar E. Pol, Feb 28 2018

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

Original entry on oeis.org

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

Views

Author

Paul Barry, Oct 25 2005

Keywords

Comments

Row sums of A113310.
Let m=3. We observe that a(n)=Sum_{k=0..floor(n/2)} C(m,n-2*k). Then there is a link with A040000 and A115291: it is the same formula with respectively m=2 and m=4. We can generalize this result with the sequence whose g.f. is given by (1+z)^(m-1)/(1-z). - Richard Choulet, Dec 08 2009
Also continued fraction expansion of (3+sqrt(5))/4. - Bruno Berselli, Sep 23 2011
Also decimal expansion of 121/900. - Vincenzo Librandi, Sep 24 2011

Crossrefs

Programs

Formula

a(n) = Sum_{k=0..n} Sum_{i=0..n-k} (-1)^i*C(i+k-2, i).
E.g.f.: 4*exp(x) - x - 3. - Elmo R. Oliveira, Aug 08 2024

Extensions

Spelling/notation corrections by Charles R Greathouse IV, Mar 18 2010

A002663 a(n) = 2^n - C(n,0) - C(n,1) - C(n,2) - C(n,3).

Original entry on oeis.org

0, 0, 0, 0, 1, 6, 22, 64, 163, 382, 848, 1816, 3797, 7814, 15914, 32192, 64839, 130238, 261156, 523128, 1047225, 2095590, 4192510, 8386560, 16774891, 33551806, 67105912, 134214424, 268431773, 536866822, 1073737298
Offset: 0

Views

Author

Keywords

Comments

Starting with "1" = eigensequence of a triangle with bin(n,4), A000332 as the left border: (1, 5, 15, 35, 70, ...) and the rest 1's. - Gary W. Adamson, Jul 24 2010
The Kn25 sums, see A180662, of triangle A065941 equal the terms (doubled) of this sequence minus the four leading zeros. - Johannes W. Meijer, Aug 14 2011
(1 + 6x + 22x^2 + 64x^3 + ...) = (1 + 3x + 6x^2 + 10x^3 + ...) * (1 + 3x + 7x^2 + 15x^3 + ...). - Gary W. Adamson, Mar 14 2012
The sequence starting (1, 6, 22, ...) is the binomial transform of A171418 and starting (0, 0, 0, 1, 6, 22, ...) is the binomial transform of (0, 0, 0, 1, 2, 2, 2, 2, 2, ...). - Gary W. Adamson, Jul 27 2015
Number of binary sequences with at least four 0's. - Enrique Navarrete, Jul 23 2025

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

a(n)= A055248(n, 4). Partial sums of A002662.

Programs

  • Haskell
    a002663 n = a002663_list !! n
    a002663_list = map (sum . drop 4) a007318_tabl
    -- Reinhard Zumkeller, Jun 20 2015
    
  • Magma
    [2^n - Binomial(n,0)- Binomial(n,1) - Binomial(n,2) - Binomial(n,3): n in [0..35]]; // Vincenzo Librandi, May 20 2011
    
  • Maple
    A002663 := proc(n): 2^n - add(binomial(n,k),k=0..3) end: seq(A002663(n), n=0..30); # Johannes W. Meijer, Aug 14 2011
  • Mathematica
    a=1;lst={};s1=s2=s3=s4=0;Do[s1+=a;s2+=s1;s3+=s2;s4+=s3;AppendTo[lst,s4];a=a*2,{n,5!}];lst (* Vladimir Joseph Stephan Orlovsky, Jan 10 2009 *)
    Table[Sum[ Binomial[n + 4, k + 4], {k, 0, n}], {n, -4, 26}] (* Zerinvary Lajos, Jul 08 2009 *)
  • PARI
    a(n)=(6*2^n-n^3-5*n-6)/6 \\ Charles R Greathouse IV, Sep 24 2015

Formula

a(n) = 2^n - A000125(n).
G.f.: x^4/((1-2*x)*(1-x)^4). - Simon Plouffe in his 1992 dissertation
a(n) = Sum_{k=0..n} binomial(n,k+4) = Sum_{k=4..n} binomial(n,k). - Paul Barry, Aug 23 2004
a(n) = 2*a(n-1) + binomial(n-1,3). - Paul Barry, Aug 23 2004
a(n) = (6*2^n - n^3 - 5*n - 6)/6. - Mats Granvik, Gary W. Adamson, Feb 17 2010
From Enrique Navarrete, Jul 23 2025: (Start)
a(n) = 6*a(n-1) - 14*a(n-2) + 16*a(n-3) - 9*a(n-4) + 2*a(n-5).
E.g.f.: exp(x)*(exp(x) - 1 - x - x^2/2 - x^3/6). (End)

A115291 Expansion of (1+x)^3/(1-x).

Original entry on oeis.org

1, 4, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8
Offset: 0

Views

Author

Paul Barry, Jan 19 2006

Keywords

Comments

Partial sums are A086570. Partial sums of squares are A115295. Correlation triangle is A115292.
Let m=4. We observe that a(n) = Sum_{k=0..floor(n/2)} C(m,n-2*k). Then there is a link with A113311 and A040000: it is the same formula with respectively m=3 and m=2. We can generalize this result with the sequence whose G.f is given by (1+z)^(m-1)/(1-z). - Richard Choulet, Dec 08 2009
Also continued fraction expansion of (132-sqrt(17))/103. - Bruno Berselli, Sep 23 2011
Also decimal expansion of 1331/9000. - Vincenzo Librandi, Sep 23 2011

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[(1+x)^3/(1-x),{x,0,100}],x] (* or *) PadRight[ {1,4,7},120,{8}] (* Harvey P. Dale, May 23 2016 *)

Formula

a(n) = 8 - C(2, n) - 2*C(1, n) - 4*C(0, n).
a(n) = Sum_{k=0..n} C(3, k).
a(n) = A004070(n, 3).
From Elmo R. Oliveira, Aug 09 2024: (Start)
E.g.f.: 8*exp(x) - 7 - 4*x - x^2/2.
a(n) = 8, n > 2. (End)

A171440 Expansion of (1+x)^5/(1-x).

Original entry on oeis.org

1, 6, 16, 26, 31, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32
Offset: 0

Views

Author

Richard Choulet, Dec 09 2009

Keywords

Comments

a(n)=2^5=32 for n>=5. We observe that this sequence is the transform of A171418 by T such that: T(u_0,u_1,u_2,u_3,u_4,u_5,...)=(u_0,u_0+u_1,u_1+u_2,u_2+u_3,u_3+u_4,...).
Also continued fraction expansion of (229657824-sqrt(257))/197139199. - Bruno Berselli, Sep 23 2011

Examples

			a(4) = C(6,4-0)+C(6,4-2)+C(6,4-4) = 15+15+1 = 31.
		

Crossrefs

Programs

  • Mathematica
    PadRight[{1,6,16,26,31},100,32] (* Harvey P. Dale, Oct 01 2013 *)

Formula

With m=6, a(n) = Sum_{k=0..floor(n/2)} binomial(m,n-2*k).

Extensions

Definition rewritten by Bruno Berselli, Sep 23 2011

A171443 Expansion of g.f. (1+x)^8/(1-x).

Original entry on oeis.org

1, 9, 37, 93, 163, 219, 247, 255, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256
Offset: 0

Views

Author

Richard Choulet, Dec 09 2009

Keywords

Comments

a(n)=2^8=256 for n>=8. We observe that this sequence is the transform of A171442 by T such that: T(u_0,u_1,u_2,u_3,u_4,u_5,...)=(u_0,u_0+u_1,u_1+u_2,u_2+u_3,u_3+u_4,...).

Examples

			a(7) = C(9,7-0)+C(9,7-2)+C(9,7-4)+C(9,7-6) = 36+126+84+9 = 255.
		

Crossrefs

Programs

  • Maple
    m:=9:for n from 0 to 40 do a(n):=sum('binomial(m,n-2*k)',k=0..floor(n/2)): od : seq(a(n),n=0..40);
  • Mathematica
    CoefficientList[Series[(1+x)^8/(1-x),{x,0,80}],x] (* Harvey P. Dale, Jul 22 2014 *)

Formula

With m=9, a(n) = Sum_{k=0..floor(n/2)} binomial(m,n-2*k).

Extensions

Definition rewritten by Bruno Berselli, Sep 23 2011

A171441 Expansion of g.f. (1+x)^6/(1-x).

Original entry on oeis.org

1, 7, 22, 42, 57, 63, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64
Offset: 0

Views

Author

Richard Choulet, Dec 09 2009

Keywords

Comments

a(n)=2^6=64 for n>=6. We observe that this sequence is the transform of A171440 by T such that: T(u_0,u_1,u_2,u_3,u_4,u_5,...)=(u_0,u_0+u_1,u_1+u_2,u_2+u_3,u_3+u_4,...).
Also continued fraction expansion of 1+(1233212607598+5*sqrt(41))/8688482797079. - Bruno Berselli, Sep 23 2011

Examples

			a(4) = C(7,4-0) + C(7,4-2) + C(7,4-4) = 35+21+1 = 57.
		

Crossrefs

Programs

  • Maple
    m:=7:for n from 0 to 40 do a(n):=sum('binomial(m,n-2*k)',k=0..floor(n/2)): od : seq(a(n),n=0..40);

Formula

With m=7, a(n) = Sum_{k=0..floor(n/2)} binomial(m,n-2*k).

Extensions

Definition rewritten by Bruno Berselli, Sep 23 2011

A171442 Expansion of (1+x)^7/(1-x).

Original entry on oeis.org

1, 8, 29, 64, 99, 120, 127, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128
Offset: 0

Views

Author

Richard Choulet, Dec 09 2009

Keywords

Comments

a(n)=2^7=128 for n>=7. We observe that this sequence is the transform of A171441 by T such that: T(u_0,u_1,u_2,u_3,u_4,u_5,...)=(u_0,u_0+u_1,u_1+u_2,u_2+u_3,u_3+u_4,...).

Examples

			a(5) = C(8,5-0)+C(8,5-2)+C(8,5-4) = 56+56+8 = 120.
		

Crossrefs

Programs

  • Maple
    m:=8:for n from 0 to 40 do a(n):=sum('binomial(m,n-2*k)',k=0..floor(n/2)): od : seq(a(n),n=0..40);
  • Mathematica
    CoefficientList[Series[(1+x)^7/(1-x),{x,0,60}],x] (* Harvey P. Dale, Apr 30 2012 *)

Formula

With m=8, a(n) = Sum_{k=0..floor(n/2)} binomial(m,n-2*k).

Extensions

Definition rewritten by Bruno Berselli, Sep 23 2011

A171445 Expansion of g.f. (1+z)^(24)/(1-z).

Original entry on oeis.org

1, 25, 301, 2325, 12951, 55455, 190051, 536155, 1271626, 2579130, 4540386, 7036530, 9740686, 12236830, 14198086, 15505590, 16241061, 16587165, 16721761, 16764265, 16774891, 16776915, 16777191, 16777215, 16777216, 16777216
Offset: 0

Views

Author

Richard Choulet, Dec 09 2009

Keywords

Comments

a(n)=2^(24)=16777216 for n>=24. We observe that this sequence is the transform of A171443 by the iterated T^(16) of T such that: T(u_0,u_1,u_2,u_3,u_4,u_5,...)=(u_0,u_0+u_1,u_1+u_2,u_2+u_3,u_3+u_4,...).

Examples

			a(3) = C(25,3)+C(25,3-2) = 2325.
		

Crossrefs

Programs

  • Maple
    m:=25:for n from 0 to 40 do a(n):=sum('binomial(m,n-2*k)',k=0..floor(n/2)): od : seq(a(n),n=0..40);
  • Mathematica
    CoefficientList[Series[(1+x)^24/(1-x),{x,0,30}],x] (* Harvey P. Dale, Jun 11 2019 *)

Formula

With m=25, a(n) = Sum_{k=0..floor(n/2)} binomial(m,n-2*k).
Showing 1-9 of 9 results.