Displaying 1-4 of 4 results found.
page
1
A101909 sorted and duplicates removed.
+20
5
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73
PROG
(PARI) bet2n4n(n) = { local(c, c1, x, y); a=vector(5001); for(x=1, n, c=0; forprime(y=2*x+1, 4*x-1, c++; ); a[x] = c; ); b=vecsort(a); for(x=1, 5000, if(b[x]>0, if(b[x]<>b[x+1], print1(b[x]", ") ) ); ) }
(PARI) s=0; v=vectorsmall(10^6, n, s+=isprime(4*n-1)+isprime(4*n-3)-isprime(2*n-1)); v=vecsort(v, , 8); vecextract(v, Str("1..", #v\2)) \\ Charles R Greathouse IV, Mar 12 2012
Numbers that do not occur in A101909 (= number of primes between 2n and 4n).
+20
3
11, 79, 134, 184, 186, 215, 245, 262, 284, 305, 387, 544, 694, 700, 706, 776, 814, 881, 939, 974, 1002, 1027, 1079, 1104, 1133, 1146, 1184, 1193, 1207, 1354, 1387, 1415, 1441, 1495, 1574, 1587, 1608, 1662, 1690, 1801, 1915, 1987, 2054, 2067, 2104, 2170
EXAMPLE
11 is the first number that does not equal a count of primes between 2n and 4n for some n.
MATHEMATICA
f[n_] := PrimePi[4n] - PrimePi[2n]; t = Union[ Table[ f[n], {n, 12000}]]; Complement[ Range[ t[[ -1]]], t] (* Robert G. Wilson v, Feb 10 2005 *)
PROG
(PARI) bet2n4n(n)={ my( b=vecsort(vector(n, x, my(c=0); forprime(y=2*x+1, 4*x-1, c++); c))); for(x=1, n-2, while(b[x+1]-b[x]>1, print1(b[x]++, ", ")))} \\ It's probably faster to use A101909 instead of forprime(...). Edited and corrected by M. F. Hasler, Sep 29 2019
(PARI) primecount(a, b)=primepi(b)-primepi(a);
v=vector(20000);
for(k=1, oo, j=primecount(2*k, 4*k); if(j>#v, break, v[j]++));
for(k=1, 2170, if(v[k]==0, print1(k, ", "))) \\ Hugo Pfoertner, Sep 29 2019
Numbers that occur exactly once in A101909 (= count of primes between 2n and 4n).
+20
2
1, 3, 5, 8, 22, 36, 37, 46, 47, 48, 53, 63, 83, 98, 99, 101, 105, 108, 113, 114, 127, 135, 139, 148, 150, 155, 158, 171, 172, 173, 174, 175, 177, 178, 188, 205, 210, 218, 219, 220, 221, 226, 231, 240, 246, 254, 277, 282, 297, 298, 301, 303, 327, 333, 334, 339
EXAMPLE
There are 5 primes between 16 and 32 and nowhere else between 2n and 4n.
PROG
(PARI) bet2n4n(n)={ my(b=vecsort(vector(n, x, my(c=0); forprime(y=2*x+1, 4*x-1, c++); c))); print1(1", "); for(x=1, n-2, if(b[x+1]>b[x] && b[x+1]<b[x+2], print1(b[x+1]", ")))} \\ Edited and corrected, following a suggestion by Don Reble. - M. F. Hasler, Sep 29 2019
Number of primes between n and 2n exclusive.
+10
58
0, 1, 1, 2, 1, 2, 2, 2, 3, 4, 3, 4, 3, 3, 4, 5, 4, 4, 4, 4, 5, 6, 5, 6, 6, 6, 7, 7, 6, 7, 7, 7, 7, 8, 8, 9, 9, 9, 9, 10, 9, 10, 9, 9, 10, 10, 9, 9, 10, 10, 11, 12, 11, 12, 13, 13, 14, 14, 13, 13, 12, 12, 12, 13, 13, 14, 13, 13, 14, 15, 14, 14, 13, 13, 14, 15, 15
COMMENTS
The number of partitions of 2n+2 into exactly two parts where the first part is a prime strictly less than 2n+1. - Wesley Ivan Hurt, Aug 21 2013
REFERENCES
M. Aigner and C. M. Ziegler, Proofs from The Book, Chapter 2, Springer NY 2001.
EXAMPLE
a(35)=8 since eight consecutive primes (37,41,43,47,53,59,61,67) are located between 35 and 70.
MAPLE
a := proc(n) local counter, i; counter := 0; from i from n+1 to 2*n-1 do if isprime(i) then counter := counter +1; fi; od; return counter; end:
with(numtheory); seq(pi(2*k-1)-pi(k), k=1..100); # Wesley Ivan Hurt, Aug 21 2013
PROG
(PARI) { for (n=1, 1000, write("b060715.txt", n, " ", primepi(2*n - 1) - primepi(n)); ) } \\ Harry J. Smith, Jul 10 2009
(Haskell)
(Magma) [0] cat [#PrimesInInterval(n+1, 2*n-1): n in [2..80]]; // Bruno Berselli, Sep 05 2012
(Python) from sympy import primerange as pr
EXTENSIONS
Corrected by Dug Eichelberger (dug(AT)mit.edu), Jun 04 2001
More terms from Larry Reeves (larryr(AT)acm.org), Jun 05 2001
Search completed in 0.008 seconds
|