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.

A235649 Define a(4)=3 then a(n+1)is the smallest prime P such that a(n)<=P< n with 2*n-P=Q prime and if not possible a(n+1) is the smallest prime P such that P with 2*n-P=Q prime.

This page as a plain text file.
%I A235649 #14 Jul 23 2025 08:41:49
%S A235649 3,3,5,3,3,5,7,3,5,7,11,11,13,3,5,7,11,11,13,17,17,19,23,23,3,5,7,19,
%T A235649 23,23,31,3,5,7,17,17,19,23,23,3,5,7,13,23,23,31,41,41,43,47,47,3,3,5,
%U A235649 7,11,11,13,17,17,19,23,23,31,47,59,61,3,5,7,11
%N A235649 Define a(4)=3 then a(n+1)is the smallest prime P such that a(n)<=P< n with 2*n-P=Q prime and if not possible a(n+1) is the smallest prime P such that P<a(n)<n with 2*n-P=Q prime.
%H A235649 Pierre CAMI, <a href="/A235649/b235649.txt">Table of n, a(n) for n = 4..10005</a>
%e A235649 a(4)=3 as 2*4-3=5 prime by definition
%e A235649 a(5)=3 as 2*5-3=7 prime, a(5)=a(4), a(5)<5
%e A235649 a(6)=5 as 2*6-5=7 prime, a(6)>a(5), a(6)<6
%e A235649 a(7)=5 not possible as 14-5=9 composite
%e A235649 a(7)=7 not possible as 7=7
%e A235649 a(7)=3 as 2*7-3=11 prime
%e A235649 a(8)=3 as 2*8-3=13 prime
%o A235649 (PFGW & SCRIPT)
%o A235649 SCRIPT
%o A235649 DIM n,3
%o A235649 DIM i
%o A235649 DIM pp
%o A235649 DIMS t
%o A235649 OPENFILEOUT myf,a(n).txt
%o A235649 LABEL loop1
%o A235649 OPENFILEIN maf,prime.txt
%o A235649 GETNEXT i,maf
%o A235649 GETNEXT i,maf
%o A235649 LABEL a
%o A235649 SET n,n+1
%o A235649 IF n>10005 THEN END
%o A235649 SET pp,2*n-i
%o A235649 SETS t,%d,%d\,;n;i
%o A235649 PRP pp,t
%o A235649 IF ISPRP THEN GOTO c
%o A235649 LABEL b
%o A235649 GETNEXT i,maf
%o A235649 IF n-i<3 THEN GOTO d
%o A235649 SET pp,2*n-i
%o A235649 SETS t,%d,%d\,;n;i
%o A235649 PRP pp,t
%o A235649 IF ISPRP THEN GOTO c
%o A235649 GOTO b
%o A235649 LABEL c
%o A235649 WRITE myf,t
%o A235649 GOTO a
%o A235649 LABEL d
%o A235649 CLOSEFILE maf
%o A235649 SET n,n-1
%o A235649 GOTO loop1
%Y A235649 Cf. A002373, A020483
%K A235649 nonn
%O A235649 4,1
%A A235649 _Pierre CAMI_, Jan 13 2014