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!)
A212955 Least k such that k*30^n-1 and k*30^n+1 are twin primes. 2
1, 7, 19, 44, 52, 19, 8, 77, 82, 40, 14, 140, 44, 119, 592, 217, 272, 744, 737, 536, 1298, 219, 839, 977, 226, 773, 576, 1111, 461, 130, 104, 1152, 2083, 721, 587, 6312, 2126, 489, 331, 6008, 4582, 420, 14, 3951, 432, 2703, 4498, 2219, 1029, 1411, 2392, 3431 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
EXAMPLE
1*30^1-1 = 29 is prime and 1*30^1+1 = 31 is prime. Hence a(1) = 1.
MATHEMATICA
Table[k = 1; While[! PrimeQ[k*30^n + 1] || ! PrimeQ[k*30^n - 1], k++]; k, {n, 60}] (* T. D. Noe, Jun 01 2012 *)
tpk[n_]:=Module[{k=1, c=30^n}, While[!AllTrue[k*c+{1, -1}, PrimeQ], k++]; k]; Array[tpk, 60] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Mar 26 2015 *)
PROG
PFGW64 and SCRIPTIFY from Primeform Group
command : pfgw64 -f in.txt
in.txt file :
SCRIPT
DIM nn, 0
DIM kk, 0
DIMS tt
OPENFILEOUT myfile, a(n).txt
LABEL loopn
SET nn, nn+1
IF nn>270 THEN END
SET kk, 0
LABEL loopk
SET kk, kk+1
SETS tt, %d, %d\,; nn; kk
PRP kk*30^nn-1, tt
IF ISPRP THEN GOTO a
IF ISPRIME THEN GOTO a
GOTO loopk
LABEL a
PRP kk*30^nn+1, tt
IF ISPRP THEN GOTO b
IF ISPRIME THEN GOTO b
GOTO loopk
LABEL b
WRITE myfile, tt
GOTO loopn
CROSSREFS
Sequence in context: A155399 A330854 A268926 * A155415 A155273 A277613
KEYWORD
nonn
AUTHOR
Pierre CAMI, Jun 01 2012
STATUS
approved

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 April 23 12:44 EDT 2024. Contains 371913 sequences. (Running on oeis4.)