OFFSET
1,2
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
EXAMPLE
If n=3, we can get 3 from base 10 (or any other base except 3) and 1 from reversing the base-3 expansion 10, so a(3) = 3+1 = 4.
MATHEMATICA
rev[x_, b_]:=FromDigits[Reverse[IntegerDigits[x, b]], b]; Total/@Union/@Table[Table[rev[x, b], {b, 2, x+1}], {x, Startpoint, Endpoint}]
PROG
(PARI) rev(n, B)=my(m=n%B); n\=B; while(n>0, m=m*B+n%B; n\=B); m
a(n)=if(n<3, 2*n-1, my(v=vecsort(vector(n-1, k, rev(n, k+1)), , 8)); sum(i=1, #v, v[i])) \\ Charles R Greathouse IV, Aug 05 2012
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Dylan Hamilton, Jun 26 2012
STATUS
approved