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 A212038 #19 Sep 03 2024 15:14:07 %S A212038 1,7,5,2,4,11,6,1,3,2,31,2,11,11,11,6,30,16,2,36,90,56,11,52,13,36,10, %T A212038 62,20,31,23,28,30,14,47,22,10,5,104,39,11,14,64,184,209,176,193,162, %U A212038 25,38,23,5,27,157,5,17,32,90,1,199,96,83,29,82,12,220,19,40,37,13,16,120,11,130,12,77,202 %N A212038 The size of the set of numbers k>=0 such that all (2^n-k)*2^n-1 are prime but only (2^n-k)*2^n+1 with the largest k is also the associated twin prime. %C A212038 Search set similar to A212037 but the sign of k in the prime form is switched. %C A212038 Heuristically the average of a(n)/n for n=1 to N tends to 1 as N increases. %H A212038 Pierre CAMI, <a href="/A212038/b212038.txt">Table of n, a(n) for n = 4..825</a> %p A212038 A212038 := proc(n) %p A212038 local a,k,p ; %p A212038 a := 0 ; %p A212038 for k from 0 do %p A212038 p := (2^n-k)*2^n-1 ; %p A212038 if isprime(p) then %p A212038 a := a+1 ; %p A212038 end if; %p A212038 if isprime(p) and isprime(p+2) then %p A212038 return a; %p A212038 end if; %p A212038 end do: %p A212038 end proc: # _R. J. Mathar_, Jul 21 2012 %o A212038 (PFGW) %o A212038 SCRIPT %o A212038 DIM nn, 3 %o A212038 DIM jj %o A212038 DIM kk %o A212038 DIMS tt %o A212038 OPENFILEOUT myfile, a(n).txt %o A212038 LABEL loopn %o A212038 SET nn, nn+1 %o A212038 IF nn>825 THEN END %o A212038 SET kk, -1 %o A212038 SET jj, 0 %o A212038 LABEL loopk %o A212038 SET kk, kk+1 %o A212038 SETS tt, %d, %d\,; nn; kk %o A212038 PRP (2^nn-kk)*2^nn-1, tt %o A212038 IF ISPRP THEN GOTO a %o A212038 IF ISPRIME THEN GOTO a %o A212038 GOTO loopk %o A212038 LABEL a %o A212038 SET jj, jj+1 %o A212038 PRP (2^nn-kk)*2^nn+1, tt %o A212038 IF ISPRP THEN GOTO d %o A212038 IF ISPRIME THEN GOTO d %o A212038 GOTO loopk %o A212038 LABEL d %o A212038 SETS tt, %d, %d\,; nn; jj %o A212038 WRITE myfile, tt %o A212038 GOTO loopn %Y A212038 Cf. A191619, A191620, A205322. %K A212038 nonn %O A212038 4,2 %A A212038 _Pierre CAMI_, Jul 14 2012