login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A105670 a(1)=1 then bracketing n by powers of 2 as f(t)=2^t for f(t) < n <= f(t+1), a(n) = f(t+1) - a(n-f(t)). 5

%I #20 Jun 14 2019 00:29:07

%S 1,1,3,3,7,7,5,5,15,15,13,13,9,9,11,11,31,31,29,29,25,25,27,27,17,17,

%T 19,19,23,23,21,21,63,63,61,61,57,57,59,59,49,49,51,51,55,55,53,53,33,

%U 33,35,35,39,39,37,37,47,47,45,45,41,41,43,43,127,127,125,125,121,121,123

%N a(1)=1 then bracketing n by powers of 2 as f(t)=2^t for f(t) < n <= f(t+1), a(n) = f(t+1) - a(n-f(t)).

%H Vincenzo Librandi, <a href="/A105670/b105670.txt">Table of n, a(n) for n = 1..1000</a>

%F a(2n-1) = a(2n).

%F a(n) = 2*a(ceiling(n/2)) -1 + 2*t(ceiling(n/2)-1) where t(n) = A010060(n) is the Thue-Morse sequence.

%p A062383 := proc(n)

%p ceil(log(n)/log(2)) ;

%p 2^% ;

%p end proc:

%p A105670 := proc(n)

%p option remember;

%p if n = 1 then

%p 1;

%p else

%p fn1 := A062383(n) ;

%p fn := fn1/2 ;

%p fn1-procname(n-fn) ;

%p end if;

%p end proc:

%p seq(A105670(n),n=1..80) ; # _R. J. Mathar_, Nov 06 2011

%t 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 *)

%o (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))

%Y Cf. A105669, A105672, A093347, A093348.

%K nonn

%O 1,3

%A _Benoit Cloitre_, May 03 2005

%E Typo in data corrected by _Jean-François Alcover_, Aug 13 2013

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 10:49 EDT 2024. Contains 371935 sequences. (Running on oeis4.)