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.

A214500 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 A214500 #13 Jun 10 2022 15:48:35
%S A214500 1,2,1,2,3,3,9,3,4,1,8,20,4,10,24,8,17,9,28,16,19,6,33,19,12,5,49,27,
%T A214500 25,26,10,91,143,9,41,14,36,11,34,26,28,10,50,7,12,11,8,27,13,4,44,
%U A214500 138,50,10,45,21,51,84,65,48,39,139,36,19,22,85,113,105,5,36
%N A214500 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 A214500 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 A214500 Heuristically, the average of a(n)/n over n=1 to N tends to 0.83 as N increases.
%o A214500 (PFGW64 and SCRIPTIFY)
%o A214500 SCRIPT
%o A214500 DIM nn, 0
%o A214500 DIM kk
%o A214500 DIM jj
%o A214500 DIMS tt
%o A214500 OPENFILEOUT myfile, b(n).txt
%o A214500 OPENFILEOUT myf, a(n).txt
%o A214500 LABEL loopn
%o A214500 SET nn, nn+1
%o A214500 SET jj, 0
%o A214500 IF nn>500 THEN END
%o A214500 SET kk, 0
%o A214500 LABEL loopk
%o A214500 SET kk, kk+1
%o A214500 SETS tt, %d, %d\,; nn; kk
%o A214500 PRP (3^nn+kk)*3^nn-1, tt
%o A214500 IF ISPRP THEN GOTO a
%o A214500 IF ISPRIME THEN GOTO a
%o A214500 GOTO loopk
%o A214500 LABEL a
%o A214500 SET jj, jj+1
%o A214500 PRP (3^nn+kk)*3^nn+1, tt
%o A214500 IF ISPRP THEN GOTO d
%o A214500 IF ISPRIME THEN GOTO d
%o A214500 GOTO loopk
%o A214500 LABEL d
%o A214500 WRITE myfile, tt
%o A214500 SETS tt, %d, %d\,; nn; jj
%o A214500 WRITE myf, tt
%o A214500 GOTO loopn
%Y A214500 Cf. A212037, A214495, A214496, A214499.
%K A214500 nonn
%O A214500 1,2
%A A214500 _Pierre CAMI_, Jul 20 2012