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!)
A235859 Define a(4)=3, then a(n+1) is the smallest prime P such that a(n) <= P < 2*n with 2*n-P=Q prime and, if not possible, a(n+1) is the smallest prime P such that P < a(n) < 2*n with 2*n-P=Q prime. 1
3, 3, 5, 11, 11, 11, 13, 17, 17, 19, 23, 23, 29, 29, 29, 31, 37, 37, 37, 41, 41, 43, 47, 47, 53, 53, 53, 59, 59, 59, 61, 67, 67, 67, 71, 71, 73, 79, 79, 79, 83, 83, 89, 89, 89, 19, 29, 29, 31, 47, 47, 67, 71, 71, 73, 89, 89, 103, 107, 107, 109, 113, 113 (list; graph; refs; listen; history; text; internal format)
OFFSET
4,1
LINKS
EXAMPLE
a(4)=3 as 2*4-3=5 prime by definition
a(5)=3 as 2*5-3=7 prime, a(5)=a(4), a(5)<5
a(6)=5 as 2*6-5=7 prime, a(6)>a(5), a(6)<6
a(7)=5 not possible as 14-5=9 composite
a(7)=7 not possible as 7=7
a(7)=11 as 2*7-11=3 prime
.........................
a(48)=89 as 2*48-89=7 prime
a(49)=89 not possible as 2*49-89=9 composite
a(49)=97 not possible as 2*49-97=unity
a(49)=19 as 19 is the smallest prime such that 2*49-19 is prime
a(50)=29 as 29 is the smallest prime >=19 such that 2*50-29 is prime
PROG
(PFGW & SCRIPT)
SCRIPT
DIM n, 3
DIM i
DIM pp
DIMS t
OPENFILEOUT myf, a(n).txt
LABEL loop1
OPENFILEIN maf, prime.txt
GETNEXT i, maf
GETNEXT i, maf
LABEL a
SET n, n+1
IF n>10005 THEN END
SET pp, 2*n-i
SETS t, %d, %d\,; n; i
PRP pp, t
IF ISPRP THEN GOTO c
LABEL b
GETNEXT i, maf
IF i==n THEN GOTO b
IF 2*n-i<3 THEN GOTO d
SET pp, 2*n-i
SETS t, %d, %d\,; n; i
PRP pp, t
IF ISPRP THEN GOTO c
GOTO b
LABEL c
WRITE myf, t
GOTO a
LABEL d
CLOSEFILE maf
SET n, n-1
GOTO loop1
CROSSREFS
Sequence in context: A132751 A218354 A286514 * A279790 A338847 A032020
KEYWORD
nonn,less
AUTHOR
Pierre CAMI, Jan 16 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 25 07:53 EDT 2024. Contains 371964 sequences. (Running on oeis4.)