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.
%I A212037 #25 Aug 27 2022 03:17:04 %S A212037 1,6,1,4,2,2,2,24,6,2,28,7,16,47,29,6,41,16,3,17,32,10,10,23,14,15,52, %T A212037 4,13,20,23,4,84,26,88,50,20,35,51,44,41,87,1,142,13,188,107,162,91, %U A212037 96,197,4,148,71,9,66,97,41,10,9,152,234,48,104,144,40,18,45,52,204,21,49,51,9,102,13,31,108,88 %N A212037 The size of the set of numbers k>=0 such that all (2^n+k)*2^n-1 are prime but only the last (largest) (2^n+k)*2^n+1 is also an associated twin prime. %C A212037 Starting at a count of zero, we consider for increasing k>=0 the pairs (2^n+k)*2^n+-1. If the smaller of these two numbers is prime, we increase the counter. If the larger of these two numbers is also prime, we admit the counter to the sequence. It is basically a measure of how many unsuccessful primality tests on the larger of the two numbers are done before it becomes a compatible twin prime. %C A212037 Heuristically, the average of a(n)/n over n=1 to N tends to 1 as N increases. %H A212037 Pierre CAMI, <a href="/A212037/b212037.txt">Table of n, a(n) for n = 1..825</a> %e A212037 For n=2, the 6 pairs (19,21) at k=1, (23,25) at k=2, (31,33) at k=4, (43,45) at k=7, (47,49) at k=8 and (59,61) at k=11 are counted. The smaller of these must be a prime to be counted, and at k=11 also the larger (i.e., 61) becomes prime, which finishes the search. %p A212037 A212037 := proc(n) %p A212037 local a,k,p ; %p A212037 a := 0 ; %p A212037 for k from 0 do %p A212037 p := (2^n+k)*2^n-1 ; %p A212037 if isprime(p) then %p A212037 a := a+1 ; %p A212037 end if; %p A212037 if isprime(p) and isprime(p+2) then %p A212037 return a; %p A212037 end if; %p A212037 end do: %p A212037 end proc: # _R. J. Mathar_, Jul 20 2012 %o A212037 (PFGW & SCRIPT) %o A212037 SCRIPT %o A212037 DIM nn, 0 %o A212037 DIM jj %o A212037 DIM kk %o A212037 DIMS tt %o A212037 OPENFILEOUT myfile, a(n).txt %o A212037 LABEL loopn %o A212037 SET nn, nn+1 %o A212037 IF nn>825 THEN END %o A212037 SET kk, -1 %o A212037 SET jj,0 %o A212037 LABEL loopk %o A212037 SET kk, kk+1 %o A212037 SETS tt, %d, %d\,; nn; kk %o A212037 PRP (2^nn+kk)*2^nn-1, tt %o A212037 IF ISPRP THEN GOTO a %o A212037 IF ISPRIME THEN GOTO a %o A212037 GOTO loopk %o A212037 LABEL a %o A212037 SET jj,jj+1 %o A212037 PRP (2^nn+kk)*2^nn+1, tt %o A212037 IF ISPRP THEN GOTO d %o A212037 IF ISPRIME THEN GOTO d %o A212037 GOTO loopk %o A212037 LABEL d %o A212037 SETS tt,%d,%d\,;nn;jj %o A212037 WRITE myfile,tt %o A212037 GOTO loopn %Y A212037 Cf. A191617, A191218, A205321. %K A212037 nonn %O A212037 1,2 %A A212037 _Pierre CAMI_, Jul 14 2012