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.

A193262 Number of representations of 2*p_n as sum of two primes p,q such that p*q-2 is prime (p_n is the n-th prime).

This page as a plain text file.
%I A193262 #35 Nov 11 2020 08:29:39
%S A193262 1,1,2,2,1,3,1,1,2,2,0,3,0,2,3,4,2,1,3,4,2,0,4,2,5,2,2,5,2,2,5,2,4,1,
%T A193262 0,1,2,0,8,3,0,2,2,5,3,0,1,5,7,1,3,1,2,4,5,5,1,0,3,2,4,3,4,2,3,3,1,3,
%U A193262 2,0,8,3,4,3,0,9,1,6,0,2,5,2,2,9,1,5,4,3,1,7,5,2,4,2,1
%N A193262 Number of representations of 2*p_n as sum of two primes p,q such that p*q-2 is prime (p_n is the n-th prime).
%C A193262 Sequence arising in connection with conjecture in comment to A192189.
%C A193262 Conjecture: There exists n_0, such that, for n>n_0, a(n)>0.
%H A193262 Alois P. Heinz, <a href="/A193262/b193262.txt">Table of n, a(n) for n = 1..10000</a>
%e A193262 a(4)=2 since 2*p(4) = 14 = 3+11 = 7+7, and 3*11-2 = 31, 7*7-2 = 47 are prime.
%p A193262 a:= proc(n) local t, s, p, q;
%p A193262       t:= 2*ithprime(n);
%p A193262       s:= 0;
%p A193262       p:= 2;
%p A193262       do q:= t-p;
%p A193262          if q<p then break fi;
%p A193262          if isprime(q) and isprime(p*q-2) then s:= s+1 fi;
%p A193262          p:= nextprime(p)
%p A193262       od; s
%p A193262     end:
%p A193262 seq(a(n), n=1..100);  # _Alois P. Heinz_, Aug 04 2011
%t A193262 a[n_] := Module[{t = 2 Prime[n], s = 0, p = 2, q}, While[True, q = t - p; If[q < p, Break[]]; If[PrimeQ[q] && PrimeQ[p q - 2], s++]; p = NextPrime[p]]; s];
%t A193262 Array[a, 100] (* _Jean-François Alcover_, Nov 11 2020, after _Alois P. Heinz_ *)
%o A193262 (PARI) A193262(n,c=0)={ n=2*prime(n); forprime(p=1,n/2,isprime(n-p) || next; isprime(p*(n-p)-2) & c++);c}  \\ _M. F. Hasler_, Aug 06 2011
%Y A193262 Cf. A045917.
%K A193262 nonn,look
%O A193262 1,3
%A A193262 _Vladimir Shevelev_, Aug 04 2011