#include<string.h>#include<stdio.h>#include<cstdio>#include<iostream>#include<string>#include<cmath>typedeflonglong ll;usingnamespace std;constint m =1e6+1;int a[m], ans[m];intmain(){memset(a,0,sizeof(a));for(int i =5; i <= m; i +=4){for(int j =5; j <= m; j +=4){if(i * j > m)break;if(!a[i]&&!a[j]){
a[i * j]=1;}else
a[i * j]=-1;}}int cnt =0;for(int i =25; i <= m; i++){if(a[i]==1) cnt++;
ans[i]= cnt;}int n;while(~scanf("%d",&n)&& n){printf("%d %d\n", n, ans[n]);}return0;}
H-number:4n+1H-prime:能分解成两个H-number的乘积,1×h,有且仅有这一种方式H-semi-prime:两个H-prime的乘积直接暴力打表.#include <string.h>#include <stdio.h>#include <cstdio>#include <iostream>#include <string>#include <cmath>typedef long long .