login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A233546 Smallest k such that 6^n+k, 6^n+k+g, 6^n+k+2*g are consecutive primes in arithmetic progression. 4

%I #32 Dec 17 2013 06:20:11

%S 11,35,65,41,221,655,515,263,4265,893,4085,1031,3161,145,821,2083,

%T 2101,433,3743,2243,511,2623,5653,271,2885,4157,18023,9023,1151,4787,

%U 737,2141,2833,6181,3217,3635,715,4501,5381,4231,13265,823

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

%C The sequence starts at n=2 as there is no solution for n=1.

%C The primes are probable primes for n>23.

%H Pierre CAMI, <a href="/A233546/b233546.txt">Table of n, a(n) for n = 2..350</a>

%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Primes_in_arithmetic_progression#Consecutive_primes_in_arithmetic_progression">Consecutive primes in arithmetic progression</a>

%e 6^2+11=47, 6^2+11+6=53, 6^2+11+2*6=59 and 47, 53, 59 are consecutive primes

%e 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 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 (PFGW & SCRIPT)

%o DIM n,1

%o DIM i

%o DIM J

%o DIM k

%o DIM pp

%o DIMS t

%o OPENFILEOUT myf,a(n).txt

%o LABEL a

%o SET n,n+1

%o IF n>350 THEN END

%o SET i,-1

%o SET j,0

%o SET k,0

%o LABEL b

%o SET i,i+2

%o SETS t,%d,%d,%d,%d\,;n;i;j;k

%o SET pp,6^n+i

%o PRP pp,t

%o IF ISPRP THEN GOTO c

%o GOTO b

%o LABEL c

%o SET j,j+2

%o SET pp,6^n+i+j

%o SETS t,%d,%d,%d,%d\,;n;i;j;k

%o PRP pp,t

%o IF ISPRP THEN GOTO d

%o GOTO c

%o LABEL d

%o IF j%6==0 THEN GOTO e

%o SET i,i+j

%o SET j,0

%o GOTO c

%o LABEL e

%o SET k,k+2

%o SETS t,%d,%d,%d,%d\,;n;i;j;k

%o SET pp,6^n+i+j+k

%o PRP pp,t

%o IF ISPRP && k==j THEN GOTO h

%o IF ISPRP THEN GOTO f

%o GOTO e

%o LABEL f

%o IF k%6==0 THEN GOTO g

%o SET i,i+j+k

%o SET j,0

%o SET k,0

%o GOTO c

%o LABEL g

%o SET i,i+j

%o SET j,k

%o SET k,0

%o GOTO e

%o LABEL h

%o WRITE myf,t

%o GOTO a

%Y Cf. A231576, A231578, A233550, A233742.

%K nonn

%O 2,1

%A _Pierre CAMI_, Dec 12 2013

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 11 01:05 EDT 2024. Contains 375059 sequences. (Running on oeis4.)