cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A181891 Numbers n such that n is the substring identical to the least significant bits of its base 2 representation.

This page as a plain text file.
%I A181891 #31 Jan 15 2018 15:34:27
%S A181891 0,1,10,11,100,101,110,111,1000,1001,1100,1101,10000,10001,10100,
%T A181891 10101,11000,11001,11100,11101,100000,100001,101100,101101,110000,
%U A181891 110001,111100,111101,1000000,1000001,1010000,1010001,1100000,1100001,1110000,1110001
%N A181891 Numbers n such that n is the substring identical to the least significant bits of its base 2 representation.
%C A181891 Terms with odd index, that is, a(1), a(3), a(5), ... are all multiples of 10. Each even-index term is one more than its predecessor, so that a(2n) = a(2n-1) + 1. [_Douglas Latimer_, Apr 26 2013]
%H A181891 Douglas Latimer, <a href="/A181891/b181891.txt">Table of n, a(n) for n = 1..850</a>
%e A181891 The number 11 is represented in the binary system by the string "1011". 11 is a two-digit number, so we consider the 2 least significant bits, which are "11", identical to the string of digits used to represent the number 11. Thus 11 is in the sequence.
%t A181891 fQ[n_] := Module[{d = IntegerDigits[n], len}, len = Length[d]; d == Take[IntegerDigits[n, 2], -len]]; Select[Range[0, 1000000], fQ] (* _T. D. Noe_, Apr 03 2012 *)
%o A181891 (PARI) {for(vv=0,200,bvv=binary(vv);
%o A181891 ll=length(bvv);texp=0;btod=0;
%o A181891 forstep(i=ll,1,-1,btod=btod+bvv[i]*10^texp;texp++);
%o A181891 bigb=binary(btod);lbb=length(bigb);swsq=1;
%o A181891 forstep(j=ll,1,-1,if(bvv[j]!=bigb[lbb],swsq=0);lbb--);
%o A181891 if(swsq==1,print(btod)))}
%Y A181891 This is a subsequence of A038102. Sequence A181929 has similar definition.
%K A181891 nonn,base,easy
%O A181891 1,3
%A A181891 _Douglas Latimer_, Mar 30 2012