Menu

[r376]: / XSPRIME.MPL  Maximize  Restore  History

Download this file

20 lines (14 with data), 302 Bytes

/*
  SEMIPRIME - MPL VERSION
  CONVERTED FROM C
  HTTPS://ROSETTACODE.ORG/WIKI/SEMIPRIME#C
*/

##LIBHDR

SEMIPRIME(N;P,F) [
  F=0; P=2; F<2 && *P<=N @ [ ==(N\P) @ [ N/=P; ++F ]; ++P ];
  F+(N>1)==2
]

.(;I) [
  I=2; I<100 @ [ SEMIPRIME(I) ? WRITEF(" %N",I); ++I ];
  NEWLINE();
0]

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.