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.

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

This page as a plain text file.
%I A040000 #181 Jul 28 2025 08:57:34
%S A040000 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,
%T A040000 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,
%U A040000 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
%N A040000 a(0)=1; a(n)=2 for n >= 1.
%C A040000 Continued fraction expansion of sqrt(2) is 1 + 1/(2 + 1/(2 + 1/(2 + ...))).
%C A040000 Inverse binomial transform of Mersenne numbers A000225(n+1) = 2^(n+1) - 1. - _Paul Barry_, Feb 28 2003
%C A040000 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
%C A040000 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
%C A040000 Sequence of electron arrangement in the 1s 2s and 3s atomic subshells. Cf. A001105, A016825. - _Jeremy Gardiner_, Dec 19 2004
%C A040000 Binomial transform of A165326. - _Philippe Deléham_, Sep 16 2009
%C A040000 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
%C A040000 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.
%C A040000 Equals INVERT transform of bar(1, 1, -1, -1, ...).
%C A040000 Eventual period is (2). - _Zak Seidov_, Mar 05 2011
%C A040000 Also decimal expansion of 11/90. - _Vincenzo Librandi_, Sep 24 2011
%C A040000 a(n) = 3 - A054977(n); right edge of the triangle in A182579. - _Reinhard Zumkeller_, May 07 2012
%C A040000 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
%C A040000 With offset 1: n*a(1) + (n-1)*a(2) + ... + 2*a(n-1) + a(n) = n^2. - _Warren Breslow_, Dec 12 2014
%C A040000 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
%C A040000 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
%C A040000 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
%C A040000 Also, number of self-avoiding walks and coordination sequence for the one-dimensional lattice Z. - _Sean A. Irvine_, Jul 27 2020
%D A040000 A. Beiser, Concepts of Modern Physics, 2nd Ed., McGraw-Hill, 1973.
%D A040000 John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See p. 186.
%D A040000 Jan Gullberg, Mathematics from the Birth of Numbers, W. W. Norton & Co., NY & London, 1997, §4.4 Powers and Roots, p. 144.
%D A040000 James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, pages 276-278.
%H A040000 Harry J. Smith, <a href="/A040000/b040000.txt">Table of n, a(n) for n = 0..20000</a>
%H A040000 Paul Barry, <a href="http://www.cs.uwaterloo.ca/journals/JIS/VOL8/Barry/barry84.html">A Catalan Transform and Related Transformations on Integer Sequences</a>, Journal of Integer Sequences, Vol. 8 (2005), Article 05.4.5.
%H A040000 Bruce Fang, Pamela E. Harris, Brian M. Kamau, and David Wang, <a href="https://arxiv.org/abs/2402.02538">Vacillating parking functions</a>, arXiv:2402.02538 [math.CO], 2024.
%H A040000 Kshitij Education, <a href="https://web.archive.org/web/20171219234500/http://www.kshitij-iitjee.com/molar-specific-heat-of-an-ideal-gas">Molar specific heat</a>.
%H A040000 MathPath, <a href="https://web.archive.org/web/20150911210941/http://www.mathpath.org/Algor/squareroot/algor.square.root.contfrac.htm">Square-roots via Continued Fractions</a>.
%H A040000 Narad Rampersad and Max Wiebe, <a href="https://arxiv.org/abs/2309.04012">Sums of products of binomial coefficients mod 2 and 2-regular sequences</a>, arXiv:2309.04012 [math.NT], 2023.
%H A040000 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/SquareRoot.html">Square root</a>.
%H A040000 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PythagorassConstant.html">Pythagoras's Constant</a>.
%H A040000 Wikipedia, <a href="https://en.wikipedia.org/wiki/Heat_capacity_ratio">Poisson's constant</a>.
%H A040000 G. Xiao, <a href="http://wims.unice.fr/~wims/en_tool~number~contfrac.en.html">Contfrac</a>.
%H A040000 <a href="/index/Con#confC">Index entries for continued fractions for constants</a>.
%H A040000 <a href="/index/Con#constant">Index entries for eventually constant sequences</a>.
%H A040000 <a href="/index/Di#divseq">Index to divisibility sequences</a>.
%H A040000 <a href="/index/Rec#order_01">Index entries for linear recurrences with constant coefficients</a>, signature (1).
%F A040000 G.f.: (1+x)/(1-x). - _Paul Barry_, Feb 28 2003
%F A040000 a(n) = 2 - 0^n; a(n) = Sum_{k=0..n} binomial(1, k). - _Paul Barry_, Oct 16 2004
%F A040000 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
%F A040000 A040000(n) = Sum_{k=0..floor(n/2)} binomial(n-k, k)*(-1)^k*A068875(n-k). - _Paul Barry_, Nov 14 2004
%F A040000 From _Michael Somos_, Apr 16 2007: (Start)
%F A040000 Euler transform of length 2 sequence [2, -1].
%F A040000 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).
%F A040000 E.g.f.: 2*exp(x) - 1.
%F A040000 a(n) = a(-n) for all n in Z (one possible extension to n<0). (End)
%F A040000 G.f.: (1-x^2)/(1-x)^2. - _Jaume Oliver Lafont_, Mar 26 2009
%F A040000 G.f.: exp(2*atanh(x)). - _Jaume Oliver Lafont_, Oct 20 2009
%F A040000 a(n) = Sum_{k=0..n} A108561(n,k)*(-1)^k. - _Philippe Deléham_, Nov 17 2013
%F A040000 a(n) = 1 + sign(n). - _Wesley Ivan Hurt_, Apr 16 2014
%F A040000 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
%F A040000 a(n) = A001227(A000040(n+1)). - _Omar E. Pol_, Feb 28 2018
%e A040000 sqrt(2) = 1.41421356237309504... = 1 + 1/(2 + 1/(2 + 1/(2 + 1/(2 + ...)))). - _Harry J. Smith_, Apr 21 2009
%e A040000 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 + ...
%e A040000 11/90 = 0.1222222222222222222... - _Natan Arie Consigli_, Sep 11 2016
%p A040000 Digits := 100: convert(evalf(sqrt(2)),confrac,90,'cvgts'):
%t A040000 ContinuedFraction[Sqrt[2],300] (* _Vladimir Joseph Stephan Orlovsky_, Mar 04 2011 *)
%t A040000 a[ n_] := 2 - Boole[n == 0]; (* _Michael Somos_, Dec 28 2014 *)
%t A040000 PadRight[{1},120,2] (* or *) RealDigits[11/90, 10, 120][[1]] (* _Harvey P. Dale_, Jul 12 2025 *)
%o A040000 (PARI) {a(n) = 2-!n}; /* _Michael Somos_, Apr 16 2007 */
%o A040000 (PARI) a(n)=1+sign(n)  \\ _Jaume Oliver Lafont_, Mar 26 2009
%o A040000 (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
%o A040000 (Haskell)
%o A040000 a040000 0 = 1; a040000 n = 2
%o A040000 a040000_list = 1 : repeat 2  -- _Reinhard Zumkeller_, May 07 2012
%Y A040000 Convolution square is A008574.
%Y A040000 See A003945 etc. for (1+x)/(1-k*x).
%Y A040000 From _Jaume Oliver Lafont_, Mar 26 2009: (Start)
%Y A040000 Sum_{0<=k<=n} a(k) = A005408(n).
%Y A040000 Prod_{0<=k<=n} a(k) = A000079(n). (End)
%Y A040000 Cf. A113311, A115291, A171418, A171440, A171441, A171442, A171443.
%Y A040000 Cf. A000674 (boustrophedon transform).
%Y A040000 Cf. A001333/A000129 (continued fraction convergents).
%Y A040000 Cf. A000122, A002193 (sqrt(2) decimal expansion), A006487 (Egyptian fraction).
%Y A040000 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,...)).
%K A040000 nonn,cofr,easy,cons
%O A040000 0,2
%A A040000 _N. J. A. Sloane_, Dec 11 1999