OFFSET
0,4
COMMENTS
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.
Note that a(2n) = a(n). - Franklin T. Adams-Watters, Oct 09 2015
LINKS
Anthony Sand, Table of n, a(n) for n = 0..10000
EXAMPLE
n = 11
base = 2
11 mod base = 11 mod 2 = 1
int(11/2) = 5
base + 1 = 3
5 mod base = 5 mod 3 = 2
int(5/3) = 1.
base + 2 = 5
1 mod base = 1 mod 5 = 1
int(1/5) = 0
Therefore incbase(11) = 121 and digsum(11,incbase) = 4.
n = 23
base = 2
23 mod base = 23 mod 2 = 1
int(23/2) = 11
base + 1 = 3
11 mod base = 11 mod 3 = 2
int(11/3) = 3.
base + 2 = 5
3 mod base = 3 mod 5 = 3
int(3/5) = 0
Therefore incbase(23) = 321 and digsum(23,incbase) = 6.
PROG
(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, ", "); );
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Anthony Sand, Aug 15 2015
STATUS
approved