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!)
A103688 a(n) = n if A103689(n)*n +/- 1 are twin primes; a(n) = 0 otherwise. 1
0, 0, 0, 4, 0, 6, 0, 0, 9, 0, 0, 12, 0, 0, 15, 0, 0, 18, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 0, 0, 0, 0, 47, 0, 0, 0, 51, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, 0, 69, 0, 0, 72, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,4
LINKS
EXAMPLE
For n=5 2*5-1=9 is not prime, 2*5+1=11 is prime so a(5)=0.
For n=6 1*6-1=5 is prime, 1*6+1=7 is prime, 5 and 7 are twin primes so a(6)=6.
MATHEMATICA
lktp[n_]:=Module[{k=1}, While[NoneTrue[k*n+{1, -1}, PrimeQ], k++]; If[AllTrue[k*n+{1, -1}, PrimeQ], n, 0]]; Array[lktp, 100] (* The program uses the functions NoneTrue and AllTrue from Mathematica version 10 *) (* Harvey P. Dale, Sep 09 2014 *)
PROG
(PARI)
a(n)=k=1; while(!isprime(k*n+1)&&!isprime(k*n-1), k++); k
for(n=1, 100, if(isprime(a(n)*n+1)&&isprime(a(n)*n-1), print1(n, ", ")); print1(0, ", ")) \\ Derek Orr, Sep 09 2014
CROSSREFS
Cf. A103689.
Sequence in context: A126813 A056141 A246004 * A125961 A016681 A210625
KEYWORD
easy,nonn
AUTHOR
Pierre CAMI, Feb 12 2005
EXTENSIONS
Corrected by Harvey P. Dale, Sep 09 2014
Definition simplified by Derek Orr, Sep 09 2014
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 24 22:17 EDT 2024. Contains 371964 sequences. (Running on oeis4.)