OFFSET
1,3
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
FORMULA
a(2n-1) = a(2n).
a(n) = 2*a(ceiling(n/2)) -1 + 2*t(ceiling(n/2)-1) where t(n) = A010060(n) is the Thue-Morse sequence.
MAPLE
A062383 := proc(n)
ceil(log(n)/log(2)) ;
2^% ;
end proc:
A105670 := proc(n)
option remember;
if n = 1 then
1;
else
fn1 := A062383(n) ;
fn := fn1/2 ;
fn1-procname(n-fn) ;
end if;
end proc:
seq(A105670(n), n=1..80) ; # R. J. Mathar, Nov 06 2011
MATHEMATICA
t[0] = 0; t[1] = 1; t[n_?EvenQ] := t[n] = t[n/2]; t[n_?OddQ] := t[n] = 1 - t[(n-1)/2]; a[1] = 1; a[n_?EvenQ] := a[n] = a[n - 1]; a[n_] := a[n] = 2*a[Ceiling[n/2]] - 1 + 2*t[Ceiling[n/2] - 1]; Table[a[n], {n, 1, 71}] (* Jean-François Alcover, Aug 13 2013 *)
PROG
(PARI) b(n, m)=if(n<2, 1, m*m^floor(log(n-1)/log(m))-b(n-m^floor(log(n-1)/log(m)), m))
CROSSREFS
KEYWORD
nonn
AUTHOR
Benoit Cloitre, May 03 2005
EXTENSIONS
Typo in data corrected by Jean-François Alcover, Aug 13 2013
STATUS
approved