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.
%I A080940 #27 Apr 25 2025 18:34:42 %S A080940 0,0,1,0,1,2,1,0,1,2,1,4,1,2,1,0,1,2,1,4,1,2,1,8,1,2,1,4,1,2,1,0,1,2, %T A080940 1,4,1,2,1,8,1,2,1,4,1,2,1,16,1,2,1,4,1,2,1,8,1,2,1,4,1,2,1,0,1,2,1,4, %U A080940 1,2,1,8,1,2,1,4,1,2,1,16,1,2,1,4,1,2,1,8,1,2,1,4,1,2,1,32,1,2,1,4,1,2,1,8 %N A080940 Smallest proper divisor of n which is a suffix of n in binary representation; a(n) = 0 if no such divisor exists. %C A080940 By definition, identical to A006519 except that a(2^k) = 0 for all k. %C A080940 a(3*2^k)=2^k and a(m)<2^k for m<3*2^k (see A007283). %C A080940 Also, the first repeating value of the periodic sequences created by 2^k mod n. - _Alison J. McCrea_, Apr 13 2025 %H A080940 Reinhard Zumkeller, <a href="/A080940/b080940.txt">Table of n, a(n) for n = 1..10000</a> %e A080940 n=6='110', divisors<6: 1='1', 2='10' and 3='11', therefore a(6)=2='10'; %e A080940 n=7='111', divisors<7: 1='1', therefore a(7)=1; %e A080940 n=8='1000', divisors<8: 1='1', 2='10' and 4='100', therefore a(8)=0. %o A080940 (Haskell) %o A080940 import Data.List (isPrefixOf); import Data.Function (on) %o A080940 a080940 n = if null ds then 0 else head ds where %o A080940 ds = filter ((flip isPrefixOf `on` a030308_row) n) $ %o A080940 a027751_row n %o A080940 -- _Reinhard Zumkeller_, Mar 27 2014 %o A080940 (Python) %o A080940 def A080940(n): return (m:=n&-n)*(m!=n) # _Chai Wah Wu_, Jun 20 2023 %Y A080940 Cf. A007088, A000079, A080941, A080942, A006519. %Y A080940 Cf. A030308, A027751. %K A080940 nonn,base,easy %O A080940 1,6 %A A080940 _Reinhard Zumkeller_, Feb 25 2003 %E A080940 Definition improved by _Reinhard Zumkeller_, Mar 27 2014