OFFSET
0,2
LINKS
Muniru A Asiru, Table of n, a(n) for n = 0..5000
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
AUTHOR
EXTENSIONS
a(0) = 1 added by Peter Luschny, Oct 07 2017
STATUS
approved