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.

User: Steven Lubars

Steven Lubars's wiki page.

Steven Lubars has authored 5 sequences.

A261208 Terms of the Leibniz formula (as Euler product) that generate successively better approximations to Pi.

Original entry on oeis.org

1, 3, 4, 5, 8, 47, 49, 95, 247, 251, 253, 742, 4268, 4270, 4288, 11445, 30123, 30701, 30703, 62592, 62690, 62992, 3535871, 3535872, 3664203, 3664204, 3664214, 3664220, 3665670, 3665696, 3665842, 3665854, 3665866, 3708907, 3708909, 3708913, 3708929, 3708931, 3708935, 3708957, 3708983, 3708985, 3709017
Offset: 1

Author

Steven Lubars, Aug 11 2015

Keywords

Examples

			Calculating the first 8 terms: c(1)=3, c(2)=3.75, c(3)=3.28125, c(4)=3.0078125, c(5)=3.2584635416, c(6)=3.462117513020833, c(7)=3.289011637369791, c(8)=3.1519694858127165.
In the above sequence, terms 1, 3, 4, 5, and 8 provide successively closer approximations of Pi (whereas approximations 2, 6, and 7 do not).
		

Crossrefs

Programs

  • MUMPS
    s Pi=3.141592653589793238,a=3,n=1,d=Pi-a
    w !,1
    f i=6:6:1e10 d
      s L=i+1**.5\1
      f j=i-1:2:i+1 d
        f k=3:2:L q:'(j#k)
        i j#k d
          s a=a*j/(j#4+j-2),n=n+1
          i $FN(Pi-a,"-")Steven Lubars, Aug 14 2015
  • PARI
    nearmul(p) = if (p % 4 == 1, p-1, p+1);
    lista(nn) = {print1(lb = 1, ", "); v = 3; ld = abs(Pi-3); for (n=2, nn, np = prime(n+1); v *= np/nearmul(np); if ((nld=abs(Pi-v)) < ld, print1(n, ", "); ld = nld););} \\ Michel Marcus, Aug 14 2015
    

Formula

Pi = 4*b(1)*b(2)*b(3)*... where b(n) is the n-th odd prime (A065091) divided by its nearest multiple of 4.
Let c(n) be the n-th term of the expansion such that c(n) = 4*b(1)*...*b(n). The sequence consists of the values n such that c(n) provides a closer approximation of Pi than previous approximations c(1)...c(n-1).

A166007 Number of ones in the binary representation of the middle member q of the prime triple (p,q,r) with p

Original entry on oeis.org

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

Author

Steven Lubars (lubars(AT)gmail.com), Oct 03 2009

Keywords

Examples

			For n = 3, (p, q, r) = (11, 13, 17), q = 13
Decimal 13 = Binary 1101
a(3) = Number of ones in 1101 = 3
		

Crossrefs

Programs

  • Mathematica
    DigitCount[#,2,1]&/@Transpose[Select[Partition[Prime[Range[1000]],3,1], Last[#]-First[#]==6&]][[2]] (* Harvey P. Dale, Dec 03 2014 *)

Extensions

More terms from Harvey P. Dale, Dec 03 2014

A166028 a(n) is the starting position of the second occurrence of a string of the initial n decimal digits of e in the decimal expansion of e.

Original entry on oeis.org

4, 62, 918, 5503, 29169, 252474, 7910575, 7910575
Offset: 1

Author

Steven Lubars (lubars(AT)gmail.com), Oct 04 2009

Keywords

Comments

The digits 2 7 1 8 2 ... are labeled 0, 1, 2, 3, 4, ...
The next term, a(9), is greater than 50 million. - Harvey P. Dale, Apr 01 2017

Examples

			a(6) is the starting position of the second occurrence of the initial 6 decimals of e. the string '271828' occurs at position 252,474, thus a(6) = 252,474.
		

Crossrefs

Programs

  • Mathematica
    Module[{nn=300000,ed},ed=RealDigits[E,10,nn][[1]];Table[ SequencePosition[ ed, Take[ed,n],2][[2]],{n,6}][[All,1]]-1] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Apr 01 2017 *)

Extensions

Two more terms -- a(7) and a(8) -- from Harvey P. Dale, Apr 01 2017

A166008 Number of ones in the binary representation of the average of twin prime pairs.

Original entry on oeis.org

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

Author

Steven Lubars (lubars(AT)gmail.com), Oct 03 2009

Keywords

Examples

			Third twin prime pair = (11,13) with average 12 = 1100_2, with 2 ones, so a(3)=2.
		

Crossrefs

Programs

  • Magma
    [&+Intseq(p+1,2):p in PrimesUpTo(3000)|IsPrime(p+2)]; // Marius A. Burtea, Dec 19 2019
  • Mathematica
    seq={1}; Do[If[And @@ PrimeQ[6n + {-1, 1}], AppendTo[seq, DigitCount[6n, 2, 1]]], {n, 1, 600}]; seq (* Amiram Eldar, Dec 19 2019 *)
    DigitCount[#,2,1]&/@(Mean/@Select[Partition[Prime[Range[1000]],2,1],#[[2]]- #[[1]] == 2&]) (* Harvey P. Dale, Dec 12 2021 *)

Formula

a(n) = A000120(A014574(n)). - Michel Marcus, Dec 19 2019

Extensions

More terms from Amiram Eldar, Dec 19 2019

A166006 Distance from the origin using the binary expansion of Pi to walk the number line: Start at the origin; subtract one for each '0' digit, and add one for each '1' digit.

Original entry on oeis.org

1, 2, 1, 0, 1, 0, -1, 0, -1, -2, -3, -4, -3, -2, -1, 0, 1, 2, 1, 2, 3, 2, 3, 2, 3, 2, 3, 2, 1, 0, 1, 0, -1, -2, -1, -2, -3, -4, -5, -4, -5, -4, -3, -4, -3, -4, -5, -6, -5, -4, -5, -6, -7, -8, -7, -8, -9, -10, -9, -8, -9, -8, -9, -10, -9, -8, -9, -10, -11, -10, -11, -12, -11, -10, -11
Offset: 1

Author

Steven Lubars (lubars(AT)gmail.com), Oct 03 2009

Keywords

Comments

Of the first 10^10 terms, 5738590822 are positive and 4261262135 are negative. - Hans Havermann, Nov 27 2016

Examples

			The first five digits of the expansion are 1, 1, 0, 0, 1.
Starting at 0, we get 0 + 1 + 1 - 1 - 1 + 1 = 1, so a(5) = 1.
		

Crossrefs

Cf. A004601, A039624 (indices of zero), A278737 (record maxima), A278738 (record minima), A369900.

Formula

a(n) = Sum_{k=1..n} (2*b(k) - 1), where b(n) is the n-th binary digit of Pi.