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.

A333339 a(n) is the smallest positive number k such that n divides 3^k - k.

Original entry on oeis.org

1, 1, 3, 3, 7, 3, 2, 3, 9, 7, 4, 3, 16, 5, 27, 11, 5, 9, 29, 7, 27, 45, 39, 3, 73, 27, 27, 27, 22, 27, 132, 27, 36, 5, 27, 27, 65, 29, 27, 27, 27, 27, 10, 59, 27, 39, 12, 27, 47, 73, 42, 27, 68, 27, 36, 27, 30, 47, 154, 27, 192, 147, 27, 59, 16, 45, 119, 75, 39
Offset: 1

Views

Author

Jinyuan Wang, Mar 16 2020

Keywords

Comments

For any positive integer n, if k = a(n) + n*m*A007734(n) and m >= 0 then 3^k - k is divisible by n.
a(n) > log_3(n). - Robert Israel, Mar 19 2020

Crossrefs

Programs

  • Maple
    f:= proc(n) local k;
      for k from 1 do if 3 &^k - k mod n = 0 then return k fi od
    end proc:
    map(f, [$1..100]); # Robert Israel, Mar 19 2020
  • Mathematica
    a[n_] := Module[{k = 1}, While[!Divisible[3^k - k, n], k++]; k]; Array[a, 100] (* Amiram Eldar, Mar 16 2020 *)
  • PARI
    a(n) = for(k=1, oo, if(Mod(3, n)^k==k, return(k)));

Formula

a(3^m) = 3^m for m >= 0.
a(3^m-m) = m for m >= 1. - Robert Israel, Mar 19 2020