Hi again,

I got curious about such bases. So I quickly wrote a little C program to find such. The program finds 12 such bases less than 10000, the last being 9473. I was mildly surprised that so many exist. I used floating point arithmetic to test if a given integer is a perfect square. This in general is not a good idea, but for "small" integers it's okay. Here's the code, if you're interested:

Code:

#include <stdio.h>
#include <math.h>
#define MAX 10000
int isPrime(int p);
int main() {
int b=11,s,numberFound=0;
double x;
while (b<=MAX) {
if (b%3==0) {
b+=2;
continue;
}
if (!isPrime(b+6)) {
b+=2;
continue;
}
x=sqrt(9*b+7);
s=(int)floor(x);
if (s*s==9*b+7) {
printf("base is %d, prime is %d. square is %d = %d squared\n",
b,b+6,9*b+7,(int)x);
numberFound++;
}
b+=2;
}
printf("%d bases found <= %d\n",numberFound,MAX);
return(0);
}
/* Returns 1 (true) iff p is prime. Upon entry, p is odd. If p is not prime and d is the smallest proper
divisor of p, clearly d*d<=p.
*/
int isPrime(int p) {
int d=3;
while (d*d<=p) {
if (p%d==0) {
return(0);
}
d+=2;
}
return(1);
}