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: Michael P. May

Michael P. May's wiki page.

Michael P. May has authored 19 sequences. Here are the ten most recent ones:

A380334 Decimal expansion of the smallest possible average gap for the prime number subsequence P" = A262275.

Original entry on oeis.org

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

Author

Michael P. May, Jan 21 2025

Keywords

Examples

			9.45193981344780631141075022470840...
		

Crossrefs

Programs

  • Mathematica
    f[x_] := Log[x!]*{Log[x!]+1}-x*{x-1};
    root = FindRoot[f[x]  == 0, {x, 3},WorkingPrecision -> 100];
    y=root;
    z=x/. y;
    RealDigits[Log[z!]*{Log[z!]+1}]
  • PARI
    my(y=solve(x=3, 4, lngamma(x+1)-x+1)); y*(y-1) \\ Michel Marcus, Jan 28 2025

Formula

Equals x*(x-1) where x = A338460.

A373497 If n is prime, a(n) = 1 if the number of steps in its prime index chain is odd, a(n) = -1 if the number of steps is even, and a(n) = 0 is n is composite or 1.

Original entry on oeis.org

0, 1, -1, 0, 1, 0, 1, 0, 0, 0, -1, 0, 1, 0, 0, 0, -1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, -1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0
Offset: 1

Author

Michael P. May, Jun 06 2024

Keywords

Crossrefs

Programs

  • PARI
    b(n)={my(k=0); while(isprime(n), k++; n=primepi(n)); k}; \\ A078442
    a(n) = if ((n==1) || !isprime(n), return(0)); if (b(n)%2, 1, -1); \\ Michel Marcus, Jun 11 2024

Formula

a(n) = 1 iff n is in A333242.
a(n) = -1 iff n is in A262275.
a(n) = 0 iff n is in A018252.

Extensions

More terms from Michel Marcus, Jun 11 2024

A373338 Characteristic function of A333242: a(n) = 1 if n is a term of A333242.

Original entry on oeis.org

0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0
Offset: 1

Author

Michael P. May, Jun 01 2024

Keywords

Comments

This sequence is the result of applying the N-sieve to generate the prime number subsequence A333242 where 1 indicates a prime number chosen to be included in sequence A333242 and 0 indicates the prime numbers and composites not in A333242.

Crossrefs

Programs

  • Mathematica
    Select[Prime@ Range@ 75, EvenQ@ Length@ NestWhileList[ PrimePi, #, PrimeQ] &]
  • PARI
    A078442(n) = my(k=0); while(isprime(n), k++; n=primepi(n)); k;
    a(n) = A078442(n) % 2; \\ Michel Marcus, Jun 15 2024

Formula

a(n) = A078442(n) mod 2

A358274 a(n) is the prime before A262275(n).

Original entry on oeis.org

2, 7, 13, 37, 61, 79, 107, 113, 151, 181, 199, 239, 271, 281, 349, 359, 397, 457, 503, 541, 557, 577, 613, 733, 769, 787, 857, 863, 953, 983, 1021, 1061, 1069, 1163, 1193, 1213, 1399, 1429, 1439, 1459, 1493, 1583, 1619, 1667, 1721, 1733, 1811, 1907, 2017, 2053
Offset: 1

Author

Michael P. May, Nov 11 2022

Keywords

Comments

The sum of the individual gaps formed by the subtraction of the next lower prime number from each prime in A262275 approximates the prime counting function at very large n.

Examples

			a(3) = A262275(3) - A348677(3) = 17 - 4 = 13.
		

References

  • Michael P. May, "Relationship Between the Prime Counting Function and a Unique Prime Number Sequence", accepted for publication in the March 2023 edition of the Missouri Journal of Mathematical Sciences.

Crossrefs

Programs

  • PARI
    b(n) = {my(k=0); while(isprime(n), k++; n=primepi(n)); k};
    apply(x->precprime(x-1), apply(prime, select(n->b(n)%2, [1..500]))) \\ Michel Marcus, Nov 18 2022

Formula

a(n) = A262275(n) - A348677(n).
a(n) = A151799(A262275(n)).

A358179 Prime numbers with prime indices in A333244.

Original entry on oeis.org

31, 709, 1787, 8527, 19577, 27457, 42043, 52711, 72727, 96797, 112129, 137077, 167449, 173867, 239489, 250751, 285191, 352007, 401519, 443419, 464939, 490643, 527623, 683873, 718807, 755387, 839483, 864013, 985151, 1021271, 1080923, 1128889, 1159901, 1278779, 1323503, 1342907, 1656649, 1693031
Offset: 1

Author

Michael P. May, Nov 11 2022

Keywords

Comments

This sequence can also be generated by the N-sieve.

Examples

			a(1) = prime(A333244(1)) = prime(11) = 31.
		

Crossrefs

Programs

  • Mathematica
    b[n_] := b[n] = If[PrimeQ[n], 1+b[PrimePi[n]], 0];
    a[n_] := a[n] = Module[{p}, p = If[n==1, 1, a[n-1]]; While[True, p = NextPrime[p]; If[#>3 && OddQ[#]&[b[p]], Break[]]]; p];
    Array[a, 50]
  • PARI
    b(n)={my(k=0); while(isprime(n), k++; n=primepi(n)); k};
    apply(x->prime(prime(prime(prime(x)))), select(n->b(n)%2, [1..500])) \\ Michel Marcus, Nov 18 2022

Formula

a(n) = prime(A333244(n)).
a(n) = A049090(A333242(n)).
a(n) = A038580(A262275(n)).
a(n) = A006450(A333243(n)).

A348677 a(n) is the difference between A262275(n) and the next lower prime.

Original entry on oeis.org

1, 4, 4, 4, 6, 4, 2, 14, 6, 10, 12, 2, 6, 2, 4, 8, 4, 4, 6, 6, 6, 10, 4, 6, 4, 10, 2, 14, 14, 8, 10, 2, 18, 8, 8, 4, 10, 4, 8, 12, 6, 14, 2, 2, 2, 8, 12, 6, 10, 10, 12, 10, 8, 2, 2, 4, 6, 6, 16, 14, 6, 6, 2, 10, 6, 2, 8, 6, 20, 2, 8, 28, 6, 16, 2, 6, 2, 10, 6, 22, 4, 6, 4, 14, 6, 2
Offset: 1

Author

Michael P. May, Oct 30 2021

Keywords

Comments

This sequence can be used as an alternate method of approximating the prime-counting function pi(n).

Examples

			For n = 3, a(3) = 17 - 13 = 4.
		

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember;
           `if`(isprime(n), 1+b(numtheory[pi](n)), 0)
        end:
    g:= proc(n) option remember; local p; p:= g(n-1);
          do p:= nextprime(p);
             if b(p)::even then break fi
          od; p
        end: g(1):=3:
    a:= n-> (t-> t-prevprime(t))(g(n)):
    seq(a(n), n=1..86);  # Alois P. Heinz, Jan 06 2022
  • Mathematica
    fQ[n_]:=If[!PrimeQ[n]||(PrimeQ[n]&&FreeQ[lst,PrimePi[n]]),AppendTo[lst,n]];k=2;lst={1};While[k<10000000,fQ@k;k++];tab1=Select[lst,PrimeQ]
    lowerP[n_]:=Module[{m}, m=n;While[!PrimeQ[m-1],m--]; m-1]
    tab2=lowerP/@tab1
    tab3=tab1-tab2

Formula

a(n) = p_p'(n) - p_(p'(n) - 1), where p' is a prime number in the sequence A333242, p_p' is a prime number with index in A333242 (forms the prime number sequence A262275), and p_(p'(n)-1) is a prime number which is the next lower prime than those in A262275.
a(n) = A001223(A000720(A262275(n)) - 1).
a(n) = A262275(n) - A151799(A262275(n)). - Alois P. Heinz, Jan 06 2022

A342574 Remainder of e when the Dirichlet series for e is converted to an infinite product (negated).

Original entry on oeis.org

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

Author

Michael P. May, Mar 27 2021

Keywords

Comments

Remainder term when the Dirichlet series representation of e is converted to an infinite product via the Euler Product Formula method. The remainder can be calculated via the infinite series found at the top of page 2 of "A Non-Sieving Application ..." (see links) or by the much simpler method A001113*A282529-2.

Examples

			-0.925358356236040633370884166370763828049565...
		

Crossrefs

Cf. A001113 (e), A282529.

Formula

Equals A001113*A282529-2.

Extensions

More digits from Alois P. Heinz, Mar 31 2021

A341826 Decimal expansion of the largest real root of Gamma(x+1) = e.

Original entry on oeis.org

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

Author

Michael P. May, Feb 20 2021

Keywords

Comments

Decimal expansion of the root of Gamma(x+1)/log(Gamma(x+1)) = Gamma(x+1).

Examples

			2.3124408825391603702...
		

Crossrefs

Cf. A001113.

Programs

  • Mathematica
    RealDigits[x /. FindRoot[Gamma[x+1] - E, {x, 2}, WorkingPrecision -> 120], 10, 100][[1]] (* Amiram Eldar, May 29 2021 *)
  • PARI
    solve(x=2, 3, gamma(x+1)/log(gamma(x+1))-gamma(x+1)) \\ Michel Marcus, Feb 21 2021
    
  • PARI
    solve(x=2, 3, gamma(x+1) - exp(1)) \\ Michel Marcus, Feb 21 2021

Formula

{x| Gamma(x+1)/log(Gamma(x+1))=Gamma(x+1)}.

A338460 Decimal expansion of the largest real root of e^(x-1) = Gamma(x+1).

Original entry on oeis.org

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

Author

Michael P. May, Jan 31 2021

Keywords

Comments

Decimal expansion of the constant value for which the average and the minimum prime gaps are equal for the prime number sequences of higher order P', P'', P''', and P'''' as represented by A333242, A262275, A333243 and A333244.
x-1 is the smallest average gap size for the set of all prime numbers P. - Michael P. May, Jan 26 2025

Examples

			3.61479370319252544738653662560345463353151659694750...
		

Crossrefs

Programs

  • Maple
    Digits:= 155:
    fsolve(exp(x-1)=GAMMA(x+1), x=3..4);  # Alois P. Heinz, Feb 01 2021
  • Mathematica
    RealDigits[x /. FindRoot[LogGamma[x + 1] - x + 1, {x, 3}, WorkingPrecision -> 110], 10, 105][[1]] (* Amiram Eldar, Feb 01 2021 *)
  • PARI
    solve(x=3,4,lngamma(x+1)-x+1) \\ Hugo Pfoertner, Feb 01 2021

Formula

x| (log(x!))^n * (log(x!) + 1) = x * (x-1)^n, for n >= 0

A333244 Prime numbers with prime indices in A333243.

Original entry on oeis.org

11, 127, 277, 1063, 2221, 3001, 4397, 5381, 7193, 9319, 10631, 12763, 15299, 15823, 21179, 22093, 24859, 30133, 33967, 37217, 38833, 40819, 43651, 55351, 57943, 60647, 66851, 68639, 77431, 80071, 84347, 87803, 90023, 98519, 101701, 103069, 125113, 127643
Offset: 1

Author

Michael P. May, Mar 12 2020

Keywords

Comments

This sequence can also be generated by the N-sieve.

Examples

			a(1) = prime(A333243(1)) = prime(5) = 11.
		

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember;
          `if`(isprime(n), 1+b(numtheory[pi](n)), 0)
        end:
    a:= proc(n) option remember; local p;
          p:= `if`(n=1, 1, a(n-1));
          do p:= nextprime(p);
            if (h-> h>2 and h::even)(b(p)) then break fi
          od; p
        end:
    seq(a(n), n=1..42);  # Alois P. Heinz, Mar 15 2020
  • Mathematica
    b[n_] := b[n] = If[PrimeQ[n], 1+b[PrimePi[n]], 0];
    a[n_] := a[n] = Module[{p}, p = If[n==1, 1, a[n-1]]; While[True, p = NextPrime[p]; If[#>2 && EvenQ[#]&[b[p]], Break[]]]; p];
    Array[a, 42] (* Jean-François Alcover, Nov 16 2020, after Alois P. Heinz *)
  • PARI
    b(n)={my(k=0); while(isprime(n), k++; n=primepi(n)); k};
    apply(x->prime(prime(prime(x))), select(n->b(n)%2, [1..500])) \\ Michel Marcus, Nov 18 2022

Formula

a(n) = prime(A333243(n)).