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 29 results. Next

A007097 Primeth recurrence: a(n+1) = a(n)-th prime.

Original entry on oeis.org

1, 2, 3, 5, 11, 31, 127, 709, 5381, 52711, 648391, 9737333, 174440041, 3657500101, 88362852307, 2428095424619, 75063692618249, 2586559730396077, 98552043847093519, 4123221751654370051, 188272405179937051081, 9332039515881088707361, 499720579610303128776791, 28785866289100396890228041
Offset: 0

Views

Author

Keywords

Comments

A007097(n) = Min {k : A109301(k) = n} = the first k whose rote height is n, the level set leader or minimum inverse function corresponding to A109301. - Jon Awbrey, Jun 26 2005
Lubomir Alexandrov informs me that he studied this sequence in his 1965 notebook. - N. J. A. Sloane, May 23 2008
a(n) is the Matula-Goebel number of the rooted path tree on n+1 vertices. The Matula-Goebel number of a rooted tree can be defined in the following recursive manner: to the one-vertex tree there corresponds the number 1; to a tree T with root degree 1 there corresponds the t-th prime number, where t is the Matula-Goebel number of the tree obtained from T by deleting the edge emanating from the root; to a tree T with root degree m>=2 there corresponds the product of the Matula-Goebel numbers of the m branches of T. - Emeric Deutsch, Feb 18 2012
Conjecture: log(a(1))*log(a(2))*...*log(a(n)) ~ a(n). - Thomas Ordowski, Mar 26 2015

References

  • Lubomir Alexandrov, unpublished notes, circa 1960.
  • L. Longeri, Towards understanding nature and the aesthetics of prime numbers, https://www.longeri.org/prime/nature.html [Broken link, but leave the URL here for historical reasons]
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Row 1 of array A114537.
Left edge of tree A227413, right edge of A246378.
Cf. A078442, A109082 (left inverses).
Subsequence of A245823.

Programs

  • GAP
    P:=Filtered([1..60000],IsPrime);;
    a:=[1];; for n in [2..10] do a[n]:=P[a[n-1]]; od; a; # Muniru A Asiru, Dec 22 2018
  • Haskell
    a007097 n = a007097_list !! n
    a007097_list = iterate a000040 1  -- Reinhard Zumkeller, Jul 14 2013
    
  • Maple
    seq((ithprime@@n)(1),n=0..10); # Peter Luschny, Oct 16 2012
  • Mathematica
    NestList[Prime@# &, 1, 16] (* Robert G. Wilson v, May 30 2006 *)
  • PARI
    print1(p=1);until(,print1(","p=prime(p)))  \\ M. F. Hasler, Oct 09 2011
    

Formula

A049084(a(n+1)) = a(n). - Reinhard Zumkeller, Jul 14 2013
a(n)/a(n-1) ~ log(a(n)) ~ prime(n). - Thomas Ordowski, Mar 26 2015
a(n) = prime^{[n]}(1), with the prime function prime(k) = A000040(k), with a(0) = 1. See the name and the programs. - Wolfdieter Lang, Apr 03 2018
Sum_{n>=1} 1/a(n) = A292667. - Amiram Eldar, Oct 15 2020

Extensions

a(15) corrected and a(16)-a(17) added by Paul Zimmermann
a(18)-a(19) found by David Baugh using a program by Xavier Gourdon and Andrey V. Kulsha, Oct 25 2007
a(20)-a(21) found by Andrey V. Kulsha using a program by Xavier Gourdon, Oct 02 2011
a(22) from Henri Lifchitz, Oct 14 2014
a(23) from David Baugh using Kim Walisch's primecount, May 16 2016

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]

A049076 Number of steps in the prime index chain for the n-th prime.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Let p(k) = k-th prime, let S(p) = S(p(k)) = k, the subscript of p; a(n) = order of primeness of p(n) = 1+m where m is largest number such that S(S(..S(p(n))...)) with m S's is a prime.
The record holders correspond to A007097.

Examples

			11 is 5th prime, so S(11)=5, 5 is 3rd prime, so S(S(11))=3, 3 is 2nd prime, so S(S(S(11)))=2, 2 is first prime, so S(S(S(S(11))))=1, not a prime. Thus a(5)=4.
Alternatively, a(5) = 4: the 5th prime is 11 and its prime index chain is 11->5->3->2->1->0. a(6) = 1: the 6th prime is 13 and its prime index chain is 13->6->0.
		

Crossrefs

Programs

  • Haskell
    a049076 = (+ 1) . a078442  -- Reinhard Zumkeller, Jul 14 2013
  • Maple
    A049076 := proc(n)
        if not isprime(n) then
            1 ;
        else
            1+procname(numtheory[pi](n)) ;
        end if;
    end proc:
    seq(A049076(n),n=1..30) ; # R. J. Mathar, Jan 28 2014
  • Mathematica
    A049076 f[n_] := Length[ NestWhileList[ PrimePi, n, PrimeQ]]; Table[ f[n], {n, 105}] (* Robert G. Wilson v, Mar 11 2004 *)
    Table[Length[NestWhileList[PrimePi[#]&,Prime[n],PrimeQ[#]&]]-1,{n,110}] (* Harvey P. Dale, May 07 2018 *)
  • PARI
    apply(p->my(s=1);while(isprime(p=primepi(p)),s++); s, primes(100)) \\ Charles R Greathouse IV, Nov 20 2012
    

Formula

Let b(n) = 0 if n is nonprime, otherwise b(n) = k where n is the k-th prime. Then a(n) is the number of times you can apply b to the n-th prime before you hit a nonprime.
a(n) = 1 + A078442(n). - R. J. Mathar, Jul 07 2012
a(n) = A078442(A000040(n)). - Alois P. Heinz, Mar 16 2020

Extensions

Additional comments from Gabriel Cunningham (gcasey(AT)mit.edu), Apr 12 2003

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

A049078 Primes prime(k) for which A049076(k) = 2.

Original entry on oeis.org

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

Views

Author

Keywords

Examples

			For these primes S(p) is a prime but S(S(p)) is not. E.g. S(17)=7, S(7)=4.
		

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

Formula

a(n) = prime(A007821(n)). - Juri-Stepan Gerasimov, Aug 11 2008
a(n) ~ A006450(n) ~ n log^2 n. - Charles R Greathouse IV, Apr 29 2015

Extensions

Edited by N. J. A. Sloane, Aug 29 2008 at the suggestion of R. J. Mathar
Spelling/notation corrections by Charles R Greathouse IV, Mar 18 2010

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

A049090 Primes for which A049076 >= 4.

Original entry on oeis.org

11, 31, 127, 277, 709, 1063, 1787, 2221, 3001, 4397, 5381, 7193, 8527, 9319, 10631, 12763, 15299, 15823, 19577, 21179, 22093, 24859, 27457, 30133, 33967, 37217, 38833, 40819, 42043, 43651, 52711, 55351, 57943, 60647, 66851, 68639, 72727
Offset: 1

Views

Author

Keywords

Comments

Union of A049080, A049081, A058322, A058324, etc. - R. J. Mathar, Jul 07 2012

Crossrefs

Programs

  • Maple
    map(ithprime@@3, select(isprime, [$1..157])); # Peter Luschny, Feb 17 2014
  • Mathematica
    Nest[ Prime, Range[40], 4] (* Robert G. Wilson v, Mar 15 2004 *)
  • PARI
    list(lim)=my(v=List(),q,r,s); forprime(p=2,lim,if(isprime(q++)&&isprime(r++)&&isprime(s++),listput(v,p))); Vec(v) \\ Charles R Greathouse IV, Feb 16 2017

Formula

a(n) = A006450(A006450(n)). - James G. Merickel, Feb 14 2010
a(n) = A000040(A038580(n)). - R. J. Mathar, Jul 07 2012
a(n) ~ n (log n)^4. - Charles R Greathouse IV, Feb 16 2017

Extensions

Name corrected by Sean A. Irvine, Jul 18 2021

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

Showing 1-10 of 29 results. Next