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.

Previous Showing 11-20 of 270 results. Next

A076610 Numbers having only prime factors of form prime(prime); a(1)=1.

Original entry on oeis.org

1, 3, 5, 9, 11, 15, 17, 25, 27, 31, 33, 41, 45, 51, 55, 59, 67, 75, 81, 83, 85, 93, 99, 109, 121, 123, 125, 127, 135, 153, 155, 157, 165, 177, 179, 187, 191, 201, 205, 211, 225, 241, 243, 249, 255, 275, 277, 279, 283, 289, 295, 297, 327, 331, 335, 341, 353, 363
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 21 2002

Keywords

Comments

Numbers n such that the partition B(n) has only prime parts. For n>=2, B(n) is defined as the partition obtained by taking the prime decomposition of n and replacing each prime factor p by its index i (i.e. i-th prime = p); also B(1) = the empty partition. For example, B(350) = B(2*5^2*7) = [1,3,3,4]. B is a bijection between the positive integers and the set of all partitions. In the Maple program the command B(n) yields B(n). - Emeric Deutsch, May 09 2015
Multiplicative closure of A006450.
Sequence A064988 sorted into ascending order. - Antti Karttunen, Aug 08 2017
From David A. Corneth, Sep 28 2020: (Start)
Product_{p in A006450} p/(p-1) where primepi(p) <= 10^k for k = 3..10 respectively is
2.7609365004752546...
2.8489587563778631...
2.9038201166664191...
2.9413699333962213...
2.9687172228411300...
2.9895324403761206...
3.0059192857697702...
3.0191633206253085... (End)

Examples

			99 = 11*3*3 = A000040(A000040(3))*A000040(A000040(1))^2, therefore 99 is a term.
		

Crossrefs

Programs

  • Maple
    with(numtheory): B := proc (n) local pf: pf := op(2, ifactors(n)): [seq(seq(pi(op(1, op(i, pf))), j = 1 .. op(2, op(i, pf))), i = 1 .. nops(pf))] end proc: S := {}: for r to 400 do s := 0: for t to nops(B(r)) do if isprime(B(r)[t]) = false then s := s+1 else end if end do: if s = 0 then S := `union`(S, {r}) else end if end do: S; # Emeric Deutsch, May 09 2015
  • Mathematica
    {1}~Join~Select[Range@ 400, AllTrue[PrimePi@ First@ Transpose@ FactorInteger@ #, PrimeQ] &] (* Michael De Vlieger, May 09 2015, Version 10 *)
  • PARI
    isok(k) = my(f = factor(k)[,1]); sum(i=1, #f, isprime(primepi(f[i]))) == #f; \\ Michel Marcus, Sep 16 2022

Formula

Sum_{n>=1} 1/a(n) = Product_{p in A006450} p/(p-1) converges since the sum of the reciprocals of A006450 converges. - Amiram Eldar, Sep 27 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]

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

A320628 Products of primes of nonprime index.

Original entry on oeis.org

1, 2, 4, 7, 8, 13, 14, 16, 19, 23, 26, 28, 29, 32, 37, 38, 43, 46, 47, 49, 52, 53, 56, 58, 61, 64, 71, 73, 74, 76, 79, 86, 89, 91, 92, 94, 97, 98, 101, 103, 104, 106, 107, 112, 113, 116, 122, 128, 131, 133, 137, 139, 142, 146, 148, 149, 151, 152, 158, 161, 163
Offset: 1

Views

Author

Gus Wiseman, Oct 18 2018

Keywords

Comments

The index of a prime number n is the number m such that n is the m-th prime.
The asymptotic density of this sequence is Product_{p in A006450} (1 - 1/p) = 1/(Sum_{n>=1} 1/A076610(n)) < 1/3. - Amiram Eldar, Feb 02 2021

Examples

			The sequence of terms begins:
   1 = 1
   2 = prime(1)
   4 = prime(1)^2
   7 = prime(4)
   8 = prime(1)^3
  13 = prime(6)
  14 = prime(1)*prime(4)
  16 = prime(1)^4
  19 = prime(8)
  23 = prime(9)
  26 = prime(1)*prime(6)
  28 = prime(1)^2*prime(4)
  29 = prime(10)
  32 = prime(1)^5
  37 = prime(12)
  38 = prime(1)*prime(8)
  43 = prime(14)
  46 = prime(1)*prime(9)
  47 = prime(15)
  49 = prime(4)^2
  52 = prime(1)^2*prime(6)
  53 = prime(16)
  56 = prime(1)^3*prime(4)
  58 = prime(1)*prime(10)
  61 = prime(18)
  64 = prime(1)^6
  71 = prime(20)
  73 = prime(21)
  74 = prime(1)*prime(12)
  76 = prime(1)^2*prime(8)
  79 = prime(22)
  86 = prime(1)*prime(14)
  89 = prime(24)
  91 = prime(4)*prime(6)
  92 = prime(1)^2*prime(9)
  94 = prime(1)*prime(15)
  97 = prime(25)
  98 = prime(1)*prime(4)^2
		

Crossrefs

Complement of A331386.
Positions of zeros in A257994.
Primes of prime index are A006450.
Primes of nonprime index are A007821.
Products of primes of prime index are A076610.
Products of primes of nonprime index are this sequence.
The number of prime prime indices is given by A257994.
The number of nonprime prime indices is given by A330944.

Programs

  • Mathematica
    Select[Range[100],And@@Not/@PrimeQ/@PrimePi/@First/@FactorInteger[#]&]

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

A257994 Number of prime parts in the partition having Heinz number n.

Original entry on oeis.org

0, 0, 1, 0, 1, 1, 0, 0, 2, 1, 1, 1, 0, 0, 2, 0, 1, 2, 0, 1, 1, 1, 0, 1, 2, 0, 3, 0, 0, 2, 1, 0, 2, 1, 1, 2, 0, 0, 1, 1, 1, 1, 0, 1, 3, 0, 0, 1, 0, 2, 2, 0, 0, 3, 2, 0, 1, 0, 1, 2, 0, 1, 2, 0, 1, 2, 1, 1, 1, 1, 0, 2, 0, 0, 3, 0, 1, 1, 0, 1, 4, 1, 1, 1, 2, 0, 1, 1, 0, 3
Offset: 1

Views

Author

Emeric Deutsch, May 20 2015

Keywords

Comments

We define the Heinz number of a partition p = [p_1, p_2, ..., p_r] as Product(p_j-th prime, j=1...r) (concept used by Alois P. Heinz in A215366 as an "encoding" of a partition). For example, for the partition [1, 1, 2, 4, 10] we get 2*2*3*7*29 = 2436.
In the Maple program the subprogram B yields the partition with Heinz number n.
The number of nonprime parts is given by A330944, so A001222(n) = a(n) + A330944(n). - Gus Wiseman, Jan 17 2020

Examples

			a(30) = 2 because the partition with Heinz number 30 = 2*3*5 is [1,2,3], having 2 prime parts.
		

References

  • George E. Andrews and Kimmo Eriksson, Integer Partitions, Cambridge Univ. Press, Cambridge, 2004.

Crossrefs

Positions of positive terms are A331386.
Primes of prime index are A006450.
Products of primes of prime index are A076610.
The number of nonprime prime indices is A330944.

Programs

  • Maple
    with(numtheory): a := proc (n) local B, ct, s: B := proc (n) local nn, j, m: nn := op(2, ifactors(n)): for j to nops(nn) do m[j] := op(j, nn) end do: [seq(seq(pi(op(1, m[i])), q = 1 .. op(2, m[i])), i = 1 .. nops(nn))] end proc: ct := 0: for s to nops(B(n)) do if isprime(B(n)[s]) = true then ct := ct+1 else end if end do: ct end proc: seq(a(n), n = 1 .. 130);
  • Mathematica
    B[n_] := Module[{nn, j, m}, nn = FactorInteger[n]; For[j = 1, j <= Length[nn], j++, m[j] = nn[[j]]]; Flatten[Table[Table[PrimePi[  m[i][[1]]], {q, 1, m[i][[2]]}], {i, 1, Length[nn]}]]];
    a[n_] := Module[{ct, s}, ct = 0; For[s = 1, s <= Length[B[n]], s++, If[ PrimeQ[B[n][[s]]], ct++]]; ct];
    Table[a[n], {n, 1, 130}] (* Jean-François Alcover, Apr 25 2017, translated from Maple *)
    Table[Total[Cases[FactorInteger[n],{p_,k_}/;PrimeQ[PrimePi[p]]:>k]],{n,30}] (* Gus Wiseman, Jan 17 2020 *)
  • PARI
    a(n) = my(f = factor(n)); sum(i=1, #f~, if(isprime(primepi(f[i, 1])), f[i, 2], 0)); \\ Amiram Eldar, Nov 03 2023

Formula

Additive with a(p^e) = e if primepi(p) is prime, and 0 otherwise. - Amiram Eldar, Nov 03 2023

A078442 a(p) = a(n) + 1 if p is the n-th prime, prime(n); a(n)=0 if n is not prime.

Original entry on oeis.org

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

Views

Author

Henry Bottomley, Dec 31 2002

Keywords

Comments

Fernandez calls this the order of primeness of n.
a(A007097(n))=n, for any n >= 0. - Paul Tek, Nov 12 2013
When a nonoriented rooted tree is encoded as a Matula-Goebel number n, a(n) tells how many edges needs to be climbed up from the root of the tree until the first branching vertex (or the top of the tree, if n is one of the terms of A007097) is encountered. Please see illustrations at A061773. - Antti Karttunen, Jan 27 2014
Zero-based column index of n in the Kimberling-style dispersion table of the primes (see A114537). - Allan C. Wechsler, Jan 09 2024

Examples

			a(1) = 0 since 1 is not prime;
a(2) = a(prime(1)) = a(1) + 1 = 1 + 0 = 1;
a(3) = a(prime(2)) = a(2) + 1 = 1 + 1 = 2;
a(4) = 0 since 4 is not prime;
a(5) = a(prime(3)) = a(3) + 1 = 2 + 1 = 3;
a(6) = 0 since 6 is not prime;
a(7) = a(prime(4)) = a(4) + 1 = 0 + 1 = 1.
		

Crossrefs

A left inverse of A007097.
One less than A049076.
a(A000040(n)) = A049076(n).
Cf. A373338 (mod 2), A018252 (positions of zeros).
Cf. permutations A235489, A250247/A250248, A250249/A250250, A245821/A245822 that all preserve a(n).
Cf. also array A114537 (A138947) and permutations A135141/A227413, A246681.

Programs

  • Haskell
    a078442 n = fst $ until ((== 0) . snd)
                            (\(i, p) -> (i + 1, a049084 p)) (-2, a000040 n)
    -- Reinhard Zumkeller, Jul 14 2013
  • Maple
    A078442 := proc(n)
        if not isprime(n) then
            0 ;
        else
            1+procname(numtheory[pi](n)) ;
        end if;
    end proc: # R. J. Mathar, Jul 07 2012
  • Mathematica
    a[n_] := a[n] = If[!PrimeQ[n], 0, 1+a[PrimePi[n]]]; Array[a, 105] (* Jean-François Alcover, Jan 26 2018 *)
  • PARI
    A078442(n)=for(i=0,n, isprime(n) || return(i); n=primepi(n)) \\ M. F. Hasler, Mar 09 2010
    

Formula

a(n) = A049076(n)-1.
a(n) = if A049084(n) = 0 then 0 else a(A049084(n)) + 1. - Reinhard Zumkeller, Jul 14 2013
For all n, a(n) = A007814(A135141(n)) and a(A227413(n)) = A007814(n). Also a(A235489(n)) = a(n). - Antti Karttunen, Jan 27 2014

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
Previous Showing 11-20 of 270 results. Next