OFFSET
1,1
COMMENTS
Obviously all terms are squares.
The terms that have b=1 are: 9, 49, 225, 961, 3969, 16129, 65025, ...; see A060867 ((2^n-1)^2). - Michel Marcus, Jun 13 2015
EXAMPLE
9 in base 2 is 1001. If we take 1001 = concat(10,01) then 10 and 01 converted to base 10 are 2 and 1. Finally (2 + 1)^2 = 3^2 = 9;
36 in base 2 is 100100. If we take 100100 = concat(10,0100) then 10 and 0100 converted to base 10 are 2 and 4. Finally (2 + 4)^2 = 6^2 = 36.
MAPLE
with(numtheory): P:=proc(q) local a, b, c, k, n;
for n from 1 to q do c:=convert(n, binary, decimal);
for k from 1 to ilog10(c) do
a:=convert(trunc(c/10^k), decimal, binary);
b:=convert((c mod 10^k), decimal, binary);
if a*b>0 then if (a+b)^2=n then print(n); break;
fi; fi; od; od; end: P(10^6);
PROG
(PARI) isok(n) = {b = binary(n); if (#b > 1, for (k=1, #b-1, vba = Vecrev(vector(k, i, b[i])); vbb = Vecrev(vector(#b-k, i, b[k+i])); da = sum(i=1, #vba, vba[i]*2^(i-1)); db = sum(i=1, #vbb, vbb[i]*2^(i-1)); if ((da+ db)^2 == n, return(1)); ); ); } \\ Michel Marcus, Jun 13 2015
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Paolo P. Lava, Jun 12 2015
STATUS
approved