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.

A329736 Smallest odd prime P such that P*3*2^n - 1 and P*3*2^n + 1 are twin primes.

This page as a plain text file.
%I A329736 #24 May 06 2020 09:38:39
%S A329736 3,5,3,5,43,11,3,19,17,5,113,59,317,331,307,241,127,829,23,149,127,11,
%T A329736 3023,1091,787,971,1523,2741,727,1051,227,211,727,89,1163,71,367,1031,
%U A329736 577,89,1213,1151,3,1021,283,2699,4933,59,647,709,3083,541,1483,2069
%N A329736 Smallest odd prime P such that P*3*2^n - 1 and P*3*2^n + 1 are twin primes.
%H A329736 Daniel Starodubtsev, <a href="/A329736/b329736.txt">Table of n, a(n) for n = 1..1000</a>
%e A329736 3*3*2^1 - 1 =  17,  17 and  19 are twin primes so a(1)=3.
%e A329736 5*3*2^2 - 1 =  59,  59 and  61 are twin primes so a(2)=5.
%e A329736 3*3*2^3 - 1 =  71,  71 and  73 are twin primes so a(3)=3.
%e A329736 5*3*2^4 - 1 = 119, 119 and 121 are twin primes so a(4)=5.
%t A329736 Array[Block[{p = 3}, While[! AllTrue[3 p*2^# + {-1, 1}, PrimeQ], p = NextPrime@ p]; p] &, 54] (* _Michael De Vlieger_, Nov 21 2019 *)
%o A329736 (PFGW Script)
%o A329736 SCRIPT
%o A329736 DIM i
%o A329736 DIM j
%o A329736 DIM n,0
%o A329736 OPENFILEOUT myf,a(n).txt
%o A329736 LABEL loop1
%o A329736 SET n,n+1
%o A329736 IF n>500 THEN END
%o A329736 SET i,1
%o A329736 LABEL loop2
%o A329736 SET i,i+1
%o A329736 SET j,p(i)
%o A329736 PRP j*3*2^n-1,n
%o A329736 IF ISPRP THEN GOTO a
%o A329736 GOTO loop2
%o A329736 LABEL a
%o A329736 PRP j*3*2^n+1,n
%o A329736 IF ISPRP THEN GOTO b
%o A329736 GOTO loop2
%o A329736 LABEL b
%o A329736 WRITE myf,j
%o A329736 GOTO loop1
%o A329736 (PARI) for(n=1,54,my(m=3*2^n);forprime(k=3,oo,my(j=k*m);if(ispseudoprime(j-1)&&ispseudoprime(j+1),print1(k,", ");break))) \\ _Hugo Pfoertner_, Nov 21 2019
%o A329736 (PARI) a(n) = my(p=3, q); while (!isprime(q=p*3*2^n - 1) || !isprime(q+2), p = nextprime(p+1)); p; \\ _Michel Marcus_, May 06 2020
%Y A329736 Cf. A001359, A006512, A013597, A051886, A173937, A210651.
%K A329736 nonn
%O A329736 1,1
%A A329736 _Pierre CAMI_, Nov 20 2019