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.

A214499 The size of the set of numbers k>=0 such that all (3^n-k)*3^n-1 are prime but only the last (largest) (3^n-k)*3^n+1 is also an associated twin prime.

This page as a plain text file.
%I A214499 #10 Jul 23 2012 19:45:08
%S A214499 1,1,4,4,1,1,2,3,4,6,4,6,4,11,3,10,6,9,4,18,30,16,8,29,5,32,21,15,45,
%T A214499 5,97,10,36,3,33,35,55,20,54,25,30,30,36,8,38,30,16,6,3,20,10,35,36,2,
%U A214499 84,20,52,85,25,25,70,46,15,53,6,103,11,27,87,15,42,14
%N A214499 The size of the set of numbers k>=0 such that all (3^n-k)*3^n-1 are prime but only the last (largest) (3^n-k)*3^n+1 is also an associated twin prime.
%C A214499 Starting at a count of zero, we consider for increasing k>=0 the pairs (3^n-k)*3^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 A214499 Heuristically, the average of a(n)/n over n=1 to N tends to 0.83 as N increases.
%H A214499 Pierre CAMI, <a href="/A214499/b214499.txt">Table of n, a(n) for n = 1..500</a>
%o A214499 PFGW64 and SCRIPTIFY
%o A214499 SCRIPT
%o A214499 DIM nn,0
%o A214499 DIM kk
%o A214499 DIM jj
%o A214499 DIMS tt
%o A214499 OPENFILEOUT myfile,b(n).txt
%o A214499 OPENFILEOUT myf,a(n).txt
%o A214499 LABEL loopn
%o A214499 SET nn,nn+1
%o A214499 SET jj,0
%o A214499 IF nn>500 THEN END
%o A214499 SET kk,0
%o A214499 LABEL loopk
%o A214499 SET kk,kk+1
%o A214499 SETS tt,%d,%d\,;nn;kk
%o A214499 PRP (3^nn-kk)*3^nn-1,tt
%o A214499 IF ISPRP THEN GOTO a
%o A214499 IF ISPRIME THEN GOTO a
%o A214499 GOTO loopk
%o A214499 LABEL a
%o A214499 SET jj,jj+1
%o A214499 PRP (3^nn-kk)*3^nn+1,tt
%o A214499 IF ISPRP THEN GOTO d
%o A214499 IF ISPRIME THEN GOTO d
%o A214499 GOTO loopk
%o A214499 LABEL d
%o A214499 WRITE myfile,tt
%o A214499 SETS tt,%d,%d\,;nn;jj
%o A214499 WRITE myf,tt
%o A214499 GOTO loopn
%Y A214499 Cf. A212037, A214495, A214496, A214500, A214501, A214502.
%K A214499 nonn
%O A214499 1,3
%A A214499 _Pierre CAMI_, Jul 20 2012