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

A086139 Let p = A046133(n), that is, let p run through the list of primes such that p+12 is also prime (A046133); a(n) = number of primes in the interval p + 1 through p + 11 inclusive.

Original entry on oeis.org

3, 3, 3, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 1, 3, 3, 2, 1, 1, 1, 1, 1, 1, 0, 0, 2, 2, 1, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 0, 1, 1, 1, 0, 1, 1, 1, 2, 0, 1, 2, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 0, 1, 0, 2, 2, 2, 2, 0, 1, 2, 1, 2, 0, 1, 3, 2, 0, 0, 0, 1, 1, 1, 2, 2
Offset: 1

Views

Author

Labos Elemer, Jul 29 2003

Keywords

Comments

From Michael De Vlieger, Jul 30 2017: (Start)
a(n) = 0 for n = {24, 25, 44, 48, 53, 57, 62, 70, 82, 84, 89, 94, ...}.
a(n) = 1 for n = {9, 14, 18, 19, 20, 21, 22, 23, 28, 29, 30, 33, ...}.
a(n) = 2 for n = {4, 5, 6, 7, 8, 10, 11, 12, 13, 17, 26, 27, 31, ...}.
a(n) = 3 for n = {1, 2, 3, 15, 16, 96, 118, 183, 266, 570, 581, ...}.
(End)

Examples

			For n=1, we have p=5, the primes between 5 and 5+12=17 are 7,11,13, so a(1)=3.
		

Crossrefs

Programs

  • Maple
    a:=[]; b:=[];
    for n from 1 to 200 do if isprime(ithprime(n)+12) then
       a:=[op(a),ithprime(n)];
    c:=0;
    for i from 1 to 11 do if isprime(ithprime(n)+i) then c:=c+1; fi; od;
    b:=[op(b),c];
    fi;
    od:
    a; # A046133b; # this sequence
  • Mathematica
    cp[x_,y_] := Count[Table[PrimeQ[i],{i,x,y}],True]; d = 12; Do[s = Prime[n]; If[PrimeQ[s+d], Print[cp[s+1,s+d-1]]], {n, 1, 1000}]
    (* Second program: *)
    With[{d = 12}, DeleteCases[#, -1] &@ Table[Function[p, If[PrimeQ[p + d],
    Count[Range[p + 1, p + d - 1], _?PrimeQ], -1] ]@ Prime@ n, {n, 252}]]
    PrimePi[#+11]-PrimePi[#+1]&/@Select[Prime[Range[400]],PrimeQ[#+12]&] (* Harvey P. Dale, Jul 30 2022 *)

Extensions

Definition edited by N. J. A. Sloane, Aug 05 2017 following analysis by Michael De Vlieger, Jul 30 2017

A303214 Prime numbers whose average with the previous prime is not divisible by 2 or 3.

Original entry on oeis.org

3, 211, 223, 479, 521, 631, 673, 809, 1009, 1213, 1249, 1319, 1471, 1511, 1523, 1543, 1693, 1721, 1801, 1823, 1901, 2081, 2111, 2203, 2309, 2411, 2459, 2591, 2633, 2789, 2939, 3061, 3079, 3181, 3203, 3271, 3343, 3359, 3511, 3571, 3671, 3943, 4001, 4091, 4111
Offset: 1

Views

Author

Olivier Bélot, Apr 19 2018

Keywords

Comments

Very similar to A031931.
3 and all prime(k+1) such that A001223(k) is divisible by 12. - Robert Israel, Jul 04 2018

Examples

			p = 223 => (p + previous_prime(p))/2 = (223 +211)/2 = 7*31;
p =  53 => (p + previous_prime(p))/2 =  (53 + 51)/2 = 52 (divisible by 2).
		

Crossrefs

Programs

  • Maple
    count:= 1: Res:= 3:
    p:= 3:
    while count < 100 do
      q:= p; p:= nextprime(p);
      v:= (q+p)/2;
      if igcd(v,6)=1 then
        count:= count+1;
        Res:= Res, p;
      fi
    od:
    Res;# Robert Israel, Jul 04 2018
  • PARI
    ok(n)={my(t=n+precprime(n-1)); n > 2 && isprime(n) && t%4 && t%3} \\ Andrew Howroyd, Jul 02 2018

Formula

2 NOT(|) (p+previous_prime(p))/2 AND 3 NOT(|) (p+previous_prime(p))/2

A355161 Primes p such that p - prevprime(p) is not a power of 2.

Original entry on oeis.org

29, 37, 53, 59, 67, 79, 89, 127, 137, 149, 157, 163, 173, 179, 191, 211, 223, 239, 251, 257, 263, 269, 277, 293, 307, 331, 337, 347, 359, 373, 379, 389, 419, 431, 439, 449, 479, 509, 521, 541, 547, 557, 563, 569, 577, 587, 593, 599, 607, 613
Offset: 1

Views

Author

Reed Michael Upson, Jun 21 2022

Keywords

Comments

A130796(n) is prevprime(p).
A031925 and A031931 are subsequences, as 6 and 12 are not powers of 2.

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[2, 120]], (d = # - NextPrime[#, -1]) != 2^IntegerExponent[d, 2] &] (* Amiram Eldar, Jun 22 2022 *)
  • PARI
    isp2(n) = my(p); (n==1) || (isprimepower(n, &p) && (p==2)); \\ A000079
    isok(p) = isprime(p) && !isp2(p-precprime(p-1)) \\ Michel Marcus, Jun 22 2022
    
  • Python
    from itertools import islice, count
    from sympy import prime, prevprime
    def A355161_gen(): # generator of terms
        return filter(lambda n:((~(m:=n-prevprime(n))+1)&m)-m, (prime(n) for n in count(2)))
    A355161_list = list(islice(A355161_gen(),30)) # Chai Wah Wu, Aug 23 2022

Formula

a(n) = A151800(A130796(n)).
Showing 1-3 of 3 results.