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.

Showing 1-2 of 2 results.

A159353 a(n) = the smallest positive integer such that a(n)*(2^n - 2) is a multiple of n.

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 1, 4, 3, 5, 1, 6, 1, 7, 5, 8, 1, 9, 1, 10, 7, 11, 1, 12, 5, 13, 9, 2, 1, 15, 1, 16, 11, 17, 35, 18, 1, 19, 13, 20, 1, 21, 1, 22, 3, 23, 1, 24, 7, 25, 17, 26, 1, 27, 55, 28, 19, 29, 1, 30, 1, 31, 21, 32, 13, 33, 1, 34, 23, 5, 1, 36, 1, 37, 25, 38, 77, 39, 1, 40, 27, 41, 1, 42
Offset: 1

Views

Author

Leroy Quet, Apr 11 2009

Keywords

Comments

This is not the same as sequence A032742, where A032742(n) = the largest proper divisor of n. See A146077 for indices at which A032742 and this sequence differ.

Crossrefs

Programs

  • Magma
    [Denominator((2^n-2)/n): n in [1..84]]; // Juri-Stepan Gerasimov, Sep 09 2014
    
  • Mathematica
    Array[Block[{k = 1}, While[! Divisible[k (2^# - 2), #], k++]; k] &, 84] (* Michael De Vlieger, Oct 30 2017 *)
  • PARI
    a(n)=my(k=1);while((2^n-2)*k%n != 0,k++);return(k) \\ Edward Jiang, Sep 09 2014
    
  • PARI
    a(n)=denominator(lift(Mod(2,n)^n-2)/n) \\ Charles R Greathouse IV, Sep 11 2014

Formula

a(n) = denominator((2^n - 2)/n). - Juri-Stepan Gerasimov, Sep 09 2014

Extensions

Extended by Ray Chandler, Apr 11 2009

A214606 a(n) = gcd(n, 2^n - 2).

Original entry on oeis.org

1, 2, 3, 2, 5, 2, 7, 2, 3, 2, 11, 2, 13, 2, 3, 2, 17, 2, 19, 2, 3, 2, 23, 2, 5, 2, 3, 14, 29, 2, 31, 2, 3, 2, 1, 2, 37, 2, 3, 2, 41, 2, 43, 2, 15, 2, 47, 2, 7, 2, 3, 2, 53, 2, 1, 2, 3, 2, 59, 2, 61, 2, 3, 2, 5, 2, 67, 2, 3, 14, 71, 2, 73, 2, 3, 2, 1, 2, 79
Offset: 1

Views

Author

Alex Ratushnyak, Jul 22 2012

Keywords

Comments

Greatest common divisor of n and 2^n - 2.
a(n)=n iff n=1 or n is prime or n is Fermat pseudoprime to base 2 or even pseudoprime to base 2. - Corrected by Thomas Ordowski, Jan 25 2016
Indices of 1's: A121707 preceded by 1. - False, see A267999.
Numbers n such that a(n) does not equal A020639(n) (the least prime factor of n): A146077.

Examples

			a(3) = 3 because 2^3 - 2 = 6 and gcd(3, 6) = 3.
a(4) = 2 because 2^4 - 2 = 14 and gcd(4, 14) = 2.
		

Crossrefs

Programs

  • Java
    import java.math.BigInteger;
    public class A214606 {
      public static void main (String[] args) {
        BigInteger c1 = BigInteger.valueOf(1);
        BigInteger c2 = BigInteger.valueOf(2);
        for (int n=0; n<222; n++) {
          BigInteger bn=BigInteger.valueOf(n),pm2=c1.shiftLeft(n).subtract(c2);
          System.out.printf("%s, ", bn.gcd(pm2).toString());
        }
      }
    }
    
  • Magma
    [GCD(n, 2^n-2): n in [1..80]]; // Vincenzo Librandi, Jan 26 2016
  • Maple
    seq(igcd(n, (2&^n - 2) mod n), n=1 .. 1000); # Robert Israel, Jan 26 2016
  • Mathematica
    Table[GCD[n, 2^n - 2], {n, 1, 59}] (* Alonso del Arte, Jul 22 2012 *)
  • PARI
    a(n)=gcd(n,lift(Mod(2,n)^n-2)) \\ Charles R Greathouse IV, May 29 2014
    
Showing 1-2 of 2 results.