OFFSET
1,2
COMMENTS
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = A301919(n+1) - 1 for n > 1.
EXAMPLE
MAPLE
f:= proc(p) local t; t:= numtheory:-order(3, p); if t::even then t/2 else NULL fi end proc:
f(2):= 1:
map(f, [seq(ithprime(i), i=1..300)]); # Robert Israel, May 23 2018
MATHEMATICA
f[p_] := Module[{t = MultiplicativeOrder[3, p]}, If[EvenQ[t], t/2, Nothing]];
f[2] = 1;
f /@ Table[Prime[i], {i, 1, 300}] (* Jean-François Alcover, Feb 02 2023, after Robert Israel *)
PROG
(PARI) lista(nn) = {for (n=1, nn, p = prime(n); if (p != 3, m = Mod(3, p); nb = znorder(m); for (k=1, nb, if (m^k == Mod(-1, p), print1(k, ", ")); ); ); ); } \\ Michel Marcus, May 18 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Luke W. Richards, Mar 28 2018
STATUS
approved