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 24 results. Next

A002665 Continued fraction expansion of Lehmer's constant.

Original entry on oeis.org

0, 1, 1, 2, 5, 34, 985, 1151138, 1116929202845, 1480063770341062927127746, 1846425204836010506550936273411258268076151412465
Offset: 0

Views

Author

Keywords

Examples

			0.592632718201636... = 0 + 1/(1 + 1/(1 + 1/(2 + 1/(5 + ...)))). - _Harry J. Smith_, May 14 2009
		

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

Cf. A030125 (decimal expansion).
Starting with n=2, a(n)/a(n-2) are in A096407.

Programs

  • Mathematica
    digits = 1200; c[0] = 0; c[n_] := c[n] = c[n-1]^2 + c[n-1] + 1; LC[m_] := LC[m] = Cot[Sum[(-1)^k*ArcCot[c[k]], {k, 0, m}]] // N[#, digits+10]&; LC[10]; LC[m = 20]; While[Abs[LC[m] - LC[m-10]] > 10^-digits, m = m+10]; ContinuedFraction[LC[m]] (* Jean-François Alcover, Oct 08 2013 *)
  • PARI
    default(realprecision, 2000);b=0.;
    Lehmers=1/tan(suminf(k=1,b=b^2+b+1;(-1)^k*atan(1/b))+Pi/2);
    x=contfrac(Lehmers);
    for (n=1, 13, write("b002665.txt", n-1, " ", x[n])) \\ Harry J. Smith, May 14 2009; edited by Charles R Greathouse IV, Jan 21 2016

Formula

With a different offset: a(0)=1, a(1)=1, a(n+1)=(b(n)+b(n-1)+1)*a(n-1), n >= 1, b()=A002065, with b(0)=0, b(1)=1, b(2)=3, ...

Extensions

More terms from Jeffrey Shallit
First two terms inserted by Harry J. Smith, May 14 2009

A030125 Decimal expansion of Lehmer's constant.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Digits 999 and 1000 should be "48" not "65" as given in the Plouffe links. - Sean A. Irvine, Aug 24 2014
Named after the American mathematician Derrick Henry Lehmer (1905-1991). - Amiram Eldar, Jun 22 2021

Examples

			0.592632718201636197104078604995701469084275407197161...
		

References

  • Steven R. Finch, Mathematical Constants, Cambridge, 2003, pp. 433-434.

Crossrefs

Cf. A002665 (continued fraction). - Harry J. Smith, May 14 2009

Programs

  • Mathematica
    RealDigits[With[{nn=15},Cot[Total[Last[#]ArcCot[First[#]]&/@Thread[ {NestList[ #^2+#+1&,0,nn],PadRight[{},nn+1,{1,-1}]}]]]],10,120][[1]] (* Harvey P. Dale, Jan 29 2012 *)
  • PARI
    b=0.;1/tan(suminf(k=1,b=b^2+b+1;(-1)^k*atan(1/b))+Pi/2) \\ Charles R Greathouse IV, Jan 21 2016

Formula

Equals cot(Sum_{k>=0} (-1)^k * arccot(A002065(k))). - Amiram Eldar, Aug 18 2020

Extensions

More terms from David W. Wilson

A002794 Numerators of convergents to Lehmer's constant.

Original entry on oeis.org

1, 1, 3, 16, 547, 538811, 620245817465, 692770666469127829226736, 1025344764595988314871439243086711931108916434521
Offset: 0

Views

Author

Keywords

References

  • D. H. Lehmer, A cotangent analogue of continued fractions, Duke Math. J., 4 (1935), 323-340.
  • 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).
  • J. W. Wrench, Jr., personal communication.

Crossrefs

Programs

  • Mathematica
    Block[{$MaxExtraPrecision=1000},Numerator[Convergents[With[{nn=15},Cot[ Total[Last[#] ArcCot[First[#]]&/@Thread[{NestList[#^2+#+1&,0,nn], PadRight[{},nn+1,{1,-1}]}]]]],10]]] (* Harvey P. Dale, Jan 29 2012 *)

A002795 Denominators of convergents to Lehmer's constant.

Original entry on oeis.org

1, 2, 5, 27, 923, 909182, 1046593950039, 1168971346319460027570137, 1730152138254248421873938035305987364739567671241
Offset: 0

Views

Author

Keywords

References

  • D. H. Lehmer, A cotangent analogue of continued fractions, Duke Math. J., 4 (1935), 323-340.
  • 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).
  • J. W. Wrench, Jr., personal communication.

Crossrefs

A166105 Quadratic recurrence from Sylvester's sequence, but starting with a(0)=1 and a(1)=2.

Original entry on oeis.org

1, 2, 4, 14, 184, 33674, 1133904604, 1285739649838492214, 1653126447166808570252515315100129584, 2732827050322355127169206170438813672515557678636778921646668538491883474
Offset: 0

Views

Author

Jaume Oliver Lafont, Oct 06 2009

Keywords

Comments

a(n) is the size of the set S(n) constructed recursively as follows: Let S(1) = {a,b} and let P(S) be the set of pairs (s,t) where s,t are members of S and s not equal to t. We define S(n+1) as the union of S(n) and P(S(n)). - David M. Cerna, Feb 07 2018

Crossrefs

Cf. A000058.

Programs

  • GAP
    a:= [1, 2];; for n in [3..13] do a[n]:= a[n-1]^2 - a[n-2]^2 + a[n-2]; od; a; # Muniru A Asiru, Feb 07 2018
  • Maple
    a := proc(n) option remember: if n=0 then 1 elif n=1 then 2 elif n>=2 then procname(n-1)^2 - procname(n-2)^2 + procname(n-2) fi; end:
    seq(a(n), n = 0..10); # Muniru A Asiru, Feb 07 2018
    a:=1:A:=a : to 10 do a:=a*(a-1)+2 : A:=A,a od:
    print(A); # Robert FERREOL, May 05 2020
  • Mathematica
    RecurrenceTable[{a[n]==a[n-1]^2-a[n-2]^2+a[n-2],a[0]==1,a[1]==2}, a, {n,0,10}] (* Vaclav Kotesovec, Jan 19 2015 *)
  • PARI
    a(n)=if(n<2,[1,2][n+1],a(n-1)^2-a(n-2)^2+a(n-2));
    

Formula

Sum_{n>=0} 1/a(n) = 1.82689305142092757947757234878575... (compare with Sum_{n>=0} 1/A000058(n) = 1).
a(n) ~ c^(2^n), where c = 1.385089248334672909882206535871311526236739234374149506334120193387331772... . - Vaclav Kotesovec, Jan 19 2015
Sum_{n>=1} arctan(1/a(n)) = Pi/4. - Carmine Suriano, Apr 07 2015
a(0)=1, a(n+1) = a(n)*(a(n)-1) + 2. - Robert FERREOL, May 05 2020
a(n) = A002065(n) + 1 = (A232806(n) + 1)/2. - Robert FERREOL, May 31 2020

A379506 Sequence of primitive Pythagorean triples beginning with the triple (3,4,5), with each subsequent triple having as its inradius the semiperimeter of the previous triple, and with the long leg and the hypotenuse of each triple being consecutive natural numbers.

Original entry on oeis.org

3, 4, 5, 13, 84, 85, 183, 16744, 16745, 33673, 566935464, 566935465, 1133904603, 642869824352293804, 642869824352293805, 1285739649838492213, 826563223583404284483387832630818684, 826563223583404284483387832630818685
Offset: 1

Views

Author

Keywords

Comments

The only Pythagorean triple whose inradius is equal to r and such that its long leg and its hypotenuse are consecutive is (2r+1,2r^2+2r,2r^2+2r+1).

Examples

			Triples begin:
  3, 4, 5;
  13, 84, 85;
  183, 16744, 16745;
  33673, 566935464, 566935465;
		

Crossrefs

Cf. A002065 (short leg), A378395, A365577, A378963

Programs

  • Mathematica
    {a0,b0,c0}={3,4,5};f[n_]:= Module[{fn0=a0+b0+c0+1,fn1=((a0+b0+c0+1)^2+1)/2},Do[{fn0,fn1}={2fn1+fn0,((2fn1+fn0)^2+1)/2},{n}];fn0];t[n_]:={f[n-1],(f[n-1]^2-1)/2,(f[n 1]^2+1)/2};ternas={a0,b0,c0};For[i=1,i<=6,i++,ternas=Join[ternas,t[i]]];ternas

A060136 Square array read by antidiagonals with T(n,k)=T(n,k-1)^2+n*T(n,k-1)+1 and T(n,0)=0.

Original entry on oeis.org

0, 1, 0, 2, 1, 0, 5, 3, 1, 0, 26, 13, 4, 1, 0, 677, 183, 25, 5, 1, 0, 458330, 33673, 676, 41, 6, 1, 0, 210066388901, 1133904603, 458329, 1805, 61, 7, 1, 0, 44127887745906175987802, 1285739649838492213, 210066388900, 3263441, 3966
Offset: 0

Views

Author

Henry Bottomley, Mar 05 2001

Keywords

Crossrefs

Rows include A003095, A002065, A004019. Columns include A000004, A000012, A000027 (offset), A001844. Cf. A060137.

A232806 a(n) = a(n-1)^2/2 + 5/2, a(0) = 1.

Original entry on oeis.org

1, 3, 7, 27, 367, 67347, 2267809207, 2571479299676984427, 3306252894333617140505030630200259167
Offset: 0

Views

Author

Richard R. Forberg, Nov 30 2013

Keywords

Comments

First differences are 2*A063573.

Crossrefs

Formula

a(n) = 2*A002065(n) + 1.
a(n) = 2*A166105(n) - 1. - Robert FERREOL, May 31 2020
a(n) = A002065(n) + A166105(n). - Alois P. Heinz, Jun 07 2020

A328701 Period in residues modulo n in iteration of x^2 + x + 1 starting at 0.

Original entry on oeis.org

1, 1, 2, 2, 1, 2, 3, 4, 2, 1, 2, 2, 3, 3, 2, 8, 1, 2, 2, 2, 6, 2, 4, 4, 4, 3, 2, 6, 7, 2, 7, 16, 2, 1, 3, 2, 3, 2, 6, 4, 7, 6, 5, 2, 2, 4, 5, 8, 3, 4, 2, 6, 1, 2, 2, 12, 2, 7, 11, 2, 4, 7, 6, 32, 3, 2, 2, 2, 4, 3, 10, 4, 18, 3, 4, 2, 6, 6, 3, 8, 2, 7, 2, 6, 1, 5, 14, 4, 1, 2, 3
Offset: 1

Views

Author

Jianing Song, Oct 26 2019

Keywords

Comments

a(n) is the period of {A002065 mod n}.
Let f(0) = 0, f(k+1) = (f(k)^2+f(k)+1) mod n, then a(n) is the smallest t such that f(i) = f(i+t) for all sufficiently large i.
Obviously a(n) <= A290731(n): f(1), f(2), ..., f(A290731(n)+1) are all of the form (s^2+s+1) mod n, so there must exists 1 <= i < j <= A290731(n)+1 such that f(i) = f(j), and a(n) <= j - i <= A290731(n). The equality seems to hold only for n = 3, 6 or n is a power of 2.

Examples

			In the following example, () denotes the cycles.
A002065(n) mod 4: 0, (1, 3), so a(4) = 2.
A002065(n) mod 7: 0, (1, 3, 6), so a(7) = 3.
A002065(n) mod 29: 0, (1, 3, 13, 9, 4, 21, 28), so a(29) = 7.
A002065(n) mod 61: (0, 1, 3, 13). {A002065(n) mod 61} enters into the cycle (0, 1, 3, 13) from the very beginning, so a(61) = 0.
A002065(n) mod 64: 0, (1, 3, 13, 55, 9, 27, 53, 47, 17, 51, 29, 39, 25, 11, 5, 31, 33, 35, 45, 23, 41, 59, 21, 15, 49, 19, 61, 7, 57, 43, 37, 63), so a(64) = 32.
		

Crossrefs

Cf. A002065, A328702 (indices to enter the cycles), A290731.

Programs

  • PARI
    a(n) = my(v=[0],k); for(i=2, n+1, k=(v[#v]^2+v[#v]+1)%n; v=concat(v, k); for(j=1, i-1, if(v[j]==k, return(i-j))))

Formula

a(n1*n2) = lcm(a(n1),a(n2)) if gcd(n1,n2) = 1.
It seems that for e > 0, a(3^e) = 2; a(5^e) = 1 if e = 1, 4*5^(e-2) otherwise; a(7^e) = 3; a(11^e) = 2 if e = 1, 10*11^(e-2) otherwise; a(13^e) = 3 if e = 1, 12*13^(e-2) otherwise ...
Proof that a(2^e) = 2^(e-1) by induction: we will show that {f(1), f(2), ..., f(2^(e-1))} is a reduced system modulo 2^e, where f is defined in the comment section. It is easy to see that this is true for e = 1, 2.
Suppose that {f(1), f(2), ..., f(2^(e-1))} is a reduced system modulo 2^e, e = 1, 2. For each 1 <= i <= 2^(e-1), f(2^(e-1)+i) - f(i) = Sum_{j=i..2^(e-1)+i-1} (f(j+1)-f(j)) = Sum_{j=i..2^(e-1)+i-1} (f(j)^2+1) = 2^(e-1) + Sum_{j=i..2^(e-1)+i-1} f(j)^2. Of course, {f(i), f(i+1), ..., f(2^(e-1)+i-1)} is also a reduced system modulo 2^e.
Note that if x == y (mod 2^e), then x^2 == y^2 (mod 2^(e+1)). So f(2^(e-1)+i) - f(i) == 2^(e-1) + (1^2+3^2+5^2+...+(2^e-1)^2) == 2^e (mod 2^(e+1)), 1 <= i <= 2^(e-1). This shows that {f(1), f(2), ..., f(2^(e-1)), f(2^(e-1)+1), f(2^(e-1)+2), ..., f(2^e)} is a reduced system modulo 2^(e+1). QED.

A328702 Start with 0, a(n) is the smallest number of iterations: x -> (x^2+x+1) mod n needed to run into a cycle.

Original entry on oeis.org

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

Views

Author

Jianing Song, Oct 26 2019

Keywords

Comments

Let f(0) = 0, f(k+1) = (f(k)^2+f(k)+1) mod n, then a(n) is the smallest i such that f(i) = f(j) for some j > i.
Obviously a(n) <= A290731(n): f(1), f(2), ..., f(A290731(n)+1) are all of the form (s^2+s+1) mod n, so there must exists 0 <= i < j <= A290731(n)+1 such that f(i) = f(j), and a(n) <= i <= A290731(n). The equality seems to hold only for n = 2.
k divides A002065(m) for some m > 0 if and only if a(k) = 0, in which case all the indices m such that k divides A002065(m) are m = t*A328701(k), t = 0, 1, 2, 3, ...

Examples

			A002065(n) mod 4: 0, (1, 3). {A002065(n) mod 4} enters into the cycle (1, 3) from the 1st term on, so a(4) = 1.
A002065(n) mod 7: 0, (1, 3, 6). {A002065(n) mod 7} enters into the cycle (1, 3, 6) from the 1st term on, so a(7) = 1.
A002065(n) mod 11: 0, 1, 3, (2, 7). {A002065(n) mod 11} enters into the cycle (2, 7) from the 3rd term on, so a(11) = 3.
A002065(n) mod 19: 0, 1, 3, 13, (12, 5). {A002065(n) mod 19} enters into the cycle (12, 5) from the 4th term on, so a(19) = 4.
A002065(n) mod 61: (0, 1, 3, 13). {A002065(n) mod 61} enters into the cycle (0, 1, 3, 13) from the very beginning, so a(61) = 0.
		

Crossrefs

Cf. A002065, A328701 (cycle length), A328703, A290731.

Programs

  • PARI
    a(n) = my(v=[0],k); for(i=2, n+1, k=(v[#v]^2+v[#v]+1)%n; v=concat(v, k); for(j=1, i-1, if(v[j]==k, return(j-1))))
Previous Showing 11-20 of 24 results. Next