OFFSET
0,2
COMMENTS
The sequence takes two different binary numbers, n1 and n2, and simultaneously adds the digit sum of n1 to n2 and the digit sum of n2 to n1. This process continues until n1 = n2. The two numbers are initialized with n1 = 2^(n-1) and n2 = 0.
FORMULA
n1(i) = n1(i-1) + digsum(n2(i-1),base=2), n2(i) = n2(i-1) + digsum(n1(i-1),base=2)
EXAMPLE
In base 2: 1000 > 0, 1000 > 1, 1001 > 10, 1010 > 100, 1011 > 110, 11111 > 1100, 10001 > 10000, 10010 = 10010
In base 10: 8 > 0, 8 > 1, 9 > 2, 10 > 4, 11 > 6, 13 > 9, 15 > 12, 17 > 16, 18 = 18
PROG
(PARI) digsum(num) = d=digits(num, 2); return(sum(i=1, #d, d[i]));
doubledigsum() = b=2; nnx=5; for(n=1, amx, n1=b^(n-1); n2=0; c=0; until(n1==n2, s1=digsum(n1); s2=digsum(n2); n1+=s2; n2+=s1; c++); print1(c, ", "); );
CROSSREFS
KEYWORD
nonn,base,more
AUTHOR
Anthony Sand, Apr 23 2016
STATUS
approved