|
!'3779:素数 3779 7793 7937 9377
LET KMAX=10000
DIM A(KMAX)
LET A(1)=1
FOR I=2 TO KMAX
IF A(I)=0 THEN
FOR J=I*I TO KMAX STEP I
LET A(J)=1
NEXT J
END IF
NEXT I
FOR I=11 TO KMAX
IF A(I)=0 THEN
LET S$=STR$(I)
LET N=LEN(S$)
LET FL=0
FOR J=1 TO N-1
LET S$=S$(2:N)&S$(1:1) !'回転
LET L=VAL(S$)
IF A(L)<>0 THEN
LET FL=1
EXIT FOR
END IF
NEXT J
IF FL=0 THEN
PRINT I
LET A(I)=1
END IF
END IF
NEXT I
END
|
|