[go: up one dir, main page]

login
Search: a000720 -id:a000720
     Sort: relevance | references | number | modified | created      Format: long | short | data
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.
+20
50
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,4
COMMENTS
The pi-based variant of the arithmetic derivative of n (A003415).
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).
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 *)
PROG
(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
CROSSREFS
Column k=1 of A258850, A258997.
First differences give A258863.
Partial sums give A258864.
KEYWORD
nonn,look
AUTHOR
Alois P. Heinz, Jun 12 2015
STATUS
approved
a(n) = |{0 < k < n: pi(k*n) is prime}|, where pi(.) is given by A000720.
+20
31
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,3
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.
LINKS
Zhi-Wei Sun, Problems on combinatorial properties of primes, arXiv:1402.6641 [math.NT], 2014-2016.
Zhi-Wei Sun and Lilu Zhao, On the set {pi(kn): k=1,2,3,...}, arXiv:2004.01080 [math.NT], 2020.
EXAMPLE
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.
MATHEMATICA
a[n_]:=Sum[If[PrimeQ[PrimePi[k*n]], 1, 0], {k, 1, n-1}]
Table[a[n], {n, 1, 80}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Feb 09 2014
STATUS
approved
a(n) = Sum_{k=1..n} pi(k) (cf. A000720).
+20
30
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,3
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)
LINKS
Hieronymus Fischer, Table of n, a(n) for n = 1..10000 (first 1000 terms from T. D. Noe)
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
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 *)
PROG
(Haskell)
a046992 n = a046992_list !! (n-1)
a046992_list = scanl1 (+) a000720_list
-- Reinhard Zumkeller, Feb 25 2012
(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
CROSSREFS
KEYWORD
nonn,easy,nice
EXTENSIONS
Corrected by Henry Bottomley
STATUS
approved
a(n) = pi(n) - pi(floor(n/2)), where pi is A000720.
+20
26
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,3
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
LINKS
Ethan Berkove and Michael Brilleslyper, Subgraphs of Coprime Graphs on Sets of Consecutive Integers, Integers, Vol. 22 (2022), #A47, see p. 8.
FORMULA
a(n) = A000720(n) - A056172(n). - Robert G. Wilson v, Apr 09 2017
a(n) = A056169(n!). - Amiram Eldar, Jul 24 2024
EXAMPLE
10! = 2^8 * 3^2 * 5^2 * 7. The only unitary prime divisor is 7, so a(10) = 1.
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 *)
PROG
(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
KEYWORD
nonn,easy
AUTHOR
Labos Elemer, Jul 27 2000
EXTENSIONS
Definition simplified by N. J. A. Sloane, Sep 01 2015
STATUS
approved
a(n) is smallest number m such that m = n*pi(m), where pi(k) = number of primes <= k (A000720).
+20
22
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,1
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
LINKS
S. W. Golomb, On the Ratio of N to pi(N), American Mathematical Monthly, 69 (1962), 36-37.
Eric Weisstein's World of Mathematics, Prime Counting Function.
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
EXAMPLE
pi(3059) = 437 and 3059/437 = 7, so a(7)=3059.
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 *)
PROG
(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
KEYWORD
nonn
AUTHOR
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
STATUS
approved
a(n) = pi(n) + n, where pi(n) = A000720(n) is the number of primes <= n.
+20
18
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,3
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
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
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 *)
PROG
(Haskell)
a095117 n = a000720 n + toInteger n -- Reinhard Zumkeller, Apr 17 2012
(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
CROSSREFS
Complement of A095116.
KEYWORD
easy,nonn
AUTHOR
Dean Hickerson, following a suggestion of Leroy Quet, May 28 2004
EXTENSIONS
Edited by N. J. A. Sloane, Jul 02 2008 at the suggestion of R. J. Mathar
STATUS
approved
Numbers n such that phi(n) = pi(n), i.e., A000010(n) = A000720(n).
+20
15
2, 3, 4, 8, 10, 14, 20, 90
OFFSET
1,1
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
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.
LINKS
Leo Moser, On the equation ϕ(n) = π(n), Pi Mu Epsilon Journal. Vol. 1, No. 5 (1951), pp. 177-180.
FORMULA
A037228(a(n)) = 0. - Jonathan Sondow, Dec 02 2017
EXAMPLE
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
MAPLE
select(x->numtheory[phi](x)=numtheory[pi](x), [$1..999]); # M. F. Hasler, Mar 30 2007
PROG
(PARI) for(n=1, 1e5, if(primepi(n)==eulerphi(n), print(n))) /* M. F. Hasler, Mar 30 2007 */
CROSSREFS
KEYWORD
easy,nonn,fini,full
STATUS
approved
Number of primes p < n with pi(n-p) prime, where pi(.) is given by A000720.
+20
14
0, 0, 0, 0, 1, 2, 2, 3, 2, 2, 2, 1, 2, 3, 2, 3, 3, 2, 3, 3, 2, 4, 4, 3, 3, 1, 1, 3, 3, 2, 2, 1, 2, 6, 6, 5, 5, 4, 3, 5, 5, 4, 5, 5, 4, 6, 6, 6, 6, 3, 3, 5, 5, 5, 5, 2, 2, 5, 5, 3, 4, 5, 4, 8, 8, 3, 3, 1, 2, 8
OFFSET
1,6
COMMENTS
Conjecture: (i) a(n) > 0 for all n > 4, and a(n) = 1 only for n = 5, 12, 26, 27, 32, 68.
(ii) For any integer n > 5, there is a prime p <= n with pi(n+p) prime.
(iii) If n > 32, then pi((n-p)^2) is prime for some prime p < n. Also, for each n > 6 there is an odd prime p < 2*n with pi((n - (p-1)/2)^2) prime.
(iv) Any integer n > 11 can be written as p + q with p and pi(q^2 + q + 1) both prime.
(v) Each integer n > 34 can be written as k + m with k and m positive integers such that pi(k^2) and pi(2*m^2) are both prime.
EXAMPLE
a(5) = 1 since 2 and pi(5-2) = pi(3) = 2 are both prime.
a(12) = 1 since 7 and pi(12-7) = pi(5) = 3 are both prime.
a(15) = 2 since 3 and pi(15-3) = pi(12) = 5 are both prime, and 11 and pi(15-11) = pi(4) = 2 are both prime.
a(26) = 1 since 23 and pi(26-23) = 2 are both prime.
a(27) = 1 since 23 and pi(27-23) = 2 are both prime.
a(32) = 1 since 29 and pi(32-29) = 2 are both prime.
a(68) = 1 since 37 and pi(68-37) = pi(31) = 11 are both prime.
MATHEMATICA
q[n_]:=PrimeQ[PrimePi[n]]
a[n_]:=Sum[If[q[n-Prime[k]], 1, 0], {k, 1, PrimePi[n-1]}]
Table[a[n], {n, 1, 70}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Feb 11 2014
STATUS
approved
The second Fibonacci based variant of arithmetic derivative: a(p) = A000045(2+A000720(p)) for prime p, a(u*v) = a(u)*v + u*a(v), with a(0) = a(1) = 0. Also called PrimePi-Fibonacci variant of the arithmetic derivative.
+20
14
0, 0, 2, 3, 8, 5, 12, 8, 24, 18, 20, 13, 36, 21, 30, 30, 64, 34, 54, 55, 60, 45, 48, 89, 96, 50, 68, 81, 88, 144, 90, 233, 160, 72, 102, 75, 144, 377, 148, 102, 160, 610, 132, 987, 140, 135, 224, 1597, 240, 112, 150, 153, 188, 2584, 216, 120, 232, 222, 346, 4181, 240, 6765, 528, 198, 384, 170, 210, 10946, 272, 336, 220, 17711, 360
OFFSET
0,3
FORMULA
a(n) = n * Sum e_j * A000045(2+A000720(p_j))/p_j for n = Product p_j^e_j.
a(A000040(n)) = A000045(2+n).
A007895(a(n)) = A328848(n).
PROG
(PARI) A328846(n) = if(n<=1, 0, my(f=factor(n)); n*sum(i=1, #f~, f[i, 2]*fibonacci(2+primepi(f[i, 1]))/f[i, 1]));
CROSSREFS
Cf. also A003415, A258851, A328768, A328769, A328845 for other arithmetic derivatives, and also A371192 for another PrimePi-Fibonacci variant.
Cf. A374035 [= gcd(a(n), A328845(n))], A374048 (antiparity of this sequence), A374049 (indices of even terms), A374050 (of odd terms).
KEYWORD
nonn
AUTHOR
Antti Karttunen, Oct 28 2019
STATUS
approved
a(n) = |{0 < k < prime(n): pi(k*n) is a square}|, where pi(.) is given by A000720.
+20
13
1, 1, 1, 2, 2, 2, 4, 3, 5, 2, 3, 5, 3, 6, 1, 2, 3, 3, 5, 3, 5, 2, 6, 4, 4, 5, 3, 6, 4, 3, 2, 5, 3, 4, 3, 4, 4, 3, 6, 4, 3, 4, 2, 1, 2, 9, 3, 4, 4, 4, 5, 7, 4, 7, 3, 6, 7, 3, 7, 7, 5, 1, 4, 5, 3, 3, 10, 5, 4, 7
OFFSET
1,4
COMMENTS
Conjecture: (i) a(n) > 0 for all n > 0.
(ii) For each n > 9, there is a positive integer k < prime(n)/2 such that pi(k*n) is a triangular number.
See also A237612 for the least k > 0 with pi(k*n) a square.
LINKS
EXAMPLE
a(3) = 1 since pi(3*3) = 2^2 with 3 < prime(3) = 5.
a(6) = 2 since pi(4*6) = 3^2 with 4 < prime(6) = 13, and pi(9*6) = 4^2 with 9 < prime(6) = 13.
a(15) = 1 since pi(28*15) = 9^2 with 28 < prime(15) = 47.
a(62) = 1 since pi(68*62) = 24^2 with 68 < prime(62) = 293.
a(459) = 1 since pi(2544*459) = 301^2 with 2544 < prime(459) = 3253.
MATHEMATICA
sq[n_]:=IntegerQ[Sqrt[PrimePi[n]]]
a[n_]:=Sum[If[sq[k*n], 1, 0], {k, 1, Prime[n]-1}]
Table[a[n], {n, 1, 70}]
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Feb 10 2014
STATUS
approved

Search completed in 0.754 seconds