%I #25 Feb 27 2019 01:32:09
%S 2,3,11,19,23,31,37,79,83,97,113,131,139,157,173,181,191,211,229,233,
%T 239,241,251,263,271,281,293,331,337,359,367,379,419,431,439,449,503,
%U 541,547,601,607,619,641,653,659,661,691,701,719,727,743,761,769,809
%N Primes g such that 8*g + 2*p is a primorial for some twin prime p.
%C So far, I find that there exists at least one prime g, and at least one twin prime p in A001097, such that 8g + 2p is a primorial. Some of the related twin primes are rather large. The twin related to a(112), for instance, is 242 digits long. For each n, the program returns the primorial, g, g (mod 30) the twin prime (mod 30) and the twin prime. These data are in a linked file.
%H Michael G. Kaarhus, <a href="/A306395/b306395.txt">Table of n, a(n) for n = 0..250</a>
%H Michael G. Kaarhus, <a href="/A306395/a306395.txt">Additional data</a>
%e n | b# = 8 * g + 2 * p greater or lesser
%e --+----------------------------------------------
%e 1 | 5# = 8 * 2 + 2 * 7 greater
%e 2 | 5# = 8 * 3 + 2 * 3 lesser
%e 3 | 7# = 8 * 11 + 2 * 61 greater
%e 4 | 7# = 8 * 19 + 2 * 29 lesser
%e 5 | 7# = 8 * 23 + 2 * 13 greater
%e 6 | 11# = 8 * 31 + 2 * 1031 lesser
%o (CALC) #!/usr/bin/calc -q -f
%o global b=5, chck=list(), g=1, gt, mg30=2, mg6, mp30=7, n=1, oar=pfact(b)/2,
%o tpr=7, ts='greatr', fmt = "%4d%s%5d%s%7d%7d%9d%11s%s%d\n";
%o define bookem(an) {
%o mp30=mod(tpr, 30);
%o printf(fmt, n, '.', b, '#', an, mg30, mp30, ts, ' ', tpr);
%o n++; append(chck, an); return(an);
%o }
%o define incg() {
%o top: g=nextprime(g); mg6=mod(g, 6); mg30=mod(g, 30);
%o if (mg30 == 13 || mg30 == 17) {goto top;}
%o else {gt=g*4; return(mg30);}
%o }
%o define incb(p) {b=nextprime(p); oar=pfact(b)/2; return(b);}
%o print;
%o printf(fmt, 'n', '.', 'b', '#', 'g', 'g%30', 'twin%30', 'twin type', ' ', 'twin prime');
%o print '----------------------------------------------------------';
%o for (i=0; i<=1; i++) {g=nextprime(g); bookem(g); tpr=3; ts='lesser'; mg30=3;}
%o b=incb(b); while (g <= b) {incg();}
%o while (n <= 35) {
%o while (g > b) {
%o tpr=oar-gt;
%o if (tpr <= 7) {incb(b); continue;}
%o if (ptest(tpr, 200)) {
%o if (mg6 == 1 && ptest(tpr+2, 200)) {
%o ts='lesser'; bookem(g); break;
%o }
%o else {if (ptest(tpr-2, 200)) {
%o ts='greatr'; bookem(g); break;
%o }
%o }
%o }
%o incb(b);
%o }
%o incg();
%o while (oar-gt > 0) {b=prevprime(b); oar=pfact(b)/2;}
%o }
%o print; chs=size(chck)-1; for (i=0; i <= chs; i++) {print i+1, chck[[i]];}
%Y Subsequence of A000040. Supersequence of A218046.
%K nonn
%O 1,1
%A _Michael G. Kaarhus_, Feb 12 2019