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.

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

Original entry on oeis.org

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, 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, 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
Offset: 1

Views

Author

Reinhard Zumkeller, Feb 25 2003

Keywords

Comments

By definition, identical to A006519 except that a(2^k) = 0 for all k.
a(3*2^k)=2^k and a(m)<2^k for m<3*2^k (see A007283).
Also, the first repeating value of the periodic sequences created by 2^k mod n. - Alison J. McCrea, Apr 13 2025

Examples

			n=6='110', divisors<6: 1='1', 2='10' and 3='11', therefore a(6)=2='10';
n=7='111', divisors<7: 1='1', therefore a(7)=1;
n=8='1000', divisors<8: 1='1', 2='10' and 4='100', therefore a(8)=0.
		

Crossrefs

Programs

  • Haskell
    import Data.List (isPrefixOf); import Data.Function (on)
    a080940 n = if null ds then 0 else head ds  where
                ds = filter ((flip isPrefixOf `on` a030308_row) n) $
                            a027751_row n
    -- Reinhard Zumkeller, Mar 27 2014
    
  • Python
    def A080940(n): return (m:=n&-n)*(m!=n) # Chai Wah Wu, Jun 20 2023

Extensions

Definition improved by Reinhard Zumkeller, Mar 27 2014