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.

Previous Showing 21-30 of 98 results. Next

A134797 Odd isolated primes.

Original entry on oeis.org

23, 37, 47, 53, 67, 79, 83, 89, 97, 113, 127, 131, 157, 163, 167, 173, 211, 223, 233, 251, 257, 263, 277, 293, 307, 317, 331, 337, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 439, 443, 449, 457, 467, 479, 487, 491, 499, 503, 509, 541, 547, 557, 563, 577
Offset: 1

Views

Author

Omar E. Pol, Nov 14 2007

Keywords

Programs

  • Mathematica
    Flatten[Select[Split[Prime[Range[106]], #2 - #1 < 4 &], Length[#] == 1 &]] (* Jayanta Basu, Jun 07 2013 *)
  • PARI
    select(p->!isprime(p-2)&&!isprime(p+2),primes(100)[2..100]) \\ Charles R Greathouse IV, Jun 07 2013

Formula

a(n) = A007510(n+1).
a(n) ~ n log n. - Charles R Greathouse IV, Jun 07 2013

A062505 Numbers k such that if p is a prime that divides k, then either p + 2 or p - 2 is also prime.

Original entry on oeis.org

1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 25, 27, 29, 31, 33, 35, 39, 41, 43, 45, 49, 51, 55, 57, 59, 61, 63, 65, 71, 73, 75, 77, 81, 85, 87, 91, 93, 95, 99, 101, 103, 105, 107, 109, 117, 119, 121, 123, 125, 129, 133, 135, 137, 139, 143, 145, 147, 149, 151, 153, 155, 165
Offset: 1

Views

Author

Leroy Quet, Jul 09 2001

Keywords

Comments

Multiplicative closure of twin primes (A001097).

Examples

			35 is included because 35 = 5*7 and both (5+2) and (7-2) are primes.
65 = 5*13 where the factors are members of twin prime pairs: (3,5) and (11,13), therefore a(29) = 65 is a term; but 69 is not because 69 = 3*23 and 23 = A007510(2) is a single prime.
		

References

  • Stephan Ramon Garcia and Steven J. Miller, 100 Years of Math Milestones: The Pi Mu Epsilon Centennial Collection, American Mathematical Society, 2019, pp. 35-37.

Crossrefs

Range of A072963.

Programs

  • Magma
    [k:k in [1..170] | forall{p:p in PrimeDivisors(k)| IsPrime(p+2) or IsPrime(p-2)}]; // Marius A. Burtea, Dec 30 2019
  • Mathematica
    nmax = 15 (* corresponding to last twin prime pair (197,199) *); tp[1] = 3; tp[n_] := tp[n] = (p = NextPrime[tp[n-1]]; While[ !PrimeQ[p+2], p = NextPrime[p]]; p); twins = Flatten[ Table[ {tp[n], tp[n]+2}, {n, 1, nmax}]]; max = Last[twins]; mult[twins_] := Select[ Union[ twins, Apply[ Times, Tuples[twins, {2}], {1}]], # <= max & ]; A062505 = Join[{1}, FixedPoint[mult, twins] ] (* Jean-François Alcover, Feb 23 2012 *)

A072027 Swap (2,3) and all twin prime pairs >(3,5) in prime factorization of n.

Original entry on oeis.org

1, 3, 2, 9, 7, 6, 5, 27, 4, 21, 13, 18, 11, 15, 14, 81, 19, 12, 17, 63, 10, 39, 23, 54, 49, 33, 8, 45, 31, 42, 29, 243, 26, 57, 35, 36, 37, 51, 22, 189, 43, 30, 41, 117, 28, 69, 47, 162, 25, 147, 38, 99, 53, 24, 91, 135, 34, 93, 61, 126, 59, 87, 20, 729, 77
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 07 2002

Keywords

Examples

			a(143) = a(11*13) = a(11)*a(13) = 13*11 = 143.
a(77) = a(7*11) = a(7)*a(11) = 5*13 = 65.
		

Crossrefs

Programs

  • Mathematica
    f[p_, e_] := If[p < 5, 5 - p, If[PrimeQ[p + 2], p + 2, If[PrimeQ[p - 2], p - 2, p]]]^e; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Feb 26 2024 *)
  • PARI
    a(n) = {my(f = factor(n)); prod(i = 1, #f~, p = f[i,1]; if(p < 5, 5-p, if(isprime(p+2), p+2, if(isprime(p-2), p-2, p)))^f[i,2]);} \\ Amiram Eldar, Feb 26 2024

Formula

Multiplicative with a(p) = (if p<=3 then 5-p else (if p+2 is prime then p+2 else (if p-2 is prime then p-2 else p))), p prime.
a(a(n)) = n, self-inverse permutation of natural numbers.
a(n) = n for single primes (A007510) and products of twin prime pairs (A037074).
Sum_{k=1..n} a(k) ~ c * n^2 / 2, where c = Product_{(p < q) swapped pair} ((p^2-p)*(q^2-q)/((p^2-q)*(q^2-p))) = 1.832194438922717... . - Amiram Eldar, Feb 26 2024

A102723 Smallest prime a(n) such that a(n)-x and a(n)+x, for x=1 to n, are all composite.

Original entry on oeis.org

5, 23, 23, 53, 53, 211, 211, 211, 211, 211, 211, 1847, 1847, 2179, 2179, 2179, 2179, 3967, 3967, 16033, 16033, 16033, 16033, 24281, 24281, 24281, 24281, 24281, 24281, 38501, 38501, 38501, 38501, 38501, 38501, 38501, 38501, 38501, 38501, 58831
Offset: 1

Views

Author

Ray G. Opao, Feb 06 2005

Keywords

Comments

a(2n+1)=a(2n). - Robert G. Wilson v, Feb 22 2005
Using Dirichlet's theorem, Sierpiński (1948) proved that a(n) exists for all n > 0. He noted that a(n) is a non-twin prime (A007510), except for a(1) = 5. - Jonathan Sondow, Oct 27 2017

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{k = 1}, While[ Union[ PrimeQ /@ Sort[ Flatten[ Table[{Prime[k] - i, Prime[k] + i}, {i, n}]]]] != {False}, k++ ]; Prime[k]]; Table[ f[n], {n, 40}] (* Robert G. Wilson v, Feb 22 2005 *)
    cmpgap[n_]:=Module[{p=Prime[n]},Min[p-NextPrime[p,-1],NextPrime[p]-p]]; Module[{nn=10000,prs},prs=Table[{Prime[n],cmpgap[n]},{n,nn}];Table[ SelectFirst[ prs,#[[2]]>=k&],{k,2,50}]][[All,1]] (* Harvey P. Dale, Oct 15 2021 *)

Extensions

a(12)-a(40) from Robert G. Wilson v, Feb 22 2005

A132237 Primes congruent to {7, 23} mod 30.

Original entry on oeis.org

7, 23, 37, 53, 67, 83, 97, 113, 127, 157, 173, 233, 263, 277, 293, 307, 337, 353, 367, 383, 397, 443, 457, 487, 503, 547, 563, 577, 593, 607, 653, 683, 727, 743, 757, 773, 787, 863, 877, 907, 937, 953, 967, 983, 997, 1013, 1087, 1103
Offset: 1

Views

Author

Omar E. Pol, Aug 15 2007

Keywords

Comments

Up to 4913, there are more primes of this form than composites. See also A132231 and A227869 (congruent to 7 only). - M. F. Hasler, Nov 02 2013

Crossrefs

Programs

  • Magma
    [ p: p in PrimesUpTo(1300) | p mod 30 in [7, 23] ]; // Vincenzo Librandi, Aug 14 2012
    
  • Mathematica
    Select[Prime[Range[1000]],MemberQ[{7,23},Mod[#,30]]&] (* Vincenzo Librandi, Aug 14 2012 *)
  • PARI
    is_A132237(n)=setsearch([7,23],n%30)&&isprime(n) \\ - M. F. Hasler, Nov 02 2013

A167511 The count of isolated primes between n-th non-isolated nonprime and n-th isolated nonprime.

Original entry on oeis.org

1, 1, 0, 0, 1, 2, 4, 5, 9, 9, 12, 11, 15, 15, 15, 17, 18, 21, 22, 24, 27, 36, 36, 40, 47, 51, 54, 55, 56, 58, 76, 76, 75, 77, 79, 96, 96, 97, 97, 99, 105, 114, 116, 117, 118, 119, 127, 130, 132, 132, 146, 147, 151, 151, 152, 159, 166, 166, 169, 169, 173, 176, 180, 180, 181
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Nov 05 2009

Keywords

Examples

			a(1)=1 (0<2<4); a(2)=1 (1<2<6); a(3)=0 (8<no<12); a(4)=0 (9<no<18); a(5)=1 ( 10<23<30); a(5)=2 (14<23&37<42); a(5)=4 (15<23&37&47&53<60).
		

Crossrefs

Programs

  • Maple
    Contribution from R. J. Mathar, Mar 18 2010: (Start)
    isA007510 := proc(n) isprime(n) and not isprime(n+2) and not isprime(n-2) ; end proc:
    isA001359 := proc(n) isprime(n) and isprime(n+2) ; end proc:
    A001359 := proc(n) if n = 1 then 3 ; else for a from procname(n-1)+2 do if isA001359(a) then return a; end if; end do: end if: end proc:
    isA164276 := proc(n) not isprime(n) and (not isprime(n-1) or not isprime(n+1)) ; end proc:
    A164276 := proc(n) if n = 1 then 0; else for a from procname(n-1)+1 do if isA164276(a) then return a; end if; end do: end if: end proc:
    A014574 := proc(n) A001359(n)+1 ; end proc:
    A167511 := proc(n) a := 0 ; for i from A164276(n)+1 to A014574(n)-1 do if isA007510(i) then a :=a +1 ; end if; end do; a ; end proc:
    seq(A167511(n),n=1..80) ; (End)

Formula

a(n) = #{ A007510(i): A164276(n) < A007510(i) < A014574(n)}. [From R. J. Mathar, Mar 18 2010]
a(n) = SUM{A010051(k)*(1-A164292(k)): A164276(n)<=k<=A014574(n)}. [From Reinhard Zumkeller, Apr 02 2010]

Extensions

a(12), a(31) and a(32) corrected by R. J. Mathar, Mar 18 2010

A167771 Twice-isolated primes: primes p such that neither p+-2 nor p+-4 is prime.

Original entry on oeis.org

2, 53, 89, 157, 173, 211, 251, 257, 263, 293, 331, 337, 359, 367, 373, 389, 409, 449, 479, 509, 541, 547, 557, 563, 577, 587, 593, 607, 631, 653, 683, 691, 701, 709, 719, 727, 733, 751, 787, 797, 839, 919, 929, 947, 953, 977, 983, 991, 997, 1039, 1069, 1103
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Nov 11 2009

Keywords

Comments

2 together with primes p with property that (p-previous prime)>=6 and (next prime-p)>=6.
By the finitude of the generalized Brun constants, this sequence includes almost all primes.

Examples

			a(1)=2 (-2,0,4,6 are nonprimes); a(2)=53 (49,51,55,57 are nonprimes).
		

Crossrefs

Programs

  • Mathematica
    Join[{2},Select[Prime[Range[200]],NoneTrue[#+{4,2,-2,-4},PrimeQ]&]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Sep 21 2016 *)

Extensions

Comment from Charles R Greathouse IV, Nov 12 2009

A069456 Non-twin primes that are at least doubly lonely.

Original entry on oeis.org

1039, 2099, 4253, 91121, 386401, 626617, 754973, 873553, 908857, 972137, 1619353, 1749067, 1841681, 2007899, 2169007, 2241353, 2420633, 2484931, 2594971, 3075323, 3129601, 3151843, 3837451, 3843247, 3919229, 4038709, 4545683, 5502449, 5530529, 5921869
Offset: 1

Views

Author

Neil Fernandez, Mar 23 2002

Keywords

Examples

			These are non-twin primes sandwiched between at least 2 pairs of twins on each side. The first number in the sequence is 1039 (sandwiched between 1019,1021,1031,1033 and 1049,1051,1061,1063).
		

Crossrefs

Programs

  • Maple
    Primes:= select(isprime,[seq(i,i=3..6*10^6,2)]):
    good:= select(t -> Primes[t-3]-Primes[t-4]=2 and Primes[t-1]-Primes[t-2]=2 and Primes[t+2]-Primes[t+1]=2 and Primes[t+4]-Primes[t+3]=2, [$5..nops(Primes)-4]):
    Primes[good]; # Robert Israel, May 13 2016
  • Mathematica
    dltpQ[{a_,b_,c_,d_,e_,f_,g_,h_,i_}]:=b-a==d-c==g-f==i-h==2; Transpose[ Select[ Partition[Prime[Range[410000]],9,1],dltpQ]][[5]] (* Harvey P. Dale, May 14 2013 *)

Extensions

More terms from Arkadiusz Wesolowski, May 08 2012

A074038 If n is the k-th single (i.e., non-twin) prime then a(n) = k, otherwise a(n) = 0.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Aug 13 2002

Keywords

Crossrefs

Programs

  • Mathematica
    upto = 100;
    A074038list[upto_] := Module[{k = 0, v = Table[0, {upto}], n},
        For[n = 1, n <= upto, n++, If[PrimeQ[n] && (2 == n ||
        ((!PrimeQ[n-2]) && (!PrimeQ[n+2]))), k++; v[[n]] = k,
        v[[n]] = 0]]; v];
    v074038 = A074038list[upto];
    a[n_] := v074038[[n]];
    Table[a[n], {n, 1, upto}] (* Jean-François Alcover, Dec 03 2021, after PARI code *)
  • PARI
    up_to = 65537;
    A074038list(up_to) = { my(k=0,v=vector(up_to)); for(n=1,up_to,if(isprime(n)&&(2==n||((!isprime(n-2))&&(!isprime(n+2)))),k++;v[n]=k, v[n] = 0)); (v); };
    v074038 = A074038list(up_to);
    A074038(n) = v074038[n];

Formula

A007510(a(n)) = n.

A121762 Single (or isolated or non-twin) primes of form 6n-1.

Original entry on oeis.org

23, 47, 53, 83, 89, 113, 131, 167, 173, 233, 251, 257, 263, 293, 317, 353, 359, 383, 389, 401, 443, 449, 467, 479, 491, 503, 509, 557, 563, 587, 593, 647, 653, 677, 683, 701, 719, 743, 761, 773, 797, 839, 863, 887, 911, 929, 941, 947, 953, 971, 977, 983, 1013
Offset: 1

Views

Author

Lekraj Beedassy, Aug 20 2006

Keywords

Comments

Subsequence of A007528. - Michel Marcus, Apr 26 2015

Crossrefs

Programs

  • Magma
    [n: n in [1..1050] | (n mod 6 eq 5) and not IsPrime(n+2) and  IsPrime(n)]; // G. C. Greubel, Feb 26 2019
    
  • Mathematica
    Select[Table[6n - 1, {n, 200}], PrimeQ[ # ] && ! PrimeQ[ # + 2] &] (* Ray Chandler, Aug 22 2006 *)
  • PARI
    is(n)=n%6==5 && isprime(n) && !isprime(n+2) \\ Charles R Greathouse IV, Apr 04 2016
    
  • Sage
    [n for n in (1..1050) if mod(n,6)==5 and not is_prime(n+2) and  is_prime(n)] # G. C. Greubel, Feb 26 2019

Extensions

Extended by Ray Chandler, Aug 22 2006
Previous Showing 21-30 of 98 results. Next