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.

A233546 Smallest k such that 6^n+k, 6^n+k+g, 6^n+k+2*g are consecutive primes in arithmetic progression.

This page as a plain text file.
%I A233546 #32 Dec 17 2013 06:20:11
%S A233546 11,35,65,41,221,655,515,263,4265,893,4085,1031,3161,145,821,2083,
%T A233546 2101,433,3743,2243,511,2623,5653,271,2885,4157,18023,9023,1151,4787,
%U A233546 737,2141,2833,6181,3217,3635,715,4501,5381,4231,13265,823
%N A233546 Smallest k such that 6^n+k, 6^n+k+g, 6^n+k+2*g are consecutive primes in arithmetic progression.
%C A233546 The sequence starts at n=2 as there is no solution for n=1.
%C A233546 The primes are probable primes for n>23.
%H A233546 Pierre CAMI, <a href="/A233546/b233546.txt">Table of n, a(n) for n = 2..350</a>
%H A233546 Wikipedia, <a href="https://en.wikipedia.org/wiki/Primes_in_arithmetic_progression#Consecutive_primes_in_arithmetic_progression">Consecutive primes in arithmetic progression</a>
%e A233546 6^2+11=47, 6^2+11+6=53, 6^2+11+2*6=59 and 47, 53, 59 are consecutive primes
%e A233546 and k=11 is minimal (since although 6^2+5=41, 6^2+5+6=47, 6^2+5+2*6=53 are primes, they are not consecutive primes), so a(2)=11. (Example clarified by _Jonathan Sondow_, Dec 16 2013.)
%t A233546 a[n_] := For[k = 1, True, k = k+2, p = 6^n+k; If[PrimeQ[p], q = NextPrime[p]; r = NextPrime[q]; g = q-p; If[g == r-q, Print["n = ", n, " k = ", k, " g = ", g, " ", {p, q, r}]; Return[k]]]]; Table[a[n], {n, 2, 100}] (* _Jean-François Alcover_, Dec 17 2013 *)
%o A233546 (PFGW & SCRIPT)
%o A233546 DIM n,1
%o A233546 DIM i
%o A233546 DIM J
%o A233546 DIM k
%o A233546 DIM pp
%o A233546 DIMS t
%o A233546 OPENFILEOUT myf,a(n).txt
%o A233546 LABEL a
%o A233546 SET n,n+1
%o A233546 IF n>350 THEN END
%o A233546 SET i,-1
%o A233546 SET j,0
%o A233546 SET k,0
%o A233546 LABEL b
%o A233546 SET i,i+2
%o A233546 SETS t,%d,%d,%d,%d\,;n;i;j;k
%o A233546 SET pp,6^n+i
%o A233546 PRP pp,t
%o A233546 IF ISPRP THEN GOTO c
%o A233546 GOTO b
%o A233546 LABEL c
%o A233546 SET j,j+2
%o A233546 SET pp,6^n+i+j
%o A233546 SETS t,%d,%d,%d,%d\,;n;i;j;k
%o A233546 PRP pp,t
%o A233546 IF ISPRP THEN GOTO d
%o A233546 GOTO c
%o A233546 LABEL d
%o A233546 IF j%6==0 THEN GOTO e
%o A233546 SET i,i+j
%o A233546 SET j,0
%o A233546 GOTO c
%o A233546 LABEL e
%o A233546 SET k,k+2
%o A233546 SETS t,%d,%d,%d,%d\,;n;i;j;k
%o A233546 SET pp,6^n+i+j+k
%o A233546 PRP pp,t
%o A233546 IF ISPRP && k==j THEN GOTO h
%o A233546 IF ISPRP THEN GOTO f
%o A233546 GOTO e
%o A233546 LABEL f
%o A233546 IF k%6==0 THEN GOTO g
%o A233546 SET i,i+j+k
%o A233546 SET j,0
%o A233546 SET k,0
%o A233546 GOTO c
%o A233546 LABEL g
%o A233546 SET i,i+j
%o A233546 SET j,k
%o A233546 SET k,0
%o A233546 GOTO e
%o A233546 LABEL h
%o A233546 WRITE myf,t
%o A233546 GOTO a
%Y A233546 Cf. A231576, A231578, A233550, A233742.
%K A233546 nonn
%O A233546 2,1
%A A233546 _Pierre CAMI_, Dec 12 2013