OFFSET
0,3
LINKS
Harry J. Smith, Table of n, a(n) for n = 0..1000
Hsien-Kuei Hwang, Svante Janson, and Tsung-Hsi Tsai, Identities and periodic oscillations of divide-and-conquer recurrences splitting at half, arXiv:2210.10968 [cs.DS], 2022, p. 45.
FORMULA
a(n) = a(n-2^floor(log_2(n))) + 20^floor(log_2(n)). a(2n) = 20*a(n); a(2n+1) = a(2n)+1 = 20*a(n)+1.
G.f.: (1/(1 - x))*Sum_{k>=0} 20^k*x^(2^k)/(1 + x^(2^k)). - Ilya Gutkovskiy, Jun 04 2017
EXAMPLE
a(5) = 401 since 5 written in base 2 is 101 so a(5) = 1*20^2 + 0*20^1 + 1*20^0 = 400 + 0 + 1 = 401.
MATHEMATICA
Table[FromDigits[IntegerDigits[n, 2], 20], {n, 0, 40}] (* Harvey P. Dale, Jul 21 2014 *)
PROG
(PARI) baseE(x, b)= { local(d, e, f); e=0; f=1; while (x>0, d=x-b*(x\b); x\=b; e+=d*f; f*=10); return(e) } baseI(x, b)= { local(d, e, f); e=0; f=1; while (x>0, d=x-10*(x\10); x\=10; e+=d*f; f*=b); return(e) } { for (n=0, 1000, write("b063012.txt", n, " ", baseI(baseE(n, 2), 20)) ) } \\ Harry J. Smith, Aug 15 2009
CROSSREFS
KEYWORD
easy,nonn,base
AUTHOR
Henry Bottomley, Jul 04 2001
EXTENSIONS
Edited by Charles R Greathouse IV, Aug 02 2010
STATUS
approved