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.

A268081 Least positive integer k such that 3^n-1 and k^n-1 are relatively prime.

Original entry on oeis.org

2, 2, 2, 10, 2, 28, 2, 10, 2, 22, 10, 910, 2, 2, 2, 170, 2, 3458, 2, 110, 2, 46, 10, 910, 2, 2, 2, 290, 2, 9548, 2, 340, 10, 2, 22, 639730, 2, 2, 2, 4510, 2, 1204, 10, 230, 2, 94, 2, 216580, 2, 22, 2, 530, 2, 3458, 22, 580, 2, 118, 2, 18928910
Offset: 1

Views

Author

Tom Edgar, Jan 25 2016

Keywords

Comments

Note that (3^n-1)^n-1 is always relatively prime to 3^n-1.
According to the conjecture given in A086892, a(n) = 2 infinitely often.
When n>1, a(n) = 2 if and only if A260119(n) = 3.
From Robert Israel, Nov 20 2024: (Start)
a(n) <= a(m*n) for m >= 1.
If p is a prime factor of 3^n - 1 such that p-1 divides n, then a(n) is a multiple of p. (End)

Examples

			Since 3^5-1 = 242 and 2^5-1 = 31 are relatively prime, a(5) = 2.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local t,F,m,k,v;
           t:= 3^n-1;
           F:= select(isprime,map(`+`,numtheory:-divisors(n),1));
           m:= convert(select(s -> t mod s = 0, F),`*`);
           for k from m by m do
                 v:= k &^ n - 1 mod t;
                 if igcd(v, t) = 1 then return k fi
           od
        end proc:
    map(f, [$1..100]); # Robert Israel, Nov 20 2024
  • Mathematica
    Table[k = 1; While[! CoprimeQ[3^n - 1, k^n - 1], k++]; k, {n, 59}] (* Michael De Vlieger, Jan 27 2016 *)
  • PARI
    a(n) = {k=1; while( gcd(3^n-1, k^n-1)!=1, k++); k; }
  • Sage
    def min_k(n):
        g, k=2, 0
        while g!=1:
            k=k+1
            g=gcd(3^n-1, k^n-1)
        return k
    print([min_k(n) for n in [1..60]])