A226836 Squares s such that first m and last m digits of the binary representation are perfect positive squares written in binary, and m = floor(binaryLength(s)/2), where binaryLength(s) = A070939(s) is the binary length of s.
36, 289, 4624, 10404, 115600, 248004, 1083681, 1281424, 2232036, 2509056, 21307456, 23892544, 31494544, 40144896, 66357316, 271359729, 340919296, 479785216, 512026384, 597215844, 767068416, 4831918144, 5454708736, 8126661904, 8522982400, 12273094656, 16705045504
Offset: 1
Programs
-
C
#include
#include 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+(i&1)); if (isSquare(S) && s && isSquare(s)) printf("%llu, ", sq); } return 0; }
Comments