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.

A080941 Greatest proper divisor of n which is a suffix of n in binary representation; a(n) = 0 if no such divisor exists.

This page as a plain text file.
%I A080941 #7 Mar 27 2014 18:18:15
%S A080941 0,0,1,0,1,2,1,0,1,2,1,4,1,2,3,0,1,2,1,4,1,2,1,8,1,2,3,4,1,6,1,0,1,2,
%T A080941 1,4,1,2,3,8,1,2,1,4,5,2,1,16,1,2,3,4,1,6,1,8,1,2,1,12,1,2,7,0,1,2,1,
%U A080941 4,1,2,1,8,1,2,3,4,1,6,1,16,1,2,1,4,5,2,3,8,1,10,1,4,1,2,1,32,1,2,3,4,1,6,1
%N A080941 Greatest proper divisor of n which is a suffix of n in binary representation; a(n) = 0 if no such divisor exists.
%C A080941 a(n)=0 iff n=2^k (A000079);
%H A080941 Reinhard Zumkeller, <a href="/A080941/b080941.txt">Table of n, a(n) for n = 1..10000</a>
%e A080941 n=30='11110', divisors<30: 1='1', 2='10', 3='11', 5='101', 6='110', 10='1010' and 15='1111', therefore a(30)=2='10';
%e A080941 n=31='11111', divisors<31: 1='1', therefore a(31)=1;
%e A080941 n=32='100000', divisors<32: 1='1', 2='10', 4='100', 8='1000' and 16='10000', therefore a(32)=0.
%o A080941 (Haskell)
%o A080941 import Data.List (isPrefixOf); import Data.Function (on)
%o A080941 a080941 n = if null ds then 0 else head ds  where
%o A080941             ds = filter ((flip isPrefixOf `on` a030308_row) n) $
%o A080941                         reverse $ a027751_row n
%o A080941 -- _Reinhard Zumkeller_, Mar 27 2014
%Y A080941 Cf. A007088, A080940, A080942.
%Y A080941 Cf. A030308, A027751.
%K A080941 nonn,base
%O A080941 1,6
%A A080941 _Reinhard Zumkeller_, Feb 25 2003
%E A080941 Definition improved by _Reinhard Zumkeller_, Mar 27 2014