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!)
A283833 For t >= 0, if 2^t + t - 3 <= n <= 2^t + t - 1 then a(n) = 2^t - 1, while if 2^t + t - 1 < n < 2^(t+1) + t - 3 then a(n) = 2^(t+1) + t - 2 - n. 1

%I #18 Dec 09 2017 11:09:54

%S 1,1,1,3,3,3,2,1,7,7,7,6,5,4,3,2,1,15,15,15,14,13,12,11,10,9,8,7,6,5,

%T 4,3,2,1,31,31,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,

%U 13,12,11,10,9,8,7,6,5,4,3,2,1,63,63,63,62,61,60,59,58,57,56,55,54,53,52

%N For t >= 0, if 2^t + t - 3 <= n <= 2^t + t - 1 then a(n) = 2^t - 1, while if 2^t + t - 1 < n < 2^(t+1) + t - 3 then a(n) = 2^(t+1) + t - 2 - n.

%H Michel Marcus, <a href="/A283833/b283833.txt">Table of n, a(n) for n = 0..4104</a>

%H J.-P. Allouche, J. Shallit, <a href="http://arxiv.org/abs/1605.02361">On the subword complexity of the fixed point of a -> aab, b -> b, and generalizations</a>, arXiv preprint arXiv:1605.02361 [math.CO], 2016. See Table 3.

%e 1,1,1;

%e ;

%e 3,3,3;

%e 2,1;

%e 7,7,7;

%e 6,5,4,3,2,1;

%e 15,15,15;

%e 14,13,12,11,10,9,8,7,6,5,4,3,2,1;

%e 31,31,31;

%e 30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,10,9,8,7,6,5,4,3,2,1;

%e 63,63,63;

%e 62,61,60,59,...

%p A283833 := proc(n)

%p local t;

%p if n =0 then

%p return 1;

%p end if;

%p for t from 0 do

%p if 2^t+t-3 <= n and n<= 2^t+t-1 then

%p return 2^t-1 ;

%p elif 2^t+t-1 <= n and n<= 2^(t+1)+t-3 then

%p return 2^(t+1)+t-2-n ;

%p end if;

%p end do:

%p end proc: # _R. J. Mathar_, Mar 28 2017

%t a[0] = 1; a[n_] := For[t = 0, True, t++, Which[2^t + t - 3 <= n && n <= 2^t + t - 1, Return[2^t - 1], 2^t + t - 1 <= n && n <= 2^(t + 1) + t - 3, Return[ 2^(t + 1) + t - 2 - n]]];

%t Table[a[n], {n, 0, 80}] (* _Jean-François Alcover_, Dec 09 2017, from Maple *)

%o (PARI) a(n) = {if (n==0, return (1)); for (t=0, oo, if (((2^t+t-3) <= n) && (n <= 2^t+t-1), return (2^t-1)); if (((2^t+t-1) <= n) && (n <= 2^(t+1)+t-3), return (2^(t+1)+t-2-n)););} \\ _Michel Marcus_, Aug 21 2017

%Y Cf. A145071.

%K nonn

%O 0,4

%A _N. J. A. Sloane_, Mar 24 2017

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 17 20:27 EDT 2024. Contains 371767 sequences. (Running on oeis4.)