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.

A091733 a(n) is the least m > 1 such that m^3 = 1 (mod n).

Original entry on oeis.org

2, 3, 4, 5, 6, 7, 2, 9, 4, 11, 12, 13, 3, 9, 16, 17, 18, 7, 7, 21, 4, 23, 24, 25, 26, 3, 10, 9, 30, 31, 5, 33, 34, 35, 11, 13, 10, 7, 16, 41, 42, 25, 6, 45, 16, 47, 48, 49, 18, 51, 52, 9, 54, 19, 56, 9, 7, 59, 60, 61, 13, 5, 4, 65, 16, 67, 29, 69, 70, 11, 72, 25, 8, 47, 76, 45, 23, 55, 23
Offset: 1

Views

Author

David Wasserman, Mar 05 2004

Keywords

Comments

a(n) <= n + 1; the inequality is strict iff n is divisible by 9 or by a prime congruent to 1 mod 3. - Robert Israel, May 27 2014

Examples

			a(7) = 2 because 2^3 is congruent to 1 (mod 7).
		

Crossrefs

Programs

  • MATLAB
    m = 2; while mod(m^3 - 1, n); m = m + 1; end; m
    
  • Maple
    A:= n -> min(select(t -> type((t^3-1)/n, integer), [$2 .. n+1]));
    map(A, [$1 .. 1000]); # Robert Israel, May 27 2014
  • Mathematica
    f[n_] := Block[{x = 2}, While[Mod[x^3 - 1, n] != 0, x++]; x]; Array[f, 79] (* Robert G. Wilson v, Mar 29 2016 *)
  • PARI
    a(n) = my(k = 2); while(Mod(k, n)^3 != 1, k++); k; \\ Michel Marcus, Mar 30 2016