Sphenic Numbers by Vim Lover

#include <bits/stdc++.h>
using namespace std;
int main(){
vector<int>p;for(int i=2;i<128;++i){int x=1;for(int n=2;n<i;++n){if(i%n==0){x=0;}}if(x){p.push_back(i);}}
set<int>s;
for(int a=0;a<31;++a){for(int b=0;b<31;++b){for(int c=0;c<31;++c){if(a!=b&&b!=c&&a!=c){s.insert(p[a]*p[b]*p[c]);}}}}
set<int>::iterator t=s.begin();
while(*t<763){cout<<*t<<endl;t++;}}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page