login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Digit-sums in an incremental base that adjusts itself as the digits of n are generated from right to left.
1

%I #24 Oct 10 2015 14:28:30

%S 0,1,1,2,1,3,2,2,1,3,3,4,2,3,2,4,1,5,3,2,3,5,4,6,2,3,3,3,2,7,4,4,1,4,

%T 5,4,3,3,2,5,3,5,5,4,4,6,6,6,2,5,3,4,3,7,3,2,2,5,7,8,4,5,4,6,1,5,4,6,

%U 5,7,4,6,3,3,3,5,2,7,5,3,3,6,5,8,5,7,4

%N Digit-sums in an incremental base that adjusts itself as the digits of n are generated from right to left.

%C In a standard base, the digits are generated from right to left by finding (n modulo base) and dividing by the base, until n = 0. In this incremental base, the base is first set equal to 2, then increases according to the digits generated by (n modulo base). For example, 5 = 21 in this base because 5 mod 2 = 1, int(5/2) = 2, 2 mod (2+1 = 3) = 2 and int(2/3) = 0. When n is a power of 2, the base remains 2 throughout, because all digits generated from right to left are 0 until the final digit.

%C Note that a(2n) = a(n). - _Franklin T. Adams-Watters_, Oct 09 2015

%H Anthony Sand, <a href="/A261337/b261337.txt">Table of n, a(n) for n = 0..10000</a>

%e n = 11

%e base = 2

%e 11 mod base = 11 mod 2 = 1

%e int(11/2) = 5

%e base + 1 = 3

%e 5 mod base = 5 mod 3 = 2

%e int(5/3) = 1.

%e base + 2 = 5

%e 1 mod base = 1 mod 5 = 1

%e int(1/5) = 0

%e Therefore incbase(11) = 121 and digsum(11,incbase) = 4.

%e n = 23

%e base = 2

%e 23 mod base = 23 mod 2 = 1

%e int(23/2) = 11

%e base + 1 = 3

%e 11 mod base = 11 mod 3 = 2

%e int(11/3) = 3.

%e base + 2 = 5

%e 3 mod base = 3 mod 5 = 3

%e int(3/5) = 0

%e Therefore incbase(23) = 321 and digsum(23,incbase) = 6.

%o (PARI) n=0; nmx=1000; d=vector(20); bs=vector(20); while(n < nmx, n++; b=2; nn=n; di=0; while(nn>0, di++; d[di] = nn % b; nn \= b; b += d[di]; ); s = sum(i=1,di,d[i]); print1(s,", "); );

%Y Cf. A108731.

%K nonn,base

%O 0,4

%A _Anthony Sand_, Aug 15 2015