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.

A063982 Number of divisors of 2^n - 1 that are relatively prime to 2^m - 1 for all 0 < m < n.

Original entry on oeis.org

1, 2, 2, 2, 2, 1, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 4, 2, 2, 4, 8, 2, 2, 2, 2, 2, 4, 4, 4, 2, 4, 2, 4, 2, 8, 4, 4, 2, 8, 4, 2, 4, 8, 8, 8, 2, 8, 2, 4, 4, 4, 4, 2, 2, 4, 4, 2, 4, 4, 8, 2, 4, 8, 4, 8, 4, 4, 8, 2, 2, 8, 2, 8, 4, 4, 4, 2, 2, 4, 4, 2, 2, 8, 16, 2, 4, 8, 4, 4, 2, 8, 8
Offset: 1

Views

Author

Vladeta Jovovic, Sep 06 2001

Keywords

Comments

a(364) = 24 is the first term not a power of 2. - Jianing Song, Apr 29 2018
a(n) is the number of divisors of A064078(n). - Jianing Song, Apr 20 2019

Examples

			Divisors of 2^8-1 are {1, 3, 5, 15, 17, 51, 85, 255}, but only 1 and 17 are relatively prime to 2^m - 1 for all m < 8, thus a(8)=2.
		

Crossrefs

Programs

  • Haskell
    a063982 n = a063982_list !! (n-1)
    a063982_list = f [] $ tail a000225_list where
       f us (v:vs) = (length ds) : f (v:us) vs where
         ds = [d | d <- a027750_row v, all ((== 1). (gcd d)) us]
    -- Reinhard Zumkeller, Jan 04 2013
    
  • Mathematica
    a = {1}; Do[ d = Divisors[2^n - 1]; l = Length[d]; c = 0; k = 1; While[ k < l + 1, If[ Union[ GCD[a, d[[k]] ]] == {1}, c++ ]; k++ ]; Print[c]; a = Union[ Flatten[ Append[a, Transpose[ FactorInteger[2^n - 1]][[ 1]] ]]], {n, 1, 100} ]
  • PARI
    a(n) = {my(v = vector(n-1, k, 2^k-1), na = 0, nb); fordiv(2^n-1, d, nb = 0; for (k=1, n-1, if (gcd(d, v[k]) == 1, nb++, break);); if (nb == n-1, na++);); return (na);} \\ Michel Marcus, Apr 30 2018

Extensions

More terms from Robert G. Wilson v, Sep 10 2001