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 21-27 of 27 results.

A278928 Decimal expansion of sqrt(sqrt(2) + 1).

Original entry on oeis.org

1, 5, 5, 3, 7, 7, 3, 9, 7, 4, 0, 3, 0, 0, 3, 7, 3, 0, 7, 3, 4, 4, 1, 5, 8, 9, 5, 3, 0, 6, 3, 1, 4, 6, 9, 4, 8, 1, 6, 4, 5, 8, 3, 4, 9, 9, 4, 1, 0, 3, 0, 7, 8, 3, 6, 3, 3, 2, 6, 7, 1, 1, 4, 8, 3, 3, 3, 6, 7, 5, 2, 5, 6, 7, 8, 8, 7, 3, 3, 1, 0, 2, 7, 2, 7, 9
Offset: 1

Views

Author

Bobby Jacobs, Dec 01 2016

Keywords

Comments

A quartic integer with minimal polynomial x^4 - 2*x^2 - 1. - Charles R Greathouse IV, Dec 01 2016
Suppose f(n) has the recurrence f(2*n) = f(2*n - 1) + f(2*n - 2) and f(2*n + 1) = f(2*n) + f(2*n - 2), where f(0) and f(1) are not both 0. Then, lim_{n -> oo} f(n)^(1/n) is this constant.
Apart from the first digit, the same as A190283. - R. J. Mathar, Dec 09 2016
Imaginary part of sqrt(1 + i)^3, where i is the imaginary unit such that i^2 = -1. See A154747 for real part. - Alonso del Arte, Sep 09 2019

Examples

			1.553773974030037307344158953063146948164583499410307836332671...
		

References

  • Steven R. Finch, Mathematical Constants, Encyclopedia of Mathematics and its Applications, vol. 94, Cambridge University Press, 2003, Section 7.4, p. 466.

Crossrefs

Cf. A309948 and A309949 for real and imaginary parts of sqrt(1 + i).

Programs

Formula

Equals 1/A154747.
Limit_{n -> oo} A002965(n)^(1/n).
From Peter Bala, Jul 01 2024: (Start)
This constant occurs in the evaluation of Integral_{x = 0..Pi/2} 1/(1 + sin^4(x)) dx = Pi/4 * sqrt(sqrt(2) + 1).
Equals 2*Sum_{n >= 0} (-1/16)^n * binomial(4*n, 2*n) (a slowly converging series). (End)
Equals 2^(3/4)*cos(Pi/8). - Vaclav Kotesovec, Jul 01 2024
Equals Product_{k>=0} coth(Pi/4 + k*Pi/2). - Antonio GraciĆ” Llorente, Dec 19 2024
Equals sqrt(A014176) = 1/A154747 = exp(A245592). - Hugo Pfoertner, Dec 19 2024

A331101 Denominators of the best approximations for sqrt(2).

Original entry on oeis.org

1, 2, 3, 5, 12, 17, 29, 70, 99, 169, 408, 577, 985, 2378, 3363, 5741, 13860, 19601, 33461, 80782, 114243, 195025, 470832, 665857, 1136689, 2744210, 3880899, 6625109, 15994428, 22619537, 38613965, 93222358, 131836323, 225058681, 543339720, 768398401, 1311738121, 3166815962
Offset: 1

Views

Author

Gerhard Kirchner, Jan 09 2020

Keywords

Comments

For numerators, see A331115.
Let w = sqrt(2). Each of the principal convergents 1/1, 3/2, 7/5, 17/12, ..., see A002965, represents a best approximation for w because no other fraction with a smaller denominator is closer to w.
However, with abs(3/2 - w) > abs(4/3 - w)> abs(7/5 - w), 4/3 is another best approximation which has to be inserted. Generally, after each principal convergent p/q, we must insert the correspondent intermediate convergent 2q/p = (2/1), 4/3, (10/7), 24/17, ..., if it is closer to w than p/q (terms without brackets).
It is a well-known fact that the geometric mean sqrt(a*b) of two factors a and b is closer to the smaller one. As w is the geometric mean of p/q and 2q/p, the second term is inserted if it is smaller than p/q. This applies to every second intermediate convergent because the principal convergents alternately undershoot and overshoot w.

Examples

			The fractions are 1/1, 3/2, 4/3, 7/5, 17/12, 24/17, ...
Let w = sqrt(2) again. The first four principal convergents are, see comments, 1/1 (which is less than w), 3/2 (greater than w), 7/5 (less than w), 17/12 (greater than w). After 3/2, the fraction 2 * 2/3 = 4/3 is inserted because 4/3 < 3/2 and therefore w - 4/3 < 3/2 - w (0.081... < 0.085...). After 7/5, the fraction 2 * 5/7 = 10/7 is not inserted, because 10/7 > 7/5 etc.
		

Crossrefs

Programs

  • PARI
    Vec(x*(1 + 2*x + 3*x^2 - x^3 - x^5) / (1 - 6*x^3 + x^6) + O(x^40)) \\ Colin Barker, Jan 09 2020

Formula

If n mod 3 = 2: a(n) = 3*a(n - 1) - a(n - 2), otherwise: a(n) = a(n - 1) + a(n - 2), with a(1) = 1, a(2) = 2.
a(3n - 2) = w/4*D(2n - 1), a(3n - 1) = w/4*D(2n), a(3n) = 1/2*S(2n), for n>0 with w = sqrt(2) and S(n) = (1 + w)^n + (1 - w)^n and D(n) = (1 + w)^n - (1 - w)^n.
From Colin Barker, Jan 09 2020: (Start)
G.f.: x*(1 + 2*x + 3*x^2 - x^3 - x^5) / (1 - 6*x^3 + x^6).
a(n) = 6*a(n - 3) - a(n - 6) for n > 6.
(End)

A331115 Numerators of the best approximations for sqrt(2).

Original entry on oeis.org

1, 3, 4, 7, 17, 24, 41, 99, 140, 239, 577, 816, 1393, 3363, 4756, 8119, 19601, 27720, 47321, 114243, 161564, 275807, 665857, 941664, 1607521, 3880899, 5488420, 9369319, 22619537, 31988856, 54608393, 131836323, 186444716, 318281039, 768398401, 1086679440, 1855077841, 4478554083, 6333631924
Offset: 1

Views

Author

Gerhard Kirchner, Jan 10 2020

Keywords

Comments

Every principal convergent, see A002965, and every second intermediate convergent is a best approximation for sqrt(2). The numerators of these convergents are the terms of the current sequence. For denominators and more details, see A331101.

Examples

			The principal convergents are 1/1, 3/2, 7/5, 17/12, ... and 1,3,7,17,... the corresponding numerators, see A001333. Intermediate convergents: (2/1), 4/3, (10/7), 24/17, ... (best approximations without brackets). Numerators: 4,24,... (subsequence of A143607). All these numerators sorted: 1,3,4,7,17,24,...
		

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{0,0,6,0,0,-1},{1,3,4,7,17,24},50] (* Harvey P. Dale, Nov 26 2024 *)
  • PARI
    Vec(x*(1 + x)*(1 + 2*x + 2*x^2 - x^3) / (1 - 6*x^3 + x^6) + O(x^40)) \\ Colin Barker, Jan 10 2020

Formula

If n mod 3 = 2: a(n) = 3*a(n-1) - a(n-2), otherwise: a(n) = a(n-1) + a(n-2), for n>2 with a(1)=1, a(2)=3.
a(3n-2) = 1/2*S(2n-1), a(3n-1) = 1/2*S(2n), a(3n) = w/2*D(2n), for n>0 with w = sqrt(2) and S(n) = (1+w)^n + (1-w)^n and D(n) = (1+w)^n - (1-w)^n.
From Colin Barker, Jan 10 2020: (Start)
G.f.: x*(1 + x)*(1 + 2*x + 2*x^2 - x^3) / (1 - 6*x^3 + x^6).
a(n) = 6*a(n-3) - a(n-6) for n>6.
(End)

A142879 a(n) = 5*a(n-3) - a(n-6) with terms 1..6 as 0, 1, 2, 5, 7, 9.

Original entry on oeis.org

0, 1, 2, 5, 7, 9, 25, 34, 43, 120, 163, 206, 575, 781, 987, 2755, 3742, 4729, 13200, 17929, 22658, 63245, 85903, 108561, 303025, 411586, 520147, 1451880, 1972027, 2492174, 6956375, 9448549, 11940723, 33329995, 45270718, 57211441, 159693600
Offset: 1

Views

Author

Roger L. Bagula and Gary W. Adamson, Sep 28 2008

Keywords

Crossrefs

Programs

  • Mathematica
    Clear[a, n]; a[0] = 0; a[1] = 1; a[n_] := a[n] = If[Mod[n, 3] == 0, 2*a[n - 1] + a[n - 2], If[Mod[n, 3] == 1, a[n - 1] + a[n - 2], 2*a[n - 1] - a[n - 2]]]; b = Table[a[n], {n, 0, 50}]
    LinearRecurrence[{0,0,5,0,0,-1},{0,1,2,5,7,9},40] (* Harvey P. Dale, Apr 06 2016 *)
  • PARI
    a=vector(20); a[1]=1; a[2]=2; for(n=3, #a, if(n%3==0, a[n]=2*a[n-1]+a[n-2], if(n%3==1, a[n]=a[n-1]+a[n-2], a[n]=2*a[n-1]-a[n-2]))); concat(0, a) \\ Colin Barker, Jan 30 2016
    
  • PARI
    concat(0, Vec(x^2*(1+2*x+5*x^2+2*x^3-x^4)/(1-5*x^3+x^6) + O(x^50))) \\ Colin Barker, Jan 30 2016

Formula

a(n) = 2*a(n - 1) + a(n - 2) if 3 | n, a(n) = a(n - 1) + a(n - 2) if n = 1 mod 3, and a(n) = 2*a(n - 1) - a(n - 2) if n = 2 mod 3.
G.f.: x^2*(1+2*x+5*x^2+2*x^3-x^4) / (1-5*x^3+x^6). - Colin Barker, Jan 08 2013

Extensions

New name from Colin Barker and Charles R Greathouse IV, Jan 08 2013

A142881 a(0) = 0, a(1) = 1, after which, if n=3k: a(n) = 2*a(n-1) - a(n-2), if n=3k+1: a(n) = a(n-1) + a(n-2), if n=3k+2: a(n) = 2*a(n-1) + a(n-2).

Original entry on oeis.org

0, 1, 2, 3, 5, 13, 21, 34, 89, 144, 233, 610, 987, 1597, 4181, 6765, 10946, 28657, 46368, 75025, 196418, 317811, 514229, 1346269, 2178309, 3524578, 9227465, 14930352, 24157817, 63245986, 102334155, 165580141, 433494437, 701408733, 1134903170
Offset: 0

Views

Author

Roger L. Bagula and Gary W. Adamson, Sep 28 2008

Keywords

Comments

The original name of the sequence was: A modulo three switched recursion (third kind): a(n)=If[Mod[n, 3] ==2, 2*a(n - 1) + a(n - 2), If[Mod[n, 3] == 1, a(n - 1) + a(n - 2), 2*a(n - 1) - a(n - 2)]].
How is this related to A000045 ? - Antti Karttunen, Jan 29 2016

Crossrefs

Programs

  • Mathematica
    Clear[a, n]; a[0] = 0; a[1] = 1; a[n_] := a[n] = If[Mod[n, 3] == 2, 2*a[n - 1] + a[n - 2], If[Mod[n, 3] == 1, a[n - 1] + a[n - 2], 2*a[n - 1] - a[n - 2]]]; b = Table[a[n], {n, 0, 50}]
  • PARI
    a=vector(100); a[1]=1; a[2]=2; for(n=3, #a, if(n%3==0, a[n]=2*a[n-1]-a[n-2], if(n%3==1, a[n]=a[n-1]+a[n-2], a[n]=2*a[n-1]+a[n-2]))); concat(0, a) \\ Colin Barker, Jan 30 2016

Formula

a(n) = If[Mod[n, 3] == 2, 2*a(n - 1) + a(n - 2), If[Mod[n, 3] == 1, a(n - 1) + a(n - 2), 2*a(n - 1) - a(n - 2)]].
a(n) = 7*a(n-3)-a(n-6). G.f.: -x^2*(x^4+2*x^3-3*x^2-2*x-1) / (x^6-7*x^3+1). [Colin Barker, Jan 08 2013]
a(0) = 0, a(1) = 1, after which, if n is a multiple of 3, a(n) = 2*a(n-1) - a(n-2), else, if n is of the form 3k+1, a(n) = a(n-1) + a(n-2), and otherwise [when n is of the form 3k+2], a(n) = 2*a(n-1) + a(n-2). - Antti Karttunen, Jan 29 2016, after the original name of the sequence.

Extensions

Offset corrected and sequence edited by Antti Karttunen, Jan 29 2016

A142880 a(n) = 7*a(n-3) - a(n-6).

Original entry on oeis.org

0, 1, 2, 3, 8, 13, 21, 55, 89, 144, 377, 610, 987, 2584, 4181, 6765, 17711, 28657, 46368, 121393, 196418, 317811, 832040, 1346269, 2178309, 5702887, 9227465, 14930352, 39088169, 63245986, 102334155, 267914296, 433494437, 701408733, 1836311903
Offset: 0

Views

Author

Roger L. Bagula and Gary W. Adamson, Sep 28 2008

Keywords

Crossrefs

Programs

  • Mathematica
    a[0] = 0; a[1] = 1;
    a[n_] := a[n] = If[Mod[n, 3] == 1, 2*a[n - 1] + a[n - 2], If[Mod[n, 3] == 0, a[n - 1] + a[n - 2], 2*a[n - 1] - a[n - 2]]];
    Table[a[n], {n, 0, 50}]
    LinearRecurrence[{0,0,7,0,0,-1},{0,1,2,3,8,13},40] (* Harvey P. Dale, Jul 17 2021 *)

Formula

G.f.: -x*(1+x)*(x^3 - 2*x^2 - x - 1) / ( 1 - 7*x^3 + x^6 ).
a(3n) = A033888(n).
a(3n+1) = A033890(n).
a(3n+2)= A033891(n).
a(n) = 2*a(n-1) + a(n-2) if n == 1 (mod 3).
a(n) = a(n-1) + a(n-2) if n == 0 (mod 3).
a(n) = 2*a(n-1) - a(n-2) if n == 2 (mod 3).

A160572 Elements of A160444, pairs of consecutive entries swapped.

Original entry on oeis.org

1, 0, 1, 1, 4, 2, 10, 6, 28, 16, 76, 44, 208, 120, 568, 328, 1552, 896, 4240, 2448, 11584, 6688, 31648, 18272, 86464, 49920, 236224, 136384, 645376, 372608, 1763200, 1017984, 4817152, 2781184, 13160704, 7598336, 35955712, 20759040, 98232832
Offset: 1

Views

Author

Willibald Limbrunner (w.limbrunner(AT)gmx.de), May 20 2009

Keywords

Comments

The case k=3 of a family of sequences defined by a(1)=1, a(2)=0, a(2n+1)=a(2n-1)+k*a(2n), a(2n+2)=a(2n)+a(2n-1), each congruent to one of the sequences mentioned in A160444 by pairwise interchanges. The case k=2 is covered by swapping pairs in A002965.
Each of the two subsequences b(n) obtained by bisection has a limiting ratio b(n+1)/b(n)=1+sqrt(k) by Binet's Formula. In a logarithmic plot of the sequence a(n) one therefore sees a staircase, the two edges at each step alternately marked by one of the two subsequences.
Matrix M = [[1 3] [1 1]] is iterated with starting vector [1 0]^T. Since M has eigenvectors [+-sqrt(3) 1]^T with eigenvalues 1 +- sqrt(3), we have lim xn/yn = 1+sqrt(3) for all nonzero integer starting vectors. - Hagen von Eitzen, May 22 2009

Examples

			k=2: 1,0,1,1,3,2,7,5,17,12,41,29,99,70,239,169,577,408,1393,985
k=3: 1,0,1,1,4,2,10,6,28,16,76,44,208,120,568,328,1552... (here)
k=4: 1,0,1,1,5,2,13,7,41,20,121,61,365,182,1093,547,3281,..
k=5: 1,0,1,1,6,2,16,8,56,24,176,80,576,256,1856,832,6016,2688,..
k=6: 1,0,1,1,7,2,19,9,73,28,241,101,847,342,2899,1189,..
k=7: 1,0,1,1,8,2,22,10,92,32,316,124,1184,440,4264,1624,..
k=8: 1,0,1,1,9,2,25,11,113,36,401,149,1593,550,5993,2143,..
k=9: 1,0,1,1,10,2,28,12,136,40,496,176,2080,672,8128,2752,..
k=10: 1,0,1,1,11,2,31,13,161,44,601,205,2651,806,10711,3457,..
		

Crossrefs

Cf. A160444, A002605 (bisection), A026150 (bisection).

Formula

a(2*n+1)=A160444(2*n+2). a(2*n+2)=A160444(2*n+1).
G.f.: -x*(1-x^2+x^3)/(-1+2*x^2+(k-1)*x^4). a(n)=2*a(n-2)+(k-1)*a(n-4) at k=3. - R. J. Mathar, May 22 2009
a(1)=1, a(2)=0, and for n>=1: a(2*n+1) = a(2*n-1)+3*a(2*n), a(2*n+2) = a(2*n+1)+a(2*n). Or: Let c1 = 1+sqrt(3), c2 = 1-sqrt(3). Then a(2*n+1) = (c1^n + c2^n)/2, a(2*n+2) = (c1^n - c2^n)/(2*sqrt(3)) for n >= 0. - Hagen von Eitzen, May 22 2009

Extensions

Edited by R. J. Mathar, May 22 2009
Previous Showing 21-27 of 27 results.