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.

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.

This page as a plain text file.
%I A086139 #23 Jul 30 2022 17:43:12
%S A086139 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,
%T A086139 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,
%U A086139 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
%N 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.
%C A086139 From _Michael De Vlieger_, Jul 30 2017: (Start)
%C A086139 a(n) = 0 for n = {24, 25, 44, 48, 53, 57, 62, 70, 82, 84, 89, 94, ...}.
%C A086139 a(n) = 1 for n = {9, 14, 18, 19, 20, 21, 22, 23, 28, 29, 30, 33, ...}.
%C A086139 a(n) = 2 for n = {4, 5, 6, 7, 8, 10, 11, 12, 13, 17, 26, 27, 31, ...}.
%C A086139 a(n) = 3 for n = {1, 2, 3, 15, 16, 96, 118, 183, 266, 570, 581, ...}.
%C A086139 (End)
%H A086139 Michael De Vlieger, <a href="/A086139/b086139.txt">Table of n, a(n) for n = 1..10000</a>
%e A086139 For n=1, we have p=5, the primes between 5 and 5+12=17 are 7,11,13, so a(1)=3.
%p A086139 a:=[]; b:=[];
%p A086139 for n from 1 to 200 do if isprime(ithprime(n)+12) then
%p A086139    a:=[op(a),ithprime(n)];
%p A086139 c:=0;
%p A086139 for i from 1 to 11 do if isprime(ithprime(n)+i) then c:=c+1; fi; od;
%p A086139 b:=[op(b),c];
%p A086139 fi;
%p A086139 od:
%p A086139 a; # A046133b; # this sequence
%t A086139 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}]
%t A086139 (* Second program: *)
%t A086139 With[{d = 12}, DeleteCases[#, -1] &@ Table[Function[p, If[PrimeQ[p + d],
%t A086139 Count[Range[p + 1, p + d - 1], _?PrimeQ], -1] ]@ Prime@ n, {n, 252}]]
%t A086139 PrimePi[#+11]-PrimePi[#+1]&/@Select[Prime[Range[400]],PrimeQ[#+12]&] (* _Harvey P. Dale_, Jul 30 2022 *)
%Y A086139 Cf. A031930, A031931, A046133.
%K A086139 nonn
%O A086139 1,1
%A A086139 _Labos Elemer_, Jul 29 2003
%E A086139 Definition edited by _N. J. A. Sloane_, Aug 05 2017 following analysis by _Michael De Vlieger_, Jul 30 2017