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

A340104 Products of distinct primes of nonprime index (A007821).

Original entry on oeis.org

1, 2, 7, 13, 14, 19, 23, 26, 29, 37, 38, 43, 46, 47, 53, 58, 61, 71, 73, 74, 79, 86, 89, 91, 94, 97, 101, 103, 106, 107, 113, 122, 131, 133, 137, 139, 142, 146, 149, 151, 158, 161, 163, 167, 173, 178, 181, 182, 193, 194, 197, 199, 202, 203, 206, 214, 223, 226
Offset: 1

Views

Author

Gus Wiseman, Mar 12 2021

Keywords

Comments

A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.

Examples

			The sequence of terms together with the corresponding prime indices of prime indices begins:
     1: {}              58: {{},{1,3}}        113: {{1,2,3}}
     2: {{}}            61: {{1,2,2}}         122: {{},{1,2,2}}
     7: {{1,1}}         71: {{1,1,3}}         131: {{1,1,1,1,1}}
    13: {{1,2}}         73: {{2,4}}           133: {{1,1},{1,1,1}}
    14: {{},{1,1}}      74: {{},{1,1,2}}      137: {{2,5}}
    19: {{1,1,1}}       79: {{1,5}}           139: {{1,7}}
    23: {{2,2}}         86: {{},{1,4}}        142: {{},{1,1,3}}
    26: {{},{1,2}}      89: {{1,1,1,2}}       146: {{},{2,4}}
    29: {{1,3}}         91: {{1,1},{1,2}}     149: {{3,4}}
    37: {{1,1,2}}       94: {{},{2,3}}        151: {{1,1,2,2}}
    38: {{},{1,1,1}}    97: {{3,3}}           158: {{},{1,5}}
    43: {{1,4}}        101: {{1,6}}           161: {{1,1},{2,2}}
    46: {{},{2,2}}     103: {{2,2,2}}         163: {{1,8}}
    47: {{2,3}}        106: {{},{1,1,1,1}}    167: {{2,6}}
    53: {{1,1,1,1}}    107: {{1,1,4}}         173: {{1,1,1,3}}
		

Crossrefs

These primes (of nonprime index) are listed by A007821.
The non-strict version is A320628, with odd case A320629.
The odd case is A340105.
The prime instead of nonprime version:
primes: A006450
products: A076610
strict: A302590
The semiprime instead of nonprime version:
primes: A106349
products: A339112
strict: A340020
The squarefree semiprime instead of nonprime version:
strict: A309356
primes: A322551
products: A339113
A056239 gives the sum of prime indices, which are listed by A112798.
A257994 counts prime prime indices.
A302242 is the weight of the multiset of multisets with MM-number n.
A305079 is the number of connected components for MM-number n.
A320911 lists products of squarefree semiprimes (Heinz numbers of A338914).
A320912 lists products of distinct semiprimes (Heinz numbers of A338916).
A330944 counts nonprime prime indices.
A330945 lists numbers with a nonprime prime index (nonprime case: A330948).
A339561 lists products of distinct squarefree semiprimes (A339560).
MM-numbers: A255397 (normal), A302478 (set multisystems), A320630 (set multipartitions), A302494 (sets of sets), A305078 (connected), A316476 (antichains), A318991 (chains), A320456 (covers), A328514 (connected sets of sets), A329559 (clutters), A340019 (half-loop graphs).

Programs

  • Mathematica
    Select[Range[100],SquareFreeQ[#]&&FreeQ[If[#==1,{},FactorInteger[#]],{p_,k_}/;PrimeQ[PrimePi[p]]]&]

Formula

Equals A005117 /\ A320628.

A340105 Odd products of distinct primes of nonprime index (A007821).

Original entry on oeis.org

1, 7, 13, 19, 23, 29, 37, 43, 47, 53, 61, 71, 73, 79, 89, 91, 97, 101, 103, 107, 113, 131, 133, 137, 139, 149, 151, 161, 163, 167, 173, 181, 193, 197, 199, 203, 223, 227, 229, 233, 239, 247, 251, 257, 259, 263, 269, 271, 281, 293, 299, 301, 307, 311, 313, 317
Offset: 1

Views

Author

Gus Wiseman, Mar 12 2021

Keywords

Comments

A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.

Examples

			The sequence of terms together with the corresponding sets of multisets begins:
     1: {}              91: {{1,1},{1,2}}      173: {{1,1,1,3}}
     7: {{1,1}}         97: {{3,3}}            181: {{1,2,4}}
    13: {{1,2}}        101: {{1,6}}            193: {{1,1,5}}
    19: {{1,1,1}}      103: {{2,2,2}}          197: {{2,2,3}}
    23: {{2,2}}        107: {{1,1,4}}          199: {{1,9}}
    29: {{1,3}}        113: {{1,2,3}}          203: {{1,1},{1,3}}
    37: {{1,1,2}}      131: {{1,1,1,1,1}}      223: {{1,1,1,1,2}}
    43: {{1,4}}        133: {{1,1},{1,1,1}}    227: {{4,4}}
    47: {{2,3}}        137: {{2,5}}            229: {{1,3,3}}
    53: {{1,1,1,1}}    139: {{1,7}}            233: {{2,7}}
    61: {{1,2,2}}      149: {{3,4}}            239: {{1,1,6}}
    71: {{1,1,3}}      151: {{1,1,2,2}}        247: {{1,2},{1,1,1}}
    73: {{2,4}}        161: {{1,1},{2,2}}      251: {{1,2,2,2}}
    79: {{1,5}}        163: {{1,8}}            257: {{3,5}}
    89: {{1,1,1,2}}    167: {{2,6}}            259: {{1,1},{1,1,2}}
		

Crossrefs

These primes (of nonprime index) are listed by A007821.
The non-strict version is A320629, with not necessarily odd version A320628.
The not necessarily odd version is A340104.
The prime instead of odd nonprime version:
primes: A006450
products: A076610
strict: A302590
The squarefree semiprime instead of odd nonprime version:
strict: A309356
primes: A322551
products: A339113
The semiprime instead of odd nonprime version:
primes: A106349
products: A339112
strict: A340020
A001358 lists semiprimes.
A056239 gives the sum of prime indices, which are listed by A112798.
A257994 counts prime prime indices.
A302242 is the weight of the multiset of multisets with MM-number n.
A305079 is the number of connected components for MM-number n.
A330944 counts nonprime prime indices.
A330945 lists numbers with a nonprime prime index (nonprime case: A330948).
A339561 lists products of distinct squarefree semiprimes.
MM-numbers: A255397 (normal), A302478 (set multisystems), A320630 (set multipartitions), A302494 (sets of sets), A305078 (connected), A316476 (antichains), A318991 (chains), A320456 (covers), A328514 (connected sets of sets), A329559 (clutters), A340019 (half-loop graphs).

Programs

  • Mathematica
    Select[Range[1,100,2],SquareFreeQ[#]&&FreeQ[If[#==1,{},FactorInteger[#]],{p_,k_}/;PrimeQ[PrimePi[p]]]&]

Formula

A073168 a(n) = A007821(n) - A022449(n).

Original entry on oeis.org

1, 5, 9, 9, 9, 15, 16, 17, 18, 17, 25, 19, 21, 27, 31, 26, 21, 22, 21, 35, 38, 31, 35, 31, 34, 33, 37, 39, 49, 49, 33, 52, 49, 47, 39, 43, 47, 47, 48, 48, 41, 49, 48, 60, 59, 59, 49, 52, 58, 58, 63, 71, 75, 65, 65, 67, 71, 79, 75, 81, 84, 77, 65, 69, 72, 72, 67, 69, 61, 65, 65
Offset: 1

Views

Author

Labos Elemer, Jul 19 2002

Keywords

Comments

Values of commutator of A000040 and A002808 functions i.e., of prime() and composite().

Crossrefs

Programs

  • Mathematica
    c[n_Integer] := FixedPoint[n+PrimePi[ # ]+1&, n] Table[Prime[c[w]]-c[Prime[w]], {w, 1, 10000}];

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

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]

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

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
Showing 1-10 of 79 results. Next