OFFSET
1,1
EXAMPLE
50 in base 2 is 110010. If we take 110010 = concat(1100,10) then 1100 and 10 converted to base 10 are 12 and 2. Finally 12*13/2 - sigma(12) + 2*3/2 - sigma(2) = 78 - 28 + 3 - 3 = 50.
179 in base 2 is 1001101. If we take 1001101 = concat(11100,1) then 11100 and 1 converted to base 10 are 5 and 19. Finally 5*6/2 - sigma(5) + 19*20/2 - sigma(19) = 15 - 6 + 190 - 20 = 179.
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 a*(a+1)/2-sigma(a)+b*(b+1)/2-sigma(b)=n then print(n);
break; fi; fi; od; od; end: P(10^9);
MATHEMATICA
f[n_] := Block[{d = IntegerDigits[n, 2], len = IntegerLength[n, 2], k}, ReplaceAll[Reap[Do[k = {FromDigits[Take[d, i], 2], FromDigits[Take[d, -(len - i)], 2]}; If[! MemberQ[k, 0], Sow@ k], {i, 1, len - 1}]], {} -> {1}][[-1, 1]]]; Select[Range@ 100000, MemberQ[Total /@ (# (# + 1)/2 - DivisorSigma[1, #] &) /@ f@ #, #] &] (* Michael De Vlieger, Jul 03 2015 *)
CROSSREFS
KEYWORD
nonn,base,more
AUTHOR
Paolo P. Lava, Jul 03 2015
STATUS
approved