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-9 of 9 results.

A164368 Primes p with the property: if q is the smallest prime > p/2, then a prime exists between p and 2q.

Original entry on oeis.org

2, 11, 17, 29, 41, 47, 59, 67, 71, 97, 101, 107, 109, 127, 137, 149, 151, 167, 179, 181, 191, 197, 227, 229, 233, 239, 241, 263, 269, 281, 283, 307, 311, 347, 349, 367, 373, 401, 409, 419, 431, 433, 439, 461, 487, 491, 503, 521, 569, 571, 587, 593, 599, 601, 607
Offset: 1

Views

Author

Vladimir Shevelev, Aug 14 2009

Keywords

Comments

The Ramanujan primes possess the following property:
If p = prime(n) > 2, then all numbers (p+1)/2, (p+3)/2, ..., (prime(n+1)-1)/2 are composite.
The sequence equals all primes with this property, whether Ramanujan or not.
All Ramanujan primes A104272 are in the sequence.
Every lesser of twin primes (A001359), beginning with 11, is in the sequence. - Vladimir Shevelev, Aug 31 2009
109 is the first non-Ramanujan prime in this sequence.
A very simple sieve for the generation of the terms is the following: let p_0=1 and, for n>=1, p_n be the n-th prime. Consider consecutive intervals of the form (2p_n, 2p_{n+1}), n=0,1,2,... From every interval containing at least one prime we remove the last one. Then all remaining primes form the sequence. Let us demonstrate this sieve: For p_n=1,2,3,5,7,11,... consider intervals (2,4), (4,6), (6,10), (10,14), (14,22), (22,26), (26,34), ... . Removing from the set of all primes the last prime of each interval, i.e., 3,5,7,13,19,23,31,... we obtain 2,11,17,29, etc. - Vladimir Shevelev, Aug 30 2011
This sequence and A194598 are the mutually wrapping up sequences:
A194598(1) <= a(1) <= A194598(2) <= a(2) <= ...
From Peter Munn, Oct 30 2017: (Start)
The sequence is the list of primes p = prime(k) such that there are no primes between prime(k)/2 and prime(k+1)/2. Changing "k" to "k-1" and therefore "k+1" to "k" produces a definition very similar to A164333's: it differs by prefixing an initial term 3. From this we get a(n+1) = prevprime(A164333(n)) = A151799(A164333(n)) for n >= 1.
The sequence is the list of primes that are not the largest prime less than 2*prime(k) for any k, so that - as a set - it is the complement relative to A000040 of the set of numbers in A059788.
{{2}, A166252, A166307} is a partition.
(End)

Examples

			2 is in the sequence, since then q=2, and there is a prime 3 between 2 and 4. - _N. J. A. Sloane_, Oct 15 2009
		

Crossrefs

Cf. Ramanujan primes, A104272, and related sequences: A164288, A080359, A164294, A193507, A194184, A194186.
A001359, A166252, A166307 are subsets.
Cf. A001262, A001567, A062568, A141232 (all relate to pseudoprimes to base 2).

Programs

  • Maple
    a:= proc(n) option remember; local q, k, p;
          k:= nextprime(`if`(n=1, 1, a(n-1)));
          do q:= nextprime(floor(k/2));
             p:= nextprime(k);
             if p<2*q then break fi;
             k:= p
          od; k
        end:
    seq(a(n), n=1..55);  # Alois P. Heinz, Aug 30 2011
  • Mathematica
    Reap[Do[q=NextPrime[p/2]; If[PrimePi[2*q] != PrimePi[p], Sow[p]], {p, Prime[Range[100]]}]][[2, 1]]
    (* Second program: *)
    fQ[n_] := PrimePi[ 2NextPrime[n/2]] != PrimePi[n];
    Select[ Prime@ Range@ 105, fQ]
  • PARI
    is(n)=nextprime(n+1)<2*nextprime(n/2) && isprime(n) \\ Charles R Greathouse IV, Apr 24 2015

Formula

As a set, this sequence = A000040 \ A059788 = A000040 \ prevprime(2*A000040) = A000040 \ A151799(A005843(A000040)). - Peter Munn, Oct 30 2017

Extensions

Definition clarified and simplified by Jonathan Sondow, Oct 25 2011

A164288 Members of A164368 which are not Ramanujan primes.

Original entry on oeis.org

109, 137, 191, 197, 283, 521, 617, 683, 907, 991, 1033, 1117, 1319, 1493, 1619, 1627, 1697, 1741, 1747, 1801, 1931, 1949, 2011, 2111, 2143, 2153, 2293, 2417, 2539, 2543, 2549, 2591, 2621, 2837, 2927, 2953, 2969, 3079, 3119, 3187, 3203, 3329, 3389, 3407
Offset: 1

Views

Author

Vladimir Shevelev, Aug 12 2009

Keywords

Comments

Every lesser of twin primes (A001359), beginning with 137, which is not in A104272, is in the sequence. [From Vladimir Shevelev, Aug 31 2009]

Examples

			p=137 is the least lesser of twin primes which is not a Ramanujan prime. Therefore it is in the sequence. [From _Vladimir Shevelev_, Aug 31 2009]
		

Crossrefs

Programs

  • Mathematica
    nn = 250;
    A164368 = Select[Prime[Range[2 nn]], PrimePi[2 NextPrime[#/2]] != PrimePi[#]&];
    Rama = Table[0, {nn}]; s = 0; Do[If[PrimeQ[k], s++]; If[PrimeQ[k/2], s--]; If[s < nn, Rama[[s+1]] = k], {k, Prime[3 nn]}];
    A104272 = Rama+1;
    Complement[A164368, A104272] (* Jean-François Alcover, Oct 27 2018, after T. D. Noe in A104272 *)

Formula

Extensions

I added 521. - Vladimir Shevelev, Aug 17 2009
Redefined in terms of A164368 and extended by R. J. Mathar, Aug 18 2009

A164294 Primes prime(k) such that all integers in [(prime(k-1)+1)/2,(prime(k)-1)/2] are composite, excluding those primes in A080359.

Original entry on oeis.org

131, 151, 229, 233, 311, 571, 643, 727, 941, 1013, 1051, 1153, 1373, 1531, 1667, 1669, 1723, 1783, 1787, 1831, 1951, 1979, 2029, 2131, 2213, 2239, 2311, 2441, 2593, 2621, 2633, 2659, 2663, 2887, 3001, 3011, 3019, 3121, 3169, 3209, 3253, 3347, 3413, 3457
Offset: 1

Views

Author

Vladimir Shevelev, Aug 12 2009

Keywords

Comments

The primes of A080359 larger than 3 all have the property that the integers in the interval selected by halving the value of the preceding prime and halving their own value are all composite. This sequence here collects the primes that are not in A080359 but still share this property of the prime-free subinterval.

Examples

			For the prime 1531=A000040(242), the preceding prime is A000040(241)=1523, and the integers from (1523+1)/2 = 762 up to (1531-1)/2 = 765 are all composite, as they fall in the gap between A000040(135) and A000040(136). In addition, 1531 is not in A080359, which adds 1531 to this sequence here.
		

Crossrefs

Programs

  • Mathematica
    maxPrime = 3500;
    kmax = PrimePi[maxPrime];
    A164333 = Select[Table[{(Prime[k - 1] + 1)/2, (Prime[k] - 1)/2}, {k, 3, kmax}], AllTrue[Range[#[[1]], #[[2]]], CompositeQ] &][[All, 2]]*2 + 1;
    b[1] = 2; b[n_] := b[n] = Module[{k = b[n - 1]}, While[(PrimePi[k] - PrimePi[Quotient[k, 2]]) != n, k++]; k];
    A080359 = Reap[For[n = 1, b[n] <= maxPrime, n++, Sow[b[n]]]][[2, 1]];
    Complement[A164333, A080359] (* Jean-François Alcover, Sep 14 2018 *)
  • PARI
    okprime(p) = { my(k = primepi(p)); for (i = (prime(k-1)+1)/2, (prime(k)-1)/2, if (isprime(i), return (0));); return (1);}
    lista(nn) = {vlp = readvec("b080359.txt"); forprime (p=2, nn, if (! vecsearch(vlp, p) && okprime(p), print1(p, ", ")););} \\ Michel Marcus, Jan 15 2014

Formula

Extensions

Extended beyond 571 by R. J. Mathar, Oct 02 2009

A164333 Primes prime(k) such that all integers in the interval [(prime(k-1)+1)/2, (prime(k)-1)/2] are composite numbers.

Original entry on oeis.org

13, 19, 31, 43, 53, 61, 71, 73, 101, 103, 109, 113, 131, 139, 151, 157, 173, 181, 191, 193, 199, 229, 233, 239, 241, 251, 269, 271, 283, 293, 311, 313, 349, 353, 373, 379, 409, 419, 421, 433, 439, 443, 463, 491, 499, 509, 523, 571, 577, 593, 599, 601, 607, 613, 619, 643
Offset: 1

Views

Author

Vladimir Shevelev, Aug 13 2009

Keywords

Comments

Let p_k be the k-th prime. A prime p is in the sequence iff the interval of the form (2p_k, 2p_(k+1)), containing p, also contains a prime less than p. The sequence is connected with the following classification of primes: the first two primes 2,3 form a separate set of primes; let p >= 5 be in the interval (2p_k, 2p_(k+1)), then 1) if in this interval there are only primes greater than p, then p is called a right prime; 2) if in this interval there are only primes less than p, then p is called a left prime; 3) if in this interval there are primes both greater and less than p, then p is called a central prime; 4) if this interval does not contain other primes, then p is called an isolated prime. In particular, the right primes form sequence A166307, and all Ramanujan primes (A104272) greater than 2 are either right or central primes; the left primes form sequence A182365, and all Labos primes (A080359) greater than 3 are either left or central primes; the central primes form A166252 and the isolated primes form A166251. [Vladimir Shevelev, Oct 10 2009] [Sequence reference updated by Peter Munn, Jun 01 2023]
Disjoint union of A166252 and A182365. - Peter Munn, Jun 01 2023 [an edited version of a contribution by Vladimir Shevelev in 2009]

Examples

			Let p=53. We see that 2*23<53<2*29. Since the interval (46, 58) contains prime 47<53 and does not contain any prime more than 53, then, by the considered classification 53 is left prime and it is in the sequence. [_Vladimir Shevelev_, Oct 10 2009]
		

Crossrefs

Programs

  • Maple
    isA164333 := proc(n)
            local i ;
            if isprime(n) and n > 3 then
                    for i from (prevprime(n)+1)/2 to (n-1)/2 do
                            if isprime(i) then
                                    return false;
                            end if;
                    end do;
                    return true;
            else
                    false;
            end if;
    end proc:
    for i from 2 to 700 do
            if isA164333(i) then
                    printf("%d,",i);
            end if;
    end do: # R. J. Mathar, Oct 29 2011
  • Mathematica
    kmax = 200; Select[Table[{(Prime[k - 1] + 1)/2, (Prime[k] - 1)/2}, {k, 3, kmax}], AllTrue[Range[#[[1]], #[[2]]], CompositeQ]&][[All, 2]]*2 + 1 (* Jean-François Alcover, Nov 14 2017 *)

Formula

{A080359} union {A164294} = {this sequence} union {2,3}. - Vladimir Shevelev, Oct 29 2011
A164368(2)A164368(3)A164368(4)Vladimir Shevelev, Oct 10 2009]

Extensions

Definition rephrased by R. J. Mathar, Oct 02 2009

A067845 Largest n-digit pseudoprime (to base 2).

Original entry on oeis.org

645, 8911, 93961, 997633, 9995671, 99971821, 999828727, 9999109081, 99983971501, 999986341201, 9999946514845, 99999856404001, 999994510007533, 9999999191658001, 99999984319096601, 999999995115616561, 9999999995077192591
Offset: 3

Views

Author

Shyam Sunder Gupta, Feb 14 2002

Keywords

Examples

			a(2)=8911, so largest pseudoprime (base 2) of 4 digits is 8911.
		

Crossrefs

Extensions

More terms from Farideh Firoozbakht, Jan 11 2007
a(17)-a(19) from Amiram Eldar, Jun 30 2019

A062852 Largest n-digit strong pseudoprimes (in base 2).

Original entry on oeis.org

8321, 90751, 983401, 9995671, 99789673, 999828727, 9998721001, 99973476433, 999855751441, 9998974546471, 99999760517281, 999985147456681, 9999952887414577, 99999984319096601, 999999916795882627, 9999999995077192591
Offset: 4

Views

Author

Shyam Sunder Gupta, Feb 13 2002

Keywords

Examples

			a(4)=8321 since 8321 is the largest 4-digit strong pseudoprime to base 2.
		

Crossrefs

Extensions

Edited by Charles R Greathouse IV, Nov 01 2009
a(16)-a(19) from Charles R Greathouse IV, Mar 14 2011

A068216 a(n) is the smallest n-digit pseudoprime (to base 2).

Original entry on oeis.org

341, 1105, 10261, 101101, 1004653, 10004681, 100017223, 1001152801, 10000321321, 100004790097, 1000001376901, 10000130243671, 100000105970311, 1000000191735161, 10000006286491369, 100000010102756401, 1000000114865704261, 10000000494514450733
Offset: 3

Views

Author

Keywords

Crossrefs

Extensions

One more term from Farideh Firoozbakht, Jan 10 2007
More terms from Jens Kruse Andersen, May 11 2008
Offset corrected by Arkadiusz Wesolowski, Dec 14 2011

A048123 Smallest n-digit Carmichael numbers.

Original entry on oeis.org

561, 1105, 10585, 101101, 1024651, 10024561, 100427041, 1001152801, 10017089857, 100023777217, 1000151515441, 10000879761601, 100000782192961, 1000040508690301, 10000092861302401, 100001371359120001, 1000004296444433281, 10000011591390633121
Offset: 3

Views

Author

Shyam Sunder Gupta, Feb 17 2002

Keywords

Examples

			a(4)=1105 because 1105 is the smallest 4-digit Carmichael number. [corrected by _Jon E. Schoenfield_, Jan 28 2014]
		

Crossrefs

Programs

  • Mathematica
    CarmichaelNbrQ[n_] := ! PrimeQ@ n && Mod[n, CarmichaelLambda@ n] == 1; f[n_] := Block[{k = 10^(n - 1) + 1}, While[! CarmichaelNbrQ@ k, k += 2]; k]; Do[ Print[{n, f[n] // Timing}], {n, 3, 18}]

Extensions

a(17)-a(20) from Amiram Eldar, Jun 29 2019

A063400 Largest n-digit Carmichael numbers.

Original entry on oeis.org

561, 8911, 75361, 997633, 9890881, 99861985, 993905641, 9999109081, 99976607641, 999629786233, 9999501351841, 99994742993377, 999922265173441, 9999924433632001, 99999201310035841, 999996386511276505, 9999998594193164041
Offset: 3

Views

Author

Shyam Sunder Gupta, Feb 17 2002

Keywords

Examples

			a(4)=8911 because 8911 is the largest 4-digit Carmichael number. [corrected by _Jon E. Schoenfield_, Jan 28 2014]
		

Crossrefs

Programs

  • Mathematica
    CarmichaelNbrQ[n_] := !PrimeQ[n] && Mod[n, CarmichaelLambda[n]] == 1; f[n_] := f[n] = Block[{k = 10^n - 1}, While[!CarmichaelNbrQ[k], k -= 2]; k]; Reap[Do[Print[{n, f[n]}]; Sow[f[n]], {n, 3, 10}]][[2, 1]] (* Jean-François Alcover, Jan 28 2014, after Shyam Sunder Gupta *)

Extensions

a(17)-a(19) from Amiram Eldar, Jun 29 2019
Showing 1-9 of 9 results.