Retina 0.8.2, 53 bytes
^
;
+%`;(.)
1ドル;$'¶$`;
.+
$*
%A`^.?$|^(..+)1円+$
^1+¶+$
Try it online! Link includes test cases. Explanation:
^
;
+%`;(.)
1ドル;$'¶$`;
Generate all subsequences of the input.
.+
$*
Convert then to unary.
%A`^.?$|^(..+)1円+$
Delete the ones that arearen't prime, but don't delete the newlines. (A multiline replace also works, but is harder to format an explanation for.)
^1+¶+$
Check that the original input was prime but none of the proper subsequences were.
Retina 0.8.2, 53 bytes
^
;
+%`;(.)
1ドル;$'¶$`;
.+
$*
%A`^.?$|^(..+)1円+$
^1+¶+$
Try it online! Link includes test cases. Explanation:
^
;
+%`;(.)
1ドル;$'¶$`;
Generate all subsequences of the input.
.+
$*
Convert then to unary.
%A`^.?$|^(..+)1円+$
Delete the ones that are prime, but don't delete the newlines. (A multiline replace also works, but is harder to format an explanation for.)
^1+¶+$
Check that the original input was prime but none of the proper subsequences were.
Retina 0.8.2, 53 bytes
^
;
+%`;(.)
1ドル;$'¶$`;
.+
$*
%A`^.?$|^(..+)1円+$
^1+¶+$
Try it online! Link includes test cases. Explanation:
^
;
+%`;(.)
1ドル;$'¶$`;
Generate all subsequences of the input.
.+
$*
Convert then to unary.
%A`^.?$|^(..+)1円+$
Delete the ones that aren't prime, but don't delete the newlines. (A multiline replace also works, but is harder to format an explanation for.)
^1+¶+$
Check that the original input was prime but none of the proper subsequences were.
Retina 0.8.2, 53 bytes
^
;
+%`;(.)
1ドル;$'¶$`;
.+
$*
%A`^.?$|^(..+)1円+$
^1+¶+$
Try it online! Link includes test cases. Explanation:
^
;
+%`;(.)
1ドル;$'¶$`;
Generate all subsequences of the input.
.+
$*
Convert then to unary.
%A`^.?$|^(..+)1円+$
Delete the ones that are prime, but don't delete the newlines. (A multiline replace also works, but is harder to format an explanation for.)
^1+¶+$
Check that the original input was prime but none of the proper subsequences were.