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-10 of 33 results. Next

A006450 Prime-indexed primes: primes with prime subscripts.

Original entry on oeis.org

3, 5, 11, 17, 31, 41, 59, 67, 83, 109, 127, 157, 179, 191, 211, 241, 277, 283, 331, 353, 367, 401, 431, 461, 509, 547, 563, 587, 599, 617, 709, 739, 773, 797, 859, 877, 919, 967, 991, 1031, 1063, 1087, 1153, 1171, 1201, 1217, 1297, 1409, 1433, 1447, 1471
Offset: 1

Views

Author

Jeffrey Shallit, Nov 25 1975

Keywords

Comments

Subsequence of A175247 (primes (A000040) with noncomposite (A008578) subscripts), a(n) = A175247(n+1). - Jaroslav Krizek, Mar 13 2010
Primes p such that p and pi(p) are both primes. - Juri-Stepan Gerasimov, Jul 14 2011
Sum_{n>=1} 1/a(n) converges. In fact, Sum_{n>N} 1/a(n) < 1/log(N), by the integral test. - Jonathan Sondow, Jul 11 2012
The number of such primes not exceeding x > 0 is pi(pi(x)). I conjecture that the sequence a(n)^(1/n) (n = 1,2,3,...) is strictly decreasing. This is an analog of the Firoozbakht conjecture on primes. - Zhi-Wei Sun, Aug 17 2015
Limit_{n->infinity} a(n)/(n*(log(n))^2) = 1. Proof: By Cipolla's asymptotic formula, prime(n) ~ L(n) + R(n), where L(n)/n = log(n) + log(log(n)) - 1 and R(n)/n decreases logarithmically to 0. Hence, for large n, a(n) = prime(prime(n)) ~ L(L(n)+R(n)) + R(L(n)+R(n)) = n*(log(n))^2 + r(n), where r(n) grows as O(n*log(n)*log(log(n))). The rest of the proof is trivial. The convergence is very slow: for k = 1,2,3,4,5,6, sqrt(a(10^k)/10^k)/log(10^k) evaluates to 2.055, 1.844, 1.695, 1.611, 1.545, and 1.493, respectively. - Stanislav Sykora, Dec 09 2015

Examples

			a(5) = 31 because a(5) = p(p(5)) = p(11) = 31.
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Primes for which A049076 > 1.
Cf. A185723 and A214296 for numbers and primes that are sums of distinct a(n); cf. A213356 and A185724 for those that are not.
Let A = primes A000040, B = nonprimes A018252. The 2-level compounds are AA = A006450, AB = A007821, BA = A078782, BB = A102615. The 3-level compounds AAA, AAB, ..., BBB are A038580, A049078, A270792, A102617, A270794, A270795, A270796, A102616.

Programs

  • Haskell
    a006450 = a000040 . a000040
    a006450_list = map a000040 a000040_list
    -- Reinhard Zumkeller, Jan 12 2013
    
  • Magma
    [ NthPrime(NthPrime(n)): n in [1..51] ]; // Jason Kimberley, Apr 02 2010
    
  • Maple
    seq(ithprime(ithprime(i)),i=1..50); # Uli Baum (Uli_Baum(AT)gmx.de), Sep 05 2007
    # For Maple code for the prime/nonprime compound sequences (listed in cross-references) see A003622. - N. J. A. Sloane, Mar 30 2016
  • Mathematica
    Table[ Prime[ Prime[ n ] ], {n, 100} ]
  • PARI
    i=0;forprime(p=2,1e4,if(isprime(i++),print1(p", "))) \\ Charles R Greathouse IV, Jun 10 2011
    
  • PARI
    a=vector(10^3,n,prime(prime(n))) \\ Stanislav Sykora, Dec 09 2015
    
  • Python
    from sympy import prime
    def a(n): return prime(prime(n))
    print([a(n) for n in range(1, 52)]) # Michael S. Branicky, Aug 11 2021
    
  • Python
    # much faster version for initial segment of sequence
    from sympy import nextprime, isprime
    def aupton(terms):
        alst, p, pi = [], 2, 1
        while len(alst) < terms:
            if isprime(pi): alst.append(p)
            p, pi = nextprime(p), pi+1
        return alst
    print(aupton(10000)) # Michael S. Branicky, Aug 11 2021

Formula

a(n) = prime(prime(n)) = A000040(A000040(n)). - Juri-Stepan Gerasimov, Sep 24 2009
a(n) > n*(log(n))^2, as prime(n) > n*log(n) by Rosser's theorem. - Jonathan Sondow, Jul 11 2012
a(n)/log(a(n)) ~ prime(n). - Thomas Ordowski, Mar 30 2015
Sum_{n>=1} 1/a(n) is in the interval (1.04299, 1.04365) (Bayless et al., 2013). - Amiram Eldar, Oct 15 2020

A007821 Primes p such that pi(p) is not prime.

Original entry on oeis.org

2, 7, 13, 19, 23, 29, 37, 43, 47, 53, 61, 71, 73, 79, 89, 97, 101, 103, 107, 113, 131, 137, 139, 149, 151, 163, 167, 173, 181, 193, 197, 199, 223, 227, 229, 233, 239, 251, 257, 263, 269, 271, 281, 293, 307, 311, 313, 317, 337, 347, 349, 359, 373
Offset: 1

Views

Author

Monte J. Zerger (mzerger(AT)cc4.adams.edu), Clark Kimberling

Keywords

Comments

Primes prime(k) such that A049076(k)=1, sorted along increasing k. - R. J. Mathar, Jan 28 2014
The complement of A006450 (primes with prime index) within the primes A000040.

References

  • C. Kimberling, Fractal sequences and interspersions, Ars Combinatoria, vol. 45 p 157 1997.

Crossrefs

Let A = primes A000040, B = nonprimes A018252. The 2-level compounds are AA = A006450, AB = A007821, BA = A078782, BB = A102615. The 3-level compounds AAA, AAB, ..., BBB are A038580, A049078, A270792, A102617, A270794, A270795, A270796, A102616.

Programs

  • Haskell
    a007821 = a000040 . a018252
    a007821_list = map a000040 a018252_list
    -- Reinhard Zumkeller, Jan 12 2013
    
  • Maple
    A007821 := proc(n) ithprime(A018252(n)) ; end proc: # R. J. Mathar, Jul 07 2012
  • Mathematica
    Prime[ Select[ Range[75], !PrimeQ[ # ] &]] (* Robert G. Wilson v, Mar 15 2004 *)
    With[{nn=100},Pick[Prime[Range[nn]],Table[If[PrimeQ[n],0,1],{n,nn}],1]] (* Harvey P. Dale, Aug 14 2020 *)
  • PARI
    forprime(p=2, 1e3, if(!isprime(primepi(p)), print1(p, ", "))) \\ Felix Fröhlich, Aug 16 2014
    
  • Python
    from sympy import primepi
    def A007821(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return n+x-(p:=primepi(x))+primepi(p)
        return bisection(f,n,n) # Chai Wah Wu, Oct 19 2024

Formula

A137588(a(n)) = n; a(n) = A000040(A018252(n)). - Reinhard Zumkeller, Jan 28 2008
A175247 U { a(n); n > 1 } = A000040. { a(n) } = { 2 } U { primes (A000040) with composite index (A002808) }. - Jaroslav Krizek, Mar 13 2010
G.f. over nonprime powers: Sum_{k >= 1} prime(k)*x^k-prime(prime(k))*x^prime(k). - Benedict W. J. Irwin, Jun 11 2016

Extensions

Edited by M. F. Hasler, Jul 31 2015

A114537 Dispersion of the primes (an array read by downward antidiagonals).

Original entry on oeis.org

1, 2, 4, 3, 7, 6, 5, 17, 13, 8, 11, 59, 41, 19, 9, 31, 277, 179, 67, 23, 10, 127, 1787, 1063, 331, 83, 29, 12, 709, 15299, 8527, 2221, 431, 109, 37, 14, 5381, 167449, 87803, 19577, 3001, 599, 157, 43, 15, 52711, 2269733, 1128889, 219613, 27457, 4397, 919, 191, 47
Offset: 1

Views

Author

Clark Kimberling, Dec 07 2005

Keywords

Comments

A number is prime if and only if it does not lie in Column 1. As a sequence, a permutation of the natural numbers. The fractal sequence of this dispersion is A022447 and the transposition sequence is A114538.
The dispersion of the composite numbers is given at A114577.

Examples

			Northwest corner of the Primeness array:
1   2   3    5    11     31     127       709       5381       52711        648391
4   7  17   59   277   1787   15299    167449    2269733    37139213     718064159
6  13  41  179  1063   8527   87803   1128889   17624813   326851121    7069067389
8  19  67  331  2221  19577  219613   3042161   50728129   997525853   22742734291
9  23  83  431  3001  27457  318211   4535189   77557187  1559861749   36294260117
10  29 109  599  4397  42043  506683   7474967  131807699  2724711961   64988430769
12  37 157  919  7193  72727  919913  14161729  259336153  5545806481  136395369829
14  43 191 1153  9319  96797 1254739  19734581  368345293  8012791231  200147986693
15  47 211 1297 10631 112129 1471343  23391799  440817757  9672485827  243504973489
16  53 241 1523 12763 137077 1828669  29499439  563167303 12501968177  318083817907
18  61 283 1847 15823 173867 2364361  38790341  751783477 16917026909  435748987787
20  71 353 2381 21179 239489 3338989  56011909 1107276647 25366202179  664090238153
21  73 367 2477 22093 250751 3509299  59053067 1170710369 26887732891  705555301183
22  79 401 2749 24859 285191 4030889  68425619 1367161723 31621854169  835122557939
24  89 461 3259 30133 352007 5054303  87019979 1760768239 41192432219 1099216100167
25  97 509 3637 33967 401519 5823667 101146501 2062666783 48596930311 1305164025929
26 101 547 3943 37217 443419 6478961 113256643 2323114841 55022031709 1484830174901
27 103 563 4091 38833 464939 6816631 119535373 2458721501 58379844161 1579041544637
		

References

  • Alexandrov, Lubomir. "On the nonasymptotic prime number distribution." arXiv preprint math/9811096 (1998). (See Appendix.)
  • Clark Kimberling, "Fractal sequences and interspersions," Ars Combinatoria, 45 (1997) 157-168.

Crossrefs

Diagonal: A181441.
If the antidiagonals are read in the opposite direction we get A138947.

Programs

  • Maple
    A114537 := proc(r,c) option remember; if c = 1 then A018252(r) ; else ithprime(procname(r,c-1)) ; end if; end proc: # R. J. Mathar, Oct 22 2010
  • Mathematica
    NonPrime[n_] := FixedPoint[n + PrimePi@# + 1 &, n]; t[n_, k_] := Nest[Prime, NonPrime[n], k]; Table[ t[n - k, k], {n, 0, 9}, {k, n, 0, -1}] // Flatten
    (* or to view the table *) Table[t[n, k], {n, 0, 6}, {k, 0, 10}] // TableForm (* Robert G. Wilson v, Dec 26 2005 *)

Formula

T(r,1) = A018252(r). T(r,c) = prime(T(r,c-1)), c>1. [R. J. Mathar, Oct 22 2010]

A114538 Transposition sequence of the dispersion of the primes.

Original entry on oeis.org

1, 4, 6, 2, 8, 3, 7, 5, 11, 31, 9, 127, 17, 709, 5381, 52711, 13, 648391, 59, 9737333, 174440041, 3657500101, 277, 88362852307, 2428095424619, 75063692618249, 2586559730396077
Offset: 1

Views

Author

Clark Kimberling, Dec 07 2005

Keywords

Comments

A self-inverse permutation of the positive integers.

Examples

			Start with the northwest corner of T:
1 2 3 5 11 31 127 709 5381 52711 648391
4 7 17 59 277 1787 15299 167449 2269733 37139213 718064159
6 13 41 179 1063 8527 87803 1128889 17624813 326851121 7069067389
8 19 67 331 2221 19577 219613 3042161 50728129 997525853 22742734291
9 23 83 431 3001 27457 319211 4535189 77557187 1559861749 36294260117
10 29 109 599 4397 42043 506683 7474967 131807699 2824711961 64988430769
12 37 157 919 7193 72727 919913 14161729 259336153 5545806481 136395369829
a(1)=1 because 1=T(1,1) and T(1,1)=1.
a(2)=4 because 2=T(1,2) and T(2,1)=4.
a(3)=6 because 3=T(1,3) and T(3,1)=6.
a(13)=17 because 13=T(3,2) and T(2,3)=17.
		

Crossrefs

Cf. A114537.
Columns 1-6 above: A018252, A007821, A049078, A049079, A049080, A049081.

Formula

Suppose T is a rectangular array consisting of positive integers, each exactly once. The transposition sequence of T is here defined by placing T(i, j) in position T(j, i) for all i and j.

Extensions

a(22)-a(27) from Robert G. Wilson v, Dec 24 2005

A038580 Primes with indices that are primes with prime indices.

Original entry on oeis.org

5, 11, 31, 59, 127, 179, 277, 331, 431, 599, 709, 919, 1063, 1153, 1297, 1523, 1787, 1847, 2221, 2381, 2477, 2749, 3001, 3259, 3637, 3943, 4091, 4273, 4397, 4549, 5381, 5623, 5869, 6113, 6661, 6823, 7193, 7607, 7841, 8221, 8527, 8719, 9319, 9461, 9739
Offset: 1

Views

Author

Keywords

Crossrefs

Primes p for which A049076(p) > 3.
Second differences give A245175.
Let A = primes A000040, B = nonprimes A018252. The 2-level compounds are AA = A006450, AB = A007821, BA = A078782, BB = A102615. The 3-level compounds AAA, AAB, ..., BBB are A038580, A049078, A270792, A102617, A270794, A270795, A270796, A102616.

Programs

  • Magma
    [NthPrime(NthPrime(NthPrime(n))): n in [1..50]]; // Vincenzo Librandi, Jul 17 2016
  • Maple
    a:= ithprime@@3;
    seq(a(n), n=1..50);  # Alois P. Heinz, Jun 14 2015
    # For Maple code for the prime/nonprime compound sequences (listed in cross-references) see A003622. - N. J. A. Sloane, Mar 30 2016
  • Mathematica
    Table[ Prime[ Prime[ Prime[ n ] ] ], {n, 1, 60} ]
    Nest[Prime, Range[45], 3] (* Robert G. Wilson v, Mar 15 2004 *)
  • PARI
    a(n) = prime(prime(prime(n))) \\ Charles R Greathouse IV, Apr 28 2015
    
  • PARI
    list(lim)=my(v=List(),q,r); forprime(p=2,lim, if(isprime(q++) && isprime(r++), listput(v,p))); Set(v) \\ Charles R Greathouse IV, Feb 14 2017
    

Formula

a(n) = prime(prime(prime(n))).
a(n) ~ n*log(n)^3. - Ilya Gutkovskiy, Jul 17 2016

A049081 Primes prime(k) for which A049076(k) = 5.

Original entry on oeis.org

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

Views

Author

Keywords

Crossrefs

Programs

Extensions

More terms from Robert G. Wilson v, Dec 12 2000

A049079 Primes prime(k) for which A049076(k) = 3.

Original entry on oeis.org

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

Views

Author

Keywords

Crossrefs

Programs

Extensions

Definition edited by Zak Seidov, Sep 15 2013

A058322 Primes for which A049076(p) = 7.

Original entry on oeis.org

127, 15299, 87803, 219613, 318211, 506683, 919913, 1254739, 1471343, 1828669, 2364361, 3338989, 3509299, 4030889, 5054303, 5823667, 6478961, 6816631, 7220981, 7807321, 10311439, 10875143, 11469013, 12838937, 13243033, 15239333, 15837299, 16827557, 18143603
Offset: 1

Views

Author

Robert G. Wilson v, Dec 12 2000

Keywords

Crossrefs

Programs

  • Maple
    A058322 := proc(n)
            ithprime(A049081(n)) ;
    end proc: # R. J. Mathar, Jul 07 2012
    # second Maple program:
    map(ithprime@@6, remove(isprime, [$1..42]))[];  # Alois P. Heinz, Mar 15 2020
  • Mathematica
    Nest[ Prime, Select[ Range[40], !PrimeQ[ # ] &], 6] (* Robert G. Wilson v, Mar 15 2004 *)

Formula

a(n) = A000040(A049081(n)).

Extensions

More terms from Alois P. Heinz, Mar 15 2020

A049080 Primes prime(k) for which A049076(k) = 4.

Original entry on oeis.org

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

Views

Author

Keywords

Crossrefs

Programs

A058324 Primes for which A049076(p) = 8.

Original entry on oeis.org

709, 167449, 1128889, 3042161, 4535189, 7474967, 14161729, 19734581, 23391799, 29499439, 38790341, 56011909, 59053067, 68425619, 87019979, 101146501, 113256643, 119535373, 127065427, 138034009, 185350441, 196100297, 207460717, 233784751, 241568891, 280256489
Offset: 1

Views

Author

Robert G. Wilson v, Dec 12 2000

Keywords

Crossrefs

Programs

  • Maple
    map(ithprime@@7, remove(isprime, [$1..38]))[];  # Alois P. Heinz, Mar 15 2020
  • Mathematica
    Nest[ Prime, Select[ Range[34], !PrimeQ[ # ] &], 7] (* Robert G. Wilson v, Mar 15 2004 *)

Formula

a(n) = A000040(A058322(n)). - R. J. Mathar, Jul 07 2012

Extensions

More terms from Alois P. Heinz, Mar 15 2020
Showing 1-10 of 33 results. Next