OFFSET
1,2
LINKS
Harry J. Smith, Table of n, a(n) for n = 1..50
FORMULA
a(n) = a(n-1) * 2^n if n is even, (a(n-1) + 1) * 2^n - 1 if n is odd. - Franklin T. Adams-Watters, Sep 18 2012
EXAMPLE
a(5) = 19999 is formed by appending 1 five times (11111) to a(4) in base 2: 100111000011111.
MAPLE
a:= proc(n) option remember; `if`(n=1, 1,
(t-> (a(n-1)+t)*2^n-t)(irem(n, 2)))
end:
seq(a(n), n=1..17); # Alois P. Heinz, Mar 08 2024
MATHEMATICA
With[{nn=20}, Table[FromDigits[Flatten[Take[Table[Table[If[EvenQ[n], 0, 1], {n}], {n, nn}], j]], 2], {j, nn}]] (* Harvey P. Dale, Sep 09 2012 *)
PROG
(PARI) baseI(x, b)= { local(d, e=0, f=1); while (x>0, d=x-10*(x\10); x\=10; e+=d*f; f*=b); return(e) } { c=1; for (n=1, 50, if (n==1, a=1; b=1, c=c*10 + 1; if (n%2, d=c, d=0); b=b*10^n + d; a=baseI(b, 2)); write("b065760.txt", n, " ", a) ) } \\ Harry J. Smith, Oct 30 2009
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Lior Manor, Nov 18 2001
STATUS
approved