OFFSET
1,3
COMMENTS
Every power of 10 occurs in this sequence.
LINKS
Eric W. Weisstein, MathWorld: Necklace
EXAMPLE
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.
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.
PROG
(PARI){inseq(w)=local(bw, mm, texp, btod, bigb, lbb, swsq, ii);
bw=binary(w);
mm=length(bw); texp=0; btod=0;
forstep(i=mm, 1, -1, btod=btod+bw[i]*10^texp; texp++);
bigb=binary(btod); lbb=length(bigb);
for(k=0, lbb - 1 , swsq=1;
for(j=1, mm, ii=(j+k)%lbb; if(ii==0, ii=lbb);
if(bw[j]!=bigb[ii], swsq=-1));
if(swsq==1, break)
); if(swsq==1, swsq=btod);
return(swsq)}
{ptd=0; for(w=0, 10^9, jj=inseq(w); if(jj>=0, ptd++; print1(jj, ", "); if(ptd>39, break)))}
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Douglas Latimer, May 04 2013
STATUS
approved