OFFSET
1,1
LINKS
Paolo P. Lava, Table of n, a(n) for n = 1..80
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 sigma(2) + sigma(1) = sigma(9) - 9 = 4.
180953 in base 2 is 101100001011011001. If we take 101100001011011001 = concat(101100001011,011001) then 101100001011 and 011001 converted to base 10 are 2827 and 25. Finally sigma(2827) + sigma(25) = sigma(180953) - 180953 = 3127.
MAPLE
with(numtheory): P:=proc(q) local a, b, c, j, k, n;
for n from 1 to q do c:=convert(n, binary, decimal);
j:=0; 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 sigma(a)+sigma(b)=sigma(n)-n then print(n);
break; fi; fi; od; od; end: P(10^9);
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 && (sigma(da)+sigma(db) == sigma(n)-n), return(1)); ); ); } \\ Michel Marcus, Jun 13 2015
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Paolo P. Lava, Jun 11 2015
STATUS
approved