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 31-40 of 98 results. Next

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

Original entry on oeis.org

37, 67, 79, 97, 127, 157, 163, 211, 223, 277, 307, 331, 337, 367, 373, 379, 397, 409, 439, 457, 487, 499, 541, 547, 577, 607, 613, 631, 673, 691, 709, 727, 733, 739, 751, 757, 769, 787, 853, 877, 907, 919, 937, 967, 991, 997, 1009, 1039, 1069, 1087, 1117
Offset: 1

Views

Author

Lekraj Beedassy, Aug 20 2006

Keywords

Comments

For the first 30000 terms a(n) > A121762(n), see plot A121764(n) - A121762(n). But is it so for all n? - Zak Seidov, Apr 25 2015
Subsequence of A002476. - Michel Marcus, Apr 26 2015

Crossrefs

Programs

  • Magma
    [n: n in [1..1150] | (n mod 6 eq 1) 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 *)
    Select[Prime[Range[200]],Mod[#,6]==1&&NoneTrue[#+{2,-2},PrimeQ]&] (* Harvey P. Dale, Jul 16 2021 *)
  • PARI
    {is(n)=n%6==1 && isprime(n) && !isprime(n-2)}; \\ G. C. Greubel, Feb 26 2019
    
  • Sage
    [n for n in (1..1150) if mod(n,6)==1 and not is_prime(n-2) and is_prime(n)] # G. C. Greubel, Feb 26 2019

Extensions

Extended by Ray Chandler, Aug 22 2006

A132259 Isolated primes congruent to {1, 17, 19, 29} mod 30.

Original entry on oeis.org

47, 79, 89, 167, 211, 257, 317, 331, 359, 379, 389, 409, 439, 449, 467, 479, 499, 509, 541, 557, 587, 631, 647, 677, 691, 709, 719, 739, 751, 769, 797, 839, 887, 919, 929, 947, 977, 991, 1009, 1039, 1069, 1097, 1109, 1129, 1171, 1187
Offset: 1

Views

Author

Omar E. Pol, Aug 20 2007

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[200]],NoneTrue[#+{2,-2},PrimeQ]&&MemberQ[ {1,17,19,29},Mod[ #,30]]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Mar 04 2019 *)

A162734 An alternating sum of all numbers from the n-th up to the (n+1)st isolated prime.

Original entry on oeis.org

11, 30, 42, 50, 60, 73, 81, 86, 93, 105, 120, 129, 144, 160, 165, 170, 192, 217, 228, 242, 254, 260, 270, 285, 300, 312, 324, 334, 345, 356, 363, 370, 376, 381, 386, 393, 399, 405, 424, 441, 446, 453, 462, 473, 483, 489, 495, 501, 506, 525, 544, 552, 560
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jul 13 2009

Keywords

Comments

11 followed by the average of each two consecutive non-twin primes. - Colin Barker, Jul 17 2014

Examples

			a(1) = -2+3-4+5-6+7-8+9-10+11-12+13-14+15-16+17-18+19-20+21-22+23 = 11.
a(2) = 23-24+25-26+27-28+29-30+31-32+33-34+35-36+37 = 30.
		

Crossrefs

Cf. A007510.

Programs

  • Maple
    N:= 1000: # to get all terms where the larger non-twin <= N
    Primes:= select(isprime,{seq(2*i-1,i=1..floor((N+1)/2))}):
    NonTwins:= Primes minus (map(t->t+2,Primes) union map(t->t-2,Primes)):
    11, seq((NonTwins[i]+NonTwins[i+1])/2,i=1..nops(NonTwins)-1); # Robert Israel, Jul 21 2014
  • PARI
    non_twin_primes(pmax) = my(s=[]); forprime(p=2, pmax, if(!isprime(p-2) && !isprime(p+2), s=concat(s, p))); s
    a162734(maxp) = my(ntp=non_twin_primes(maxp)); vector(#ntp-1, n, sum(k=ntp[n], ntp[n+1], -k*(-1)^k))
    a162734(500) \\ Colin Barker, Jul 17 2014
    
  • Python
    from sympy import isprime, primerange
    def nontwins(N):
        return [p for p in primerange(1, N+1) if not (isprime(p-2) or isprime(p+2))]
    def auptont(N): # all terms where the larger non-twin <= N
        nt = nontwins(N)
        return [sum((-1)**(j+1)*j for j in range(nt[i], nt[i+1]+1)) for i in range(len(nt)-1)]
    print(auptont(565)) # Michael S. Branicky, Nov 30 2021

Formula

a(n) = sum_{j= A007510(n).. A007510(n+1)} (-1)^(j+1)*j = A001057(A007510(n+1))-A001057(A007510(n)-1).

Extensions

Replaced 55 by 60 and 447 by 446 - R. J. Mathar, Sep 23 2009

A176312 Numbers that are the products of two single (or isolated or non-twin) primes.

Original entry on oeis.org

4, 46, 74, 94, 106, 134, 158, 166, 178, 194, 226, 254, 262, 314, 326, 334, 346, 422, 446, 466, 502, 514, 526, 529, 554, 586, 614, 634, 662, 674, 706, 718, 734, 746, 758, 766, 778, 794, 802, 818, 851, 878, 886, 898, 914, 934, 958, 974, 982, 998, 1006, 1018, 1081
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Apr 15 2010

Keywords

Crossrefs

Cf. A007510.

Programs

  • Maple
    isA007510 := proc(n) isprime(n) and not isprime(n+2) and not isprime(n-2) ; simplify(%) ; end proc:
    isA176312 := proc(n) for d in numtheory[divisors](n) do if isA007510(d) and isA007510(n/d) then return true; end if; end do: return false; end proc:
    for n from 1 to 1200 do if isA176312(n) then printf("%d,",n) ; end if; end do: # R. J. Mathar, Apr 20 2010:
  • Mathematica
    Select[Range[1000], PrimeOmega[#] == 2 && AllTrue[FactorInteger[#][[;;, 1]], ! PrimeQ[#1 - 2] && ! PrimeQ[#1 + 2] &] &] (* Amiram Eldar, Nov 30 2020 *)

Extensions

Entries checked by R. J. Mathar, Apr 20 2010

A176656 The positions of single (or isolated or non-twin) primes in A000040.

Original entry on oeis.org

1, 9, 12, 15, 16, 19, 22, 23, 24, 25, 30, 31, 32, 37, 38, 39, 40, 47, 48, 51, 54, 55, 56, 59, 62, 63, 66, 67, 68, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 85, 86, 87, 88, 91, 92, 93, 94, 95, 96, 97, 100, 101, 102, 103, 106, 107, 108, 111, 112, 115, 118, 119, 122, 123, 124
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Apr 23 2010

Keywords

Programs

Formula

A000040(a(n))=A007510(k).

Extensions

Corrected (32 inserted, one of the 94 removed, 103 inserted, 121 replaced by 122) by R. J. Mathar, Apr 26 2010

A268343 Hermit primes: primes which are not a nearest neighbor of another prime.

Original entry on oeis.org

23, 37, 53, 67, 89, 97, 113, 157, 173, 211, 233, 277, 293, 307, 317, 359, 389, 409, 449, 457, 467, 479, 509, 577, 607, 631, 653, 691, 719, 751, 839, 853, 863, 877, 887, 919, 929, 1039, 1069, 1087, 1201, 1223, 1237, 1283, 1297, 1307, 1327, 1381, 1423, 1439
Offset: 1

Views

Author

Karl W. Heuer, Feb 02 2016

Keywords

Comments

If p is a balanced prime (A006562), with two nearest neighbors, then it eliminates both of those neighbors from being hermits.
Conjecture: the asymptotic probability of a prime being in this list is 1/4.
A subsequence of the isolated primes A007510. The sequence of lonely primes A087770 appears to be a subsequence, except for its first three terms (2, 3 and 7). (This would not be true if one of these were followed by two increasingly larger gaps.) - M. F. Hasler, Mar 15 2016

Examples

			53 is in the list because the previous prime, 47, is closer to 43 than to 53, and the following prime, 59, is closer to 61 than to 53.
		

Crossrefs

Cf. A269734 (number of hermit primes <= prime(n)).

Programs

  • Maple
    N:= 1000: # to get all terms <= N
    pr:= select(isprime, [$2 .. nextprime(nextprime(N))]):
    Np:= nops(pr):
    ishermit:= Vector(Np,1):
    d:= pr[3..Np] + pr[1..Np-2] - 2*pr[2..Np-1]:
    for i from 1 to Np-2 do
      if d[i] > 0 then ishermit[i]:= 0
    elif d[i] < 0 then ishermit[i+2]:= 0
    else ishermit[i]:= 0; ishermit[i+2]:= 0
    fi
    od:
    subs(0=NULL, zip(`*`, pr[1..Np-2],convert(ishermit,list))); # Robert Israel, Mar 09 2016
  • Mathematica
    Select[Prime@ Range@ 228, Function[n, AllTrue[{Subtract @@ Take[#, 2], Subtract @@ Reverse@ Take[#, -2]} &@ Differences[NextPrime[n, #] & /@ {-2, -1, 0, 1, 2}], # < 0 &]]] (* Michael De Vlieger, Feb 02 2016, Version 10 *)
  • PARI
    A268343_list(LIM=1500)={my(d=vector(4),i,o,L=List());forprime(p=1,LIM,(d[i++%4+1]=-o+o=p)d[(i-3)%4+1]&&listput(L,p-d[i%4+1]-d[(i-1)%4+1]));Vec(L)} \\ M. F. Hasler, Mar 15 2016
    
  • PARI
    is_A268343(n,p=precprime(n-1))={n-p>p-precprime(p-1)&&(p=nextprime(n+1))-n>nextprime(p+1)-p&&isprime(n)} \\ M. F. Hasler, Mar 15 2016

Extensions

Deleted my incorrect conjecture about asymptotic behavior. - N. J. A. Sloane, Mar 10 2016

A072963 In prime factorization of n replace all single (i.e., non-twin) primes with 1.

Original entry on oeis.org

1, 1, 3, 1, 5, 3, 7, 1, 9, 5, 11, 3, 13, 7, 15, 1, 17, 9, 19, 5, 21, 11, 1, 3, 25, 13, 27, 7, 29, 15, 31, 1, 33, 17, 35, 9, 1, 19, 39, 5, 41, 21, 43, 11, 45, 1, 1, 3, 49, 25, 51, 13, 1, 27, 55, 7, 57, 29, 59, 15, 61, 31, 63, 1, 65, 33, 1, 17, 3, 35, 71, 9, 73, 1, 75, 19, 77, 39, 1, 5, 81
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 20 2002

Keywords

Comments

a(a(n)) = a(n).

Examples

			a(92) = a(2*2*23) = 1; a(93) = a(3*31) = 3*31 = 93.
		

Crossrefs

Programs

  • Mathematica
    f[p_, e_] := If[!Or @@ PrimeQ[p + {-2, 2}], 1, p^e]; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 81] (* Amiram Eldar, Jan 10 2020 *)

Formula

Multiplicative with a(p) = (if p+2 or p-2 is prime then p else 1), p prime.

A074239 Related to cumulative number of non-twin primes.

Original entry on oeis.org

0, 0, 0, 1, 1, 2, 2, 3, 4, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 11, 12, 13, 14, 15, 16, 16, 17, 17, 18, 19, 20, 21, 21, 22, 22, 23, 24, 25, 26, 27, 27, 28, 28, 29, 29, 30, 31, 32, 32, 33, 34, 34, 35, 36, 37, 38, 38, 39, 40, 40, 41, 42, 43, 43, 44, 45, 46, 47, 47, 48, 49, 50
Offset: 0

Views

Author

Rudi Huysmans (rudi.huysmans(AT)pandora.be), Sep 18 2002

Keywords

Crossrefs

Cf. A065091 (odd primes), A007510 (non-twin primes).

Programs

  • Maple
    N:= 100: # to get a(0) to a(N)
    P:= [seq(ithprime(i),i=2..N+2)]:
    ListTools:-PartialSums([0,seq(`if`(P[i]-P[i-1]=2,0,1),i=2..N+1)]); # Robert Israel, May 13 2016
  • Mathematica
    Accumulate@ Table[If[Prime@ n - Prime[n - 1] == 2, 0, 1], {n, 2, 120}] - 1 (* Michael De Vlieger, May 13 2016, after Robert Israel *)
  • PARI
    op(n) = prime(n+1);
    lista(nn) = {my(x=0); for (n=1, nn, print1(x, ", "); if ((op(n+1) - op(n)) > 2, x++););} \\ Michel Marcus, May 13 2016

Formula

Take the sequence of odd primes op(n); set a(0) = 0; if op(n+1)-op(n)=2 a(n+1) = a(n), if op(n+1)-op(n) > 2 a(n+1) = a(n) + 1.

A130286 Strongly-single primes: primes p such that neither previousprime(p) nor nextprime(p) is a twin prime.

Original entry on oeis.org

83, 89, 127, 163, 167, 257, 331, 359, 367, 373, 379, 383, 389, 397, 401, 443, 449, 479, 487, 491, 499, 503, 547, 557, 587, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977
Offset: 1

Views

Author

Zak Seidov, Aug 06 2007

Keywords

Crossrefs

Cf. A000040 (primes), A001097 (twin primes), A007510 (single primes), A071904 (odd composite numbers).

Programs

  • Magma
    f:=func; g:=func; [p: p in PrimesInInterval(5,1000)| not IsPrime(f(p)-2) and not IsPrime(g(p)+2) and not IsPrime(f(f(p))-2) and not IsPrime(g(g(p))+2)]; // Marius A. Burtea, Jan 02 2020
  • Mathematica
    PrimeNext[n_]:=Module[{k},k=n+1;While[ !PrimeQ[k],k++ ];k]; PrimePrev[n_]:=Module[{k},k=n-1;While[ !PrimeQ[k],k-- ];k]; lst={};Do[p=Prime[n];If[ !PrimeQ[p-2]&&!PrimeQ[PrimePrev[p]-2]&&!PrimeQ[p+2]&&!PrimeQ[PrimeNext[p]+2],AppendTo[lst,p]],{n,6!}];lst (* Vladimir Joseph Stephan Orlovsky, Jul 21 2009 *)

Extensions

Some terms corrected by Vladimir Joseph Stephan Orlovsky, Jul 21 2009

A132248 Isolated primes congruent to 1 (mod 30).

Original entry on oeis.org

211, 331, 541, 631, 691, 751, 991, 1171, 1201, 1381, 1471, 1531, 1741, 1801, 1831, 1861, 2011, 2161, 2221, 2251, 2281, 2371, 2521, 2671, 2851, 3061, 3181, 3271, 3511, 3571, 3631, 3691, 4111, 4201, 4441, 4561, 4591, 4621, 4831, 4861
Offset: 1

Views

Author

Omar E. Pol, Aug 20 2007

Keywords

Crossrefs

Cf. A007510.

Programs

  • Mathematica
    Select[Select[Partition[Prime[Range[700]],3,1],FreeQ[Differences[#],2]&][[All,2]],Mod[#,30]==1&] (* Harvey P. Dale, Nov 30 2019 *)
Previous Showing 31-40 of 98 results. Next