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

A048767 If n = Product (p_j^k_j) then a(n) = Product ( prime(k_j)^pi(p_j) ) where pi is A000720.

Original entry on oeis.org

1, 2, 4, 3, 8, 8, 16, 5, 9, 16, 32, 12, 64, 32, 32, 7, 128, 18, 256, 24, 64, 64, 512, 20, 27, 128, 25, 48, 1024, 64, 2048, 11, 128, 256, 128, 27, 4096, 512, 256, 40, 8192, 128, 16384, 96, 72, 1024, 32768, 28, 81, 54, 512, 192, 65536, 50, 256, 80, 1024, 2048
Offset: 1

Views

Author

Keywords

Comments

If the prime power factors p^e of n are replaced by prime(e)^pi(p), then the prime terms q in the sequence pertain to 2^m with m > 1, since pi(2) = 1. - Michael De Vlieger, Apr 25 2017
Also the Heinz number of the integer partition obtained by applying the map described in A217605 (which interchanges the parts with their multiplicities) to the integer partition with Heinz number n, where the Heinz number of an integer partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k). The image of this map (which is the union of this sequence) is A130091. - Gus Wiseman, May 04 2019

Examples

			For n=6, 6 = (2^1)*(3^1), a(6) = ([first prime]^pi(2))*([first prime]^pi(3)) = (2^1)*(2^2) = 8.
From _Gus Wiseman_, May 04 2019: (Start)
For n = 1..20, the prime indices of n together with the prime indices of a(n) are the following:
   1: {} {}
   2: {1} {1}
   3: {2} {1,1}
   4: {1,1} {2}
   5: {3} {1,1,1}
   6: {1,2} {1,1,1}
   7: {4} {1,1,1,1}
   8: {1,1,1} {3}
   9: {2,2} {2,2}
  10: {1,3} {1,1,1,1}
  11: {5} {1,1,1,1,1}
  12: {1,1,2} {1,1,2}
  13: {6} {1,1,1,1,1,1}
  14: {1,4} {1,1,1,1,1}
  15: {2,3} {1,1,1,1,1}
  16: {1,1,1,1} {4}
  17: {7} {1,1,1,1,1,1,1}
  18: {1,2,2} {1,2,2}
  19: {8} {1,1,1,1,1,1,1,1}
  20: {1,1,3} {1,1,1,2}
(End)
		

Crossrefs

Programs

  • Maple
    A048767 := proc(n)
        local a,p,e,f;
        a := 1 ;
        for f in ifactors(n)[2] do
            p := op(1,f) ;
            e := op(2,f) ;
            a := a*ithprime(e)^numtheory[pi](p) ;
        end do:
        a ;
    end proc: # R. J. Mathar, Nov 08 2012
  • Mathematica
    Table[{p, k} = Transpose@ FactorInteger[n]; Times @@ (Prime[k]^PrimePi[p]), {n, 58}] (* Ivan Neretin, Jun 02 2016 *)
    Array[Apply[Times, FactorInteger[#] /. {p_, e_} /; e >= 0 :> Prime[e]^PrimePi[p]] &, 65] (* Michael De Vlieger, Apr 25 2017 *)

Extensions

a(1)=1 prepended by Alois P. Heinz, Jul 26 2015

A258851 The pi-based arithmetic derivative of n: a(p) = pi(p) for p prime, a(u*v) = a(u)*v + u*a(v), where pi = A000720.

Original entry on oeis.org

0, 0, 1, 2, 4, 3, 7, 4, 12, 12, 11, 5, 20, 6, 15, 19, 32, 7, 33, 8, 32, 26, 21, 9, 52, 30, 25, 54, 44, 10, 53, 11, 80, 37, 31, 41, 84, 12, 35, 44, 84, 13, 73, 14, 64, 87, 41, 15, 128, 56, 85, 55, 76, 16, 135, 58, 116, 62, 49, 17, 136, 18, 53, 120, 192, 69, 107
Offset: 0

Views

Author

Alois P. Heinz, Jun 12 2015

Keywords

Comments

The pi-based variant of the arithmetic derivative of n (A003415).

Crossrefs

Column k=1 of A258850, A258997.
First differences give A258863.
Partial sums give A258864.

Programs

  • Maple
    with(numtheory):
    a:= n-> n*add(i[2]*pi(i[1])/i[1], i=ifactors(n)[2]):
    seq(a(n), n=0..100);
  • Mathematica
    a[n_] := n*Total[Last[#]*PrimePi[First[#]]/First[#]& /@ FactorInteger[n]]; a[0] = 0; Array[a, 100, 0] (* Jean-François Alcover, Apr 24 2016 *)
  • PARI
    A258851(n)=n*sum(i=1, #n=factor(n)~, n[2, i]*primepi(n[1, i])/n[1, i]) \\ M. F. Hasler, Jul 13 2015
    
  • Scheme
    (define (A258851 n) (if (<= n 1) 0 (+ (* (A055396 n) (A032742 n)) (* (A020639 n) (A258851 (A032742 n)))))) ;; Antti Karttunen, Mar 07 2017

Formula

a(n) = n * Sum e_j*pi(p_j)/p_j for n = Product p_j^e_j with pi = A000720.
a(A258861(n)) = n; A258861 = pi-based antiderivative of n.
a(a(A258862(n))) = n; A258862 = second pi-based antiderivative of n.
a(a(a(A258995(n)))) = n; A258995 = third pi-based antiderivative of n.
a(0) = a(0*p) = a(0)*p + 0*a(p) = a(0)*p for all p => a(0) = 0.
a(p) = a(1*p) = a(1)*p + 1*a(p) = a(1)*p + a(p) for all p => a(1) = 0.
a(u^v) = v * u^(v-1) * a(u).

A178503 n minus totally additive with a(p)=PrimePi(p), where PrimePi(n)=A000720(n).

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 3, 5, 5, 6, 6, 8, 7, 9, 10, 12, 10, 13, 11, 15, 15, 16, 14, 19, 19, 19, 21, 22, 19, 24, 20, 27, 26, 26, 28, 30, 25, 29, 31, 34, 28, 35, 29, 37, 38, 36, 32, 42, 41, 43, 42, 44, 37, 47, 47, 49, 47, 47, 42, 53, 43, 50, 55, 58, 56, 58, 48, 59, 58, 62, 51, 65, 52, 61
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Apr 19 2010

Keywords

Crossrefs

Programs

  • Maple
    From R. J. Mathar, Apr 20 2010: (Start)
    A056239 := proc(n) add( numtheory[pi](op(1,p))*op(2,p), p = ifactors(n)[2]) ; end proc:
    A178503 := proc(n) n-A056239(n) ; end proc: seq(A178503(n),n=1..80) ; (End)

Formula

a(n) = A000027(n) - A056239(n).

Extensions

Corrected (a 27 replaced with 28) by R. J. Mathar, Apr 20 2010

A237578 a(n) = |{0 < k < n: pi(k*n) is prime}|, where pi(.) is given by A000720.

Original entry on oeis.org

0, 0, 2, 2, 1, 3, 2, 1, 2, 2, 4, 4, 1, 4, 2, 5, 5, 6, 2, 5, 4, 6, 3, 7, 3, 3, 7, 5, 5, 5, 10, 9, 3, 7, 6, 5, 12, 3, 3, 9, 10, 11, 12, 7, 3, 5, 11, 9, 7, 10, 12, 9, 10, 8, 12, 11, 10, 17, 15, 13, 14, 18, 4, 17, 10, 9, 15, 11, 14, 11, 23, 11, 9, 13, 12, 12, 12, 11, 14, 16
Offset: 1

Views

Author

Zhi-Wei Sun, Feb 09 2014

Keywords

Comments

Conjecture: a(n) > 0 for all n > 2, and a(n) = 1 only for n = 5, 8, 13. Moreover, for each n = 1, 2, 3, ..., there is a positive integer k < 3*sqrt(n) + 3 with pi(k*n) prime.
Note that the least positive integer k with pi(k*38) prime is 21 < 3*sqrt(38) + 3 < 21.5.

Examples

			a(5) = 1 since pi(1*5) = 3 is prime.
a(8) = 1 since pi(4*8) = 11 is prime.
a(13) = 1 since pi(10*13) = pi(130) = 31 is prime.
a(38) = 3 since pi(21*38) = pi(798) = 139, pi(28*38) = pi(1064) = 179 and pi(31*38) = pi(1178) = 193 are all prime.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=Sum[If[PrimeQ[PrimePi[k*n]],1,0],{k,1,n-1}]
    Table[a[n],{n,1,80}]

A046992 a(n) = Sum_{k=1..n} pi(k) (cf. A000720).

Original entry on oeis.org

0, 1, 3, 5, 8, 11, 15, 19, 23, 27, 32, 37, 43, 49, 55, 61, 68, 75, 83, 91, 99, 107, 116, 125, 134, 143, 152, 161, 171, 181, 192, 203, 214, 225, 236, 247, 259, 271, 283, 295, 308, 321, 335, 349, 363, 377, 392, 407, 422, 437, 452, 467, 483, 499, 515, 531, 547, 563, 580, 597, 615, 633, 651, 669
Offset: 1

Views

Author

Keywords

Comments

a(n) = A002815(n) - n. - Reinhard Zumkeller, Feb 25 2012
From Hieronymus Fischer, Sep 26 2012: (Start)
Let S(n) be a string of length n, then a(n) is the number of substrings of S(n) with a prime number of characters. Example 1: "abcd" is a string of length 4; there are a(4)=5 substrings with a prime number of characters (ab, bc, cd, abc and bcd). Example 2: "abcde" is a string of length 5; there are a(5)=8 substrings with a prime number of characters (ab, bc, cd, de, abc, bcd, cde and abcde).
Also: If n is represented in base 1 (this means 1=1_1, 2=11_1, 3=111_1, 4=1111_1, etc.), then a(n) is the number of substrings of n with a prime number of digits. Example: 7=1111111_1; the number of prime substrings of 7 (in base 1) is a(7)=15, since there are 15 substrings of prime length: 6 2-digit substrings, 5 3-digit substrings, 3 5-digit substrings and 1 7-digit substring.
(End)

Crossrefs

Programs

  • Haskell
    a046992 n = a046992_list !! (n-1)
    a046992_list = scanl1 (+) a000720_list
    -- Reinhard Zumkeller, Feb 25 2012
    
  • Mathematica
    f[n_] := (f[n - 1] + PrimePi[n]); f[1] = 0; Table[ f[n], {n, 1, 60}]
    Accumulate[PrimePi[Range[70]]] (* Harvey P. Dale, Feb 27 2013 *)
  • PARI
    a(n)=my(N=n+1,s); forprime(p=2,n, s+=N-p); s \\ Charles R Greathouse IV, Mar 03 2017
    
  • Python
    from sympy import primerange
    def A046992(n): return (n+1)*len(p:=list(primerange(n+1)))-sum(p) # Chai Wah Wu, Jan 01 2024

Formula

O.g.f.: A(x)/(1-x)^2 where A(x) = Sum_{p=prime} x^p is the o.g.f. of A010051 and A(x)/(1-x) is the o.g.f. of A000720. - Geoffrey Critzer, Dec 04 2011
From Hieronymus Fischer, Sep 26 2012: (Start)
a(n) = Sum_{p<=n, p is prime} (n - p +1).
a(n) = (n+1)*pi(n) - Sum_pi(n), where pi(n) = number of primes <= n and Sum_pi(n) = sum of primes <= n.
a(n) = (n+1)*A000720(n) - A034387(n).
(End)
a(n) ~ n^2 / (2 log n). - Charles R Greathouse IV, Mar 03 2017

Extensions

Corrected by Henry Bottomley

A056171 a(n) = pi(n) - pi(floor(n/2)), where pi is A000720.

Original entry on oeis.org

0, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2, 2, 3, 2, 2, 2, 3, 3, 4, 4, 4, 3, 4, 4, 4, 3, 3, 3, 4, 4, 5, 5, 5, 4, 4, 4, 5, 4, 4, 4, 5, 5, 6, 6, 6, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 6, 7, 7, 8, 7, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 10, 9, 9, 9, 9, 9, 10, 10, 10, 9, 10, 10, 10, 9, 9, 9, 10, 10, 10, 10, 10, 9, 9, 9, 10, 10
Offset: 1

Views

Author

Labos Elemer, Jul 27 2000

Keywords

Comments

Also, the number of unitary prime divisors of n!. A prime divisor of n is unitary iff its exponent is 1 in the prime power factorization of n. In general, gcd(p, n/p) = 1 or p. Here we count the cases when gcd(p, n/p) = 1.
A unitary prime divisor of n! is >= n/2, hence their number is pi(n) - pi(n/2). - Peter Luschny, Mar 13 2011
See also the references and links mentioned in A143227. - Jonathan Sondow, Aug 03 2008
From Robert G. Wilson v, Mar 20 2017: (Start)
First occurrence of k is at n = A080359(k).
The last occurrence of k is at n = A080360(k).
The number of times k appears is A080362(k). (End)
Lev Schnirelmann proved that for every n, a(n) > (1/log_2(n))*(n/3 - 4*sqrt(n)) - 1 - (3/2)*log_2(n). - Arkadiusz Wesolowski, Nov 03 2017

Examples

			10! = 2^8 * 3^2 * 5^2 * 7. The only unitary prime divisor is 7, so a(10) = 1.
		

References

  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See p. 214.

Crossrefs

Programs

  • Maple
    A056171 := proc(x)
         numtheory[pi](x)-numtheory[pi](floor(x/2)) ;
    end proc:
    seq(A056171(n),n=1..130) ; # N. J. A. Sloane, Sep 01 2015
    A056171 := n -> nops(select(isprime,[$iquo(n,2)+1..n])):
    seq(A056171(i),i=1..98); # Peter Luschny, Mar 13 2011
  • Mathematica
    s=0; Table[If[PrimeQ[k], s++]; If[PrimeQ[k/2], s--]; s, {k,100}]
    Table[PrimePi[n]-PrimePi[Floor[n/2]],{n,100}] (* Harvey P. Dale, Sep 01 2015 *)
  • PARI
    A056171=n->primepi(n)-primepi(n\2) \\ M. F. Hasler, Dec 31 2016
    
  • Python
    from sympy import primepi
    [primepi(n) - primepi(n//2) for n in range(1,151)] # Indranil Ghosh, Mar 22 2017
    
  • Sage
    [prime_pi(n)-prime_pi(floor(n/2)) for n in range(1,99)] # Stefano Spezia, Apr 22 2025

Formula

a(n) = A000720(n) - A056172(n). - Robert G. Wilson v, Apr 09 2017
a(n) = A056169(n!). - Amiram Eldar, Jul 24 2024

Extensions

Definition simplified by N. J. A. Sloane, Sep 01 2015

A038625 a(n) is smallest number m such that m = n*pi(m), where pi(k) = number of primes <= k (A000720).

Original entry on oeis.org

2, 27, 96, 330, 1008, 3059, 8408, 23526, 64540, 175197, 480852, 1304498, 3523884, 9557955, 25874752, 70115412, 189961182, 514272411, 1394193580, 3779849598, 10246935644, 27788566029, 75370121160, 204475052375, 554805820452, 1505578023621, 4086199301996, 11091501630949
Offset: 2

Views

Author

Keywords

Comments

Golomb shows that solutions exist for each n>1.
Equivalently, for n > 1, least m such that m >= n*pi(m). - Eric M. Schmidt, Aug 05 2014
The values a(26),...,a(50) were calculated with the Eratosthenes sieve making use of strong bounds for pi(x), which follow from partial knowledge of the Riemann hypothesis, and the analytic method for calculating initial values of pi(x). - Jan Büthe, Jan 16 2015

Examples

			pi(3059) = 437 and 3059/437 = 7, so a(7)=3059.
		

Crossrefs

Programs

  • Maple
    with(numtheory); f:=proc(n) local i; for i from 2 to 10000 do if i mod pi(i) = 0 and i/pi(i) = n then RETURN(i); fi; od: RETURN(-1); end; # N. J. A. Sloane, Sep 01 2008
  • Mathematica
    t = {}; k = 2; Do[While[n*PrimePi[k] != k, k++]; AppendTo[t, k], {n, 2, 15}]; t (* Jayanta Basu, Jul 10 2013 *)
  • PARI
    a(n)=my(k=1); while(k!=n*primepi(k),k++); k;
    for (n=2, 20, print1(a(n), ", ")); \\ Derek Orr, Aug 13 2014
    
  • Python
    from math import exp
    from sympy import primepi
    def a(n):
      m = 2 if n == 2 else int(exp(n)) # pi(m) > m/log(m) for m >= 17
      while m != n*primepi(m): m += 1
      return m
    print([a(n) for n in range(2, 10)]) # Michael S. Branicky, Feb 27 2021

Formula

It appears that a(n) is asymptotic to e^2*exp(n). - Chris K. Caldwell, Apr 02 2008
a(n) = A038626(n) * n. - Max Alekseyev, Oct 13 2023

Extensions

Three more terms from Labos Elemer, Sep 12 2003
Edited by N. J. A. Sloane at the suggestion of Chris K. Caldwell, Apr 08 2008
24 terms added and entry a(26) corrected by Jan Büthe, Jan 07 2015

A095117 a(n) = pi(n) + n, where pi(n) = A000720(n) is the number of primes <= n.

Original entry on oeis.org

0, 1, 3, 5, 6, 8, 9, 11, 12, 13, 14, 16, 17, 19, 20, 21, 22, 24, 25, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37, 39, 40, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 54, 55, 57, 58, 59, 60, 62, 63, 64, 65, 66, 67, 69, 70, 71, 72, 73, 74, 76, 77, 79, 80, 81, 82, 83, 84, 86, 87, 88, 89, 91
Offset: 0

Views

Author

Dean Hickerson, following a suggestion of Leroy Quet, May 28 2004

Keywords

Comments

Positions of first occurrences of n in A165634: A165634(a(n))=n for n>0. - Reinhard Zumkeller, Sep 23 2009
There exists at least one prime number p such that n < p <= a(n) for n >= 2. For example, 2 is in (2, 3], 5 in (3, 5], 5 in (4, 6], ..., and primes 73, 79, 83 and 89 are in (71, 91] (see Corollary 1 in the paper by Ya-Ping Lu attached in the links section). - Ya-Ping Lu, Feb 21 2021

Crossrefs

Complement of A095116.

Programs

  • Haskell
    a095117 n = a000720 n + toInteger n  -- Reinhard Zumkeller, Apr 17 2012
    
  • Maple
    with(numtheory): seq(n+pi(n),n=1..90); # Emeric Deutsch, May 02 2007
  • Mathematica
    Table[ PrimePi@n + n, {n, 0, 71}] (* Robert G. Wilson v, Apr 22 2007 *)
  • PARI
    a(n) = n + primepi(n); \\ Michel Marcus, Feb 21 2021
    
  • Python
    from sympy import primepi
    def a(n): return primepi(n) + n
    print([a(n) for n in range(72)]) # Michael S. Branicky, Feb 21 2021

Formula

a(0) = 0; for n>0, a(n) = a(n-1) + (if n is prime then 2, else 1). - Robert G. Wilson v, Apr 22 2007; corrected by David James Sycamore, Aug 16 2018

Extensions

Edited by N. J. A. Sloane, Jul 02 2008 at the suggestion of R. J. Mathar

A037171 Numbers n such that phi(n) = pi(n), i.e., A000010(n) = A000720(n).

Original entry on oeis.org

2, 3, 4, 8, 10, 14, 20, 90
Offset: 1

Views

Author

Keywords

Comments

David W. Wilson and Jeffrey Shallit showed that 90 is the last term.
Leo Moser proved in 1951 that these are the only terms, but he missed the term 10. - Amiram Eldar, May 15 2017
phi(n) >= pi(n) for n >= 61, and phi(n) > pi(n) for n > 90. - Jonathan Sondow, Dec 02 2017

Examples

			phi(10)=4, pi(10)=4.
a(1)=2 since k=2 is the lowest index for which A000720(n) = A000010(n), i.e., EulerPhi(n) = PrimePi(n). - _M. F. Hasler_, Mar 30 2007
		

References

  • P. Birch and D. Singmaster, An elementary number theory result, Math. Soc. Newsl., 12 (1984), 10-13.
  • D. S. Mitrinovic et al., Handbook of Number Theory, Kluwer, p. 11.

Crossrefs

Programs

  • Maple
    select(x->numtheory[phi](x)=numtheory[pi](x),[$1..999]); # M. F. Hasler, Mar 30 2007
  • PARI
    for(n=1,1e5,if(primepi(n)==eulerphi(n),print(n))) /* M. F. Hasler, Mar 30 2007 */

Formula

A037228(a(n)) = 0. - Jonathan Sondow, Dec 02 2017

A357980 Replace prime(k) with prime(A000720(k)) in the prime factorization of n, assuming prime(0) = 1.

Original entry on oeis.org

1, 1, 2, 1, 3, 2, 3, 1, 4, 3, 5, 2, 5, 3, 6, 1, 7, 4, 7, 3, 6, 5, 7, 2, 9, 5, 8, 3, 7, 6, 11, 1, 10, 7, 9, 4, 11, 7, 10, 3, 13, 6, 13, 5, 12, 7, 13, 2, 9, 9, 14, 5, 13, 8, 15, 3, 14, 7, 17, 6, 17, 11, 12, 1, 15, 10, 19, 7, 14, 9, 19, 4, 19, 11, 18, 7, 15, 10
Offset: 1

Views

Author

Gus Wiseman, Oct 24 2022

Keywords

Comments

In the definition, taking A000720(k) in place of prime(A000720(k)) gives A357984.

Examples

			We have 90 = prime(1) * prime(2)^2 * prime(3), so a(90) = prime(0) * prime(1)^2 * prime(2) = 12.
		

Crossrefs

Other multiplicative sequences: A003961, A357852, A064988, A064989, A357980.
The version for p instead of pi is A357977, strict A357978.
The triangular version is A357984.
A000040 lists the prime numbers.
A000720 = PrimePi.
A056239 adds up prime indices, row-sums of A112798.

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    mtf[f_][n_]:=Product[If[f[i]==0,1,Prime[f[i]]],{i,primeMS[n]}];
    Array[mtf[PrimePi],100]
  • PARI
    myprime(n) = if (n==0, 1, prime(n));
    a(n) = my(f=factor(n)); for (k=1, #f~, f[k,1] = myprime(primepi(primepi(f[k,1])))); factorback(f); \\ Michel Marcus, Oct 25 2022
Showing 1-10 of 2214 results. Next