login
A003571
Order of 3 mod 3n+1.
5
1, 2, 6, 4, 3, 4, 18, 5, 20, 6, 30, 16, 18, 4, 42, 11, 42, 6, 20, 28, 10, 16, 22, 12, 12, 18, 78, 8, 16, 10, 6, 23, 48, 20, 34, 52, 27, 12, 44, 29, 5, 30, 126, 12, 18, 16, 138, 35, 28, 18, 50, 30, 78, 8, 162, 41, 39, 42, 60, 88, 45, 22, 80, 36, 16, 42, 198, 100, 8
OFFSET
0,2
LINKS
MAPLE
a := n -> `if`(n=0, 1, numtheory:-order(3, 3*n+1)):
seq(a(n), n = 0..68);
MATHEMATICA
Table[MultiplicativeOrder[3, 3*n + 1], {n, 0, 68}] (* Arkadiusz Wesolowski, Nov 27 2012 *)
PROG
(Sage)
def A003571(n):
s, m, N = 0, 1, 3*n + 1
while True:
k = N + m
v = valuation(k, 3)
s += v
m = k // 3^v
if m == 1: break
return s
print([A003571(n) for n in (0..68)]) # Peter Luschny, Oct 07 2017
(GAP) List([0..70], n->OrderMod(3, 3*n+1)); # Muniru A Asiru, Feb 16 2019
(PARI) a(n) = znorder(Mod(3, 3*n+1)); \\ Michel Marcus, Feb 16 2019
CROSSREFS
KEYWORD
nonn
EXTENSIONS
a(0) = 1 added by Peter Luschny, Oct 07 2017
STATUS
approved