Post Reply 
(39gs) OEIS A110743 Smallest prime beginning with n reversed
10-04-2017, 01:56 PM
Post: #1
(39gs) OEIS A110743 Smallest prime beginning with n reversed
The prograqmme A110743 takes natural number input N from Ans & returns the Nth member of the sequence

https://oeis.org/A110743

The programme uses two sub-programmes, REVN reverses the digits of input & is available here

http://www.hpmuseum.org/forum/thread-9223.html

& PRIM tests its argument for primality & can be found here

http://www.hpmuseum.org/forum/thread-655...light=39gs

Code:
RUN REVN:
Ans►O:
RUN PRIM:
IF  Ans
THEN
O:
ELSE
FOR D=1 TO 6;
O*10►O:
FOR R=1 TO 10^D-1 STEP 2; 
O+R►S:
RUN PRIM:
IF Ans
THEN
10^D►R:
6►D:
ELSE
IF R MOD 5==3
THEN
R+2►R:
END:
END:
NEXT:
NEXT:
S:
END:
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)