OFFSET
1,1
COMMENTS
The sequence of roots of a(n) begins: 6, 17, 68, 102, 340, 498, 1041, 1132, 1494, 1584, 4616, 4888, 5612, 6336, 8146, 16473, 18464, 21904, 22628, 24438, 27696, 69512, 73856, 90148, 92320, ...
PROG
(C)
#include <stdio.h>
#include <math.h>
typedef unsigned long long U64;
U64 isSquare(U64 a) {
U64 s = sqrt(a);
return (s*s==a);
}
int main() {
U64 i, j, n, sq, s, S;
for (n = 1; n < (1ULL<<20); ++n) {
for (i = 64, j = sq = n*n; j < (1ULL<<63); j += j)
--i; // binary length of sq
j = i >> 1; // Sbs or Ss, binary length of s is j
s = sq & ((1ULL<<j)-1);
S = sq >> (j+(i&1));
if (isSquare(S) && s && isSquare(s)) printf("%llu, ", sq);
}
return 0;
}
CROSSREFS
KEYWORD
nonn,base,less
AUTHOR
Alex Ratushnyak, Jun 19 2013
STATUS
approved