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!)
A225237 Numbers n such that n occurs within its base 2 representation regarded as a fixed necklace. 1

%I #15 Aug 28 2013 14:04:13

%S 0,1,10,11,100,101,110,111,1000,1001,1100,1101,1111,10000,10001,10011,

%T 10100,10101,10111,11000,11001,11100,11101,100000,100001,101000,

%U 101010,101100,101101,101111,110000,110001,110101,110110,111011,111100,111101,1000000

%N Numbers n such that n occurs within its base 2 representation regarded as a fixed necklace.

%C Every power of 10 occurs in this sequence.

%H Eric W. Weisstein, <a href="http://mathworld.wolfram.com/Necklace.html">MathWorld: Necklace</a>

%e 10 (in base 10) = 1010 (in base 2). Regarding this base 2 representation as a fixed necklace, we can list characters in the order 1010 by starting with the first character. In this listing 10 occurs ({10}10). Thus 10 is in the sequence.

%e 111011 (in base 10) = 11011000110100011 (in base 2). Regarding this base 2 representation as a fixed necklace, we can list characters in the order 11110110001101000 by starting with the characters "11" at the end of the base 2 representation. In this listing 111011 occurs (1{111011}0001101000). Thus 111011 is in the sequence.

%o (PARI){inseq(w)=local(bw,mm,texp,btod,bigb,lbb,swsq,ii);

%o bw=binary(w);

%o mm=length(bw); texp=0; btod=0;

%o forstep(i=mm, 1, -1, btod=btod+bw[i]*10^texp; texp++);

%o bigb=binary(btod); lbb=length(bigb);

%o for(k=0, lbb - 1 , swsq=1;

%o for(j=1, mm, ii=(j+k)%lbb; if(ii==0, ii=lbb);

%o if(bw[j]!=bigb[ii], swsq=-1));

%o if(swsq==1, break)

%o ); if(swsq==1,swsq=btod);

%o return(swsq)}

%o {ptd=0; for(w=0, 10^9, jj=inseq(w); if(jj>=0, ptd++; print1(jj,", "); if(ptd>39,break)))}

%Y A038102 is a subsequence of this. For the terms of the sequence not found in A038102, see A225238.

%K nonn,base

%O 1,3

%A _Douglas Latimer_, May 04 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 23 08:33 EDT 2024. Contains 371905 sequences. (Running on oeis4.)