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.

Showing 1-8 of 8 results.

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

Views

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

A262275 Prime numbers with an even number of steps in their prime index chain.

Original entry on oeis.org

3, 11, 17, 41, 67, 83, 109, 127, 157, 191, 211, 241, 277, 283, 353, 367, 401, 461, 509, 547, 563, 587, 617, 739, 773, 797, 859, 877, 967, 991, 1031, 1063, 1087, 1171, 1201, 1217, 1409, 1433, 1447, 1471, 1499, 1597, 1621, 1669, 1723, 1741, 1823, 1913, 2027, 2063, 2081, 2099, 2221, 2269, 2341, 2351
Offset: 1

Views

Author

Zak Seidov and Robert G. Wilson v, Sep 17 2015

Keywords

Comments

Old (incorrect) name was: Primes not appearing in A121543.
Number of terms less than 10^n: 1, 6, 30, 165, 1024, ... .

Examples

			11 is a term: 11 -> 5 -> 3 -> 2 -> 1, four (an even number of) steps "->" = pi = A000720.
		

Crossrefs

Cf. A000040, A000720, A078442, A121543, A333242 (complement in primes).

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:= a(n-1);
          do p:= nextprime(p);
             if b(p)::even then break fi
          od; p
        end: a(1):=3:
    seq(a(n), n=1..60);  # Alois P. Heinz, Mar 15 2020
  • Mathematica
    fQ[n_] := If[ !PrimeQ[n] || (PrimeQ[n] && FreeQ[lst, PrimePi[n]]), AppendTo[lst, n]]; k = 2; lst = {1}; While[k < 2401, fQ@ k; k++]; Select[lst, PrimeQ]
  • PARI
    b(n)={my(k=0); while(isprime(n), k++; n=primepi(n)); k};
    apply(prime, select(n->b(n)%2, [1..500])) \\ Michel Marcus, Jan 03 2022; after A333242

Formula

From Alois P. Heinz, Mar 15 2020: (Start)
{ p in primes : A078442(p) mod 2 = 0 }.
a(n) = prime(A333242(n)). (End)

Extensions

New name from Alois P. Heinz, Mar 15 2020

A333243 Prime numbers with prime indices in A262275.

Original entry on oeis.org

5, 31, 59, 179, 331, 431, 599, 709, 919, 1153, 1297, 1523, 1787, 1847, 2381, 2477, 2749, 3259, 3637, 3943, 4091, 4273, 4549, 5623, 5869, 6113, 6661, 6823, 7607, 7841, 8221, 8527, 8719, 9461, 9739, 9859, 11743, 11953, 12097, 12301, 12547, 13469, 13709, 14177
Offset: 1

Views

Author

Michael P. May, Mar 12 2020

Keywords

Comments

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

Examples

			a(1) = prime(A262275(1)) = prime(3) = 5.
		

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>1 and h::odd)(b(p)) then break fi
          od; p
        end:
    seq(a(n), n=1..50);  # 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[#>1 && OddQ[#]&[b[p]], Break[]]]; p];
    Array[a, 50] (* 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(x)), select(n->b(n)%2, [1..500])) \\ Michel Marcus, Nov 18 2022

Formula

a(n) = prime(A262275(n)).

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

Views

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)).

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

Views

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

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

Views

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

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

Views

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)).

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

Views

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
Showing 1-8 of 8 results.