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: Rok Cestnik

Rok Cestnik's wiki page.

Rok Cestnik has authored 60 sequences. Here are the ten most recent ones:

A366397 Decimal expansion of the number whose continued fraction terms are one larger than those of Pi.

Original entry on oeis.org

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

Author

Rok Cestnik, Oct 08 2023

Keywords

Examples

			4.12406010228786539167585... = 4 + 1/(8 + 1/(16 + 1/(2 + 1/(293 + ...)))).
Pi = 3.141592653589793238... = 3 + 1/(7 + 1/(15 + 1/(1 + 1/(292 + ...)))).
		

Crossrefs

Programs

  • PARI
    N = 25;
    cf(v) = my(m=contfracpnqn(v)); m[1, 1]/m[2, 1];
    summand(k) = (-1)^k/2^(10*k)*(-2^5/(4*k+1)-1/(4*k+3)+2^8/(10*k+1)-2^6/(10*k+3)-2^2/(10*k+5)-2^2/(10*k+7)+1/(10*k+9));
    pi1 = contfrac(1/2^6*sum(k=0,N,summand(k)));
    pi2 = contfrac(1/2^6*sum(k=0,N+1,summand(k)));
    n = 0; while(pi1[1..n+1] == pi2[1..n+1], n++);
    ap1 = cf(apply(x->x+1, pi1[1..n-1]));
    ap2 = cf(apply(x->x+1, pi1[1..n]));
    n = 0; while(digits(floor(10^(n+1)*ap1)) == digits(floor(10^(n+1)*ap2)), n++);
    A366397 = digits(floor(10^n*ap1));

A367120 Decimal expansion of continued fraction 2+1/(4+3/(6+5/(8+7/(...)))).

Original entry on oeis.org

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

Author

Rok Cestnik, Nov 13 2023

Keywords

Examples

			2.224412437956340467163837541384021939...
		

Crossrefs

Programs

  • Mathematica
    First[RealDigits[2/HypergeometricPFQ[{1, 1}, {3/2, 3}, -1/2], 10, 100]] (* or *)
    First[RealDigits[2/Sum[(-1)^k/Binomial[k+2, 2]/(2*k+1)!!, {k, 0, Infinity}], 10, 100]] (* Paolo Xausa, Nov 18 2024 *)
  • PARI
    N=50;
    doblfac(n) = if(n<0, 0, n<2, 1, n*doblfac(n-2));
    ap1 = 2 / sum(k=0,N, (-1)^k/binomial(k+2,2)/doblfac(2*k+1));
    ap2 = 2 / sum(k=0,N+1, (-1)^k/binomial(k+2,2)/doblfac(2*k+1));
    n = 0; while(digits(floor(10^(n+1)*ap1)) == digits(floor(10^(n+1)*ap2)), n++);
    A367120 = digits(floor(10^n*ap1));

Formula

Equals 2 / pFq(1,1; 3/2,3; -1/2) where pFq() is the generalized hypergeometric function.
Equals 2 / Sum_{k>=0} (-1)^k/binomial(k+2,2)/(2*k+1)!! = 2 / (1 - 1/9 + 1/90 - 1/1050 + 1/14175 - 1/218295 + ... ).

A365125 Put a positive charge at 0 and a negative charge at 1, then keep adding alternating charges at points of zero potential; this is the decimal expansion of the limit.

Original entry on oeis.org

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

Author

Rok Cestnik, Aug 22 2023

Keywords

Comments

The potential is inversely proportional to the distance: a positive charge at p has potential 1/abs(x-p). Starting from a positive charge at 0 and a negative charge at 1, the potential is zero at the midpoint 1/2, so another positive charge is added there. Then the potential is zero at 0.7886... and a negative charge is added there, and so on. The first few zero potential points are: 0.5, 0.7886..., 0.6325..., 0.7179..., 0.6714..., ... The limit is the constant of this sequence.
After initial points p_0 = 0 and p_1 = 1, each new zero point fits between previous two points and is the solution to Sum_{n>=0} 1/(x-p_n) = 0.

Examples

			0.68784181032838926327134404409883348611583979...
		

Programs

  • Mathematica
    p={0,1};
    For[r=1,r<39,++r,p=Append[p,x/.NSolve[{Sum[1/(x-p[[k]]),{k,1,Length[p]}]==0,(x-p[[-1]])*(x-p[[-2]])<0},x,WorkingPrecision -> 30][[1,1]]];];
    A365125 = RealDigits[Floor[10^10*p[[-1]]]][[1]]
  • Python
    from decimal import Decimal, getcontext, ROUND_UP, ROUND_DOWN
    getcontext().prec = 100
    def nm(f, df, x):
        for i in range(10):
            x -= f(x)/df(x)
        return x
    def flip_rounding():
        if getcontext().rounding == ROUND_UP: getcontext().rounding = ROUND_DOWN
        else: getcontext().rounding = ROUND_UP
    def get_zero(vs, rounding):
        getcontext().rounding = rounding
        def p(x,v):
            flip_rounding(); t = x-v
            flip_rounding(); return 1/t
        def dp(x,v):
            flip_rounding(); t = x-v; t = t**2
            flip_rounding(); return -1/t
        def f(x): return sum(p(x,vs[n]) for n in range(len(vs)))
        def df(x): return sum(dp(x,vs[n]) for n in range(len(vs)))
        sign = -1 if rounding == ROUND_DOWN else 1
        return nm(f, df, (vs[-1]+vs[-2])/2+sign*abs(vs[-1]-vs[-2])/3)
    v_lo = [Decimal(0), Decimal(1)]
    v_up = [Decimal(0), Decimal(1)]
    for r in range(150):
        v_lo.append(get_zero(v_lo, ROUND_DOWN))
        v_up.append(get_zero(v_up, ROUND_UP))
    lower_bounds = [v_lo[i] for i in range(0, len(v_lo), 2)]
    upper_bounds = [v_up[i] for i in range(1, len(v_up), 2)]
    right = True
    A365125 = [int(l) for l, u in zip(str(lower_bounds[-1])[2:], str(upper_bounds[-1])[2:]) if right and (right := (l == u))]

A365350 Decimal expansion of 1/(Pi-3).

Original entry on oeis.org

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

Author

Rok Cestnik, Sep 02 2023

Keywords

Comments

The continued fraction expansion is the same as Pi (A001203) with initial 3 omitted.

Examples

			7.062513305931045769793...
		

Crossrefs

Programs

  • Mathematica
    A365350 = RealDigits[N[1/(Pi-3), #+1]][[1]][[1;; -2]]&;
  • PARI
    1/(Pi-3)

A365307 Decimal expansion of 1/(2*e-5).

Original entry on oeis.org

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

Author

Rok Cestnik, Aug 31 2023

Keywords

Comments

The continued fraction expansion is A081750 with initial term 5 omitted.

Examples

			2.2906166927853624221...
		

Programs

  • Mathematica
    A365307 = RealDigits[N[1/(2*E-5),#+1]][[1]][[1;;-2]]&;
  • PARI
    1/(2*exp(1)-5).

Formula

Equals 2 + 1/(3 + 2/(4 + 3/(5 + 4/(6 + 5/( ... /(n+1 + n/(n+2 + ... ))))))).
From Peter Bala, Oct 23 2023: (Start)
Define s(n) = Sum_{k = 3..n} 1/k!. Then 1/(2*e - 5) = 3 - (1/2)*Sum_{n >= 3 } 1/( (n+1)!*s(n)*s(n+1) ) is a rapidly converging series of rationals. Cf. A073333 and A194807.
Equivalently, 1/(2*e - 5) = 3 - (1/2)*(3!/(1*5) + 4!/(5*26) + 5!/(26*157) + 6!/(157*1100) + ...), where [1, 5, 26, 157, 1100, ... ] is A185108. (End)

A364835 a(1) = 1; a(n+1) = (number of times a(n)+1 has appeared) - (number of times a(n) has appeared).

Original entry on oeis.org

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

Author

Rok Cestnik, Aug 28 2023

Keywords

Comments

Irregular until n=149695 at which point it follows a simple pattern (see formula).

Examples

			a(5) = 2 - 1 = 1 because a(4) + 1 = -1 has appeared twice before and a(4) = -2 has appeared once.
a(7) = 2 - 2 = 0 because a(6) + 1 = -1 and a(6) = -2 have both appeared twice before.
		

Crossrefs

Programs

  • Mathematica
    nmax=78; a={1}; For[n=1, n<=nmax, n++, AppendTo[a,Count[a,Part[a,n]+1]-Count[a,Part[a,n]]]]; a (* Stefano Spezia, Aug 29 2023 *)
  • Python
    a=[1]
    for n in range(1000):
        a.append(a.count(a[n]+1)-a.count(a[n]))
    
  • Python
    from itertools import islice
    from collections import Counter
    def agen(): # generator of terms
        an = 1; c = Counter([1])
        while True: yield an; an = c[an+1] - c[an]; c[an] += 1
    print(list(islice(agen(),1001))) # Michael S. Branicky, Aug 29 2023

Formula

For n >= 149695: a(n) = 49456 - n/3 if (n mod 3) = 0, otherwise a(n) = (n mod 3) - 1.

A365116 Greedy Egyptian fraction expansion of 1/(2+3/(4+5/(6+7/(...)))) = A113014.

Original entry on oeis.org

3, 22, 1060, 1471180, 4470565318951, 21387196871513452925199541, 508406155285302398938678134812723800438323137635884, 293206664431782985993415302840424364324000216460330294129310314248712028637333711113413230006858255456
Offset: 1

Author

Rok Cestnik, Aug 22 2023

Keywords

Examples

			1/3 + 1/22 + 1/1060 + 1/1471180 + ... = 1/(2+3/(4+5/(6+7/(...)))).
		

Crossrefs

A365105 Continued fraction expansion of 1/(2+3/(4+5/(6+7/(...)))) = A113014.

Original entry on oeis.org

0, 2, 1, 1, 1, 2, 1, 2, 10, 2, 2, 66, 1, 1, 13, 66, 9, 5, 8, 1, 9, 1, 1, 1, 5, 2, 2, 3, 1, 1, 1, 16, 99, 6, 1, 5, 1, 2, 1, 55, 2, 2, 1, 1, 6, 4, 1, 1, 1, 40, 1, 1, 1, 6, 14, 7, 9, 1, 1, 2, 3, 2, 2, 2, 1, 1, 2, 7, 12, 1, 2, 2, 1, 4, 2, 4, 2, 1, 3, 2, 1, 10, 7, 1, 4, 1, 119, 1, 1, 1, 3, 5, 2, 12, 1
Offset: 0

Author

Rok Cestnik, Aug 21 2023

Keywords

Comments

A113014 is defined by a generalized continued fraction and the expansion here is its simple continued fraction.

Examples

			1/(2+1/(1+1/(1+1/(1+1/(2+1/(...)))))) = 1/(2+3/(4+5/(6+7/(...)))).
		

Crossrefs

Programs

  • Mathematica
    A365105 = ContinuedFraction[Sqrt[2*E/Pi]/Erfi[1/Sqrt[2]]-1,#]&;

A365052 Decimal expansion of continued fraction [1; 4, 9, 16, 25, ... n^2, ... ].

Original entry on oeis.org

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

Author

Rok Cestnik, Aug 18 2023

Keywords

Examples

			1.243288478399715644...
		

Crossrefs

Cf. A073824 (reciprocal), A036246/A036245 (convergents).

Programs

  • Mathematica
    A365052 = RealDigits[FromContinuedFraction[Range[1,50]^2],10,#][[1]]&;
  • PARI
    p(N) = my(m=contfracpnqn(vector(N, i, i^2))); m[1,1]/m[2,1];
    A365052(N) = {my(t=2); while(floor(10^N*p(t)) != floor(10^N*p(t+1)), t++); digits(floor(10^(N-1)*p(t)))};

Formula

Equals 1/A073824.

A364873 Decimal expansion of the lexicographically earliest continued fraction which equals its own sum of reciprocals.

Original entry on oeis.org

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

Author

Rok Cestnik, Aug 11 2023

Keywords

Comments

This continued fraction (A364872) is the earliest infinite sequence {a0,a1,a2,a3,...} such that: a0+1/(a1+1/(a2+1/(a3+...))) = 1/a0 + 1/a1 + 1/a2 + 1/a3 + ....
There are infinitely many real numbers whose continued fraction is also their sum of reciprocals - they are dense on the interval (2,oo).

Examples

			2.71053359137351078733864566...
		

Crossrefs

Cf. A364872.

Programs

  • PARI
    cf(a) = my(m=contfracpnqn(a)); m[1, 1]/m[2, 1];
    uf(a) = sum(i=1, #a, 1/a[i]);
    A364872(N) = {a=[2]; for(i=2, N, a=concat(a, if(cf(a)==uf(a), a[i-1], ceil(1/(cf(a)-uf(a))))); while(cf(a)<=uf(a), a[i]++)); a};
    A364873(N) = {t=2; while(floor(10^N*cf(A364872(t))) != floor(10^N*cf(A364872(t+1))), t++); digits(floor(10^(N-1)*cf(A364872(t))))};