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.

A214716 Least m>0 such that 3^n-m and n-m are relatively prime.

Original entry on oeis.org

2, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 4, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 4
Offset: 1

Views

Author

Clark Kimberling, Jul 27 2012

Keywords

Examples

			gcd(3^7-1,6) = 2, gcd(3^7-2,5) = 5, gcd(3^7-3,4) = 4, gcd(3^7-4,3) = 1, so a(7) = 4.
		

Crossrefs

Programs

  • Mathematica
    Table[m = 1; While[GCD[3^n - m, n - m] != 1, m++]; m, {n, 1, 140}]
    lm[n_]:=Module[{m=1,n3=3^n},While[!CoprimeQ[n3-m,n-m],m++];m]; Array[ lm,90] (* Harvey P. Dale, May 10 2016 *)