OFFSET
1,2
COMMENTS
The sequence arises as the order of a shuffle of n(n+1) cards in which cards are laid out in an array of n+1 rows of n columns; cards are picked up by column and laid out by rows.
More generally there is a function of two variables, f(r,c) for which f(r,c) is the least integer such that c^f(r,c) is congruent to 1 modulo rc-1. Of interest is the ratio of phi(rc-1)/f(r,c) or in the case of the sequence proposed, phi(n^2+n-1)/m.
I would like to know if there is some direct way to predict these orders, or the ratio of phi(rc-1)/f(r,c). The program provided produces the table f(r,c).
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..20000
EXAMPLE
a(2)=4 because 2^4=16=1 mod 5 but 2^1, 2^2 and 2^3 are not;
a(3)=5 because 3^5=1 mod 11 and 5 is the smallest such.
MAPLE
TAB:=proc(Rmin, Rmax, Cmin, Cmax) local r, c, T, m, ct, A; T:=array(1..Rmax-Rmin+1, 1..Cmax-Cmin+1); for r from Rmin to Rmax do for c from Cmin to Cmax do A:=c; ct:=1; m:=r*c-1; while not A = 1 do A:=A*c mod m; ct:=ct+1; od; T[r-Rmin+1, c-Cmin+1]:=[ct, phi(m)]; od; od; eval(T) end:
# second Maple program:
a:= n-> `if`(n=1, 1, numtheory[order](n, n^2+n-1)):
seq(a(n), n=1..75); # Alois P. Heinz, Feb 18 2020
MATHEMATICA
f[n_] := If[n == 1, 1, Block[{m = 1, k = n^2 + n - 1}, While[Mod[n^m, k] != 1, m++ ]; m]]; Array[f, 59] (* Robert G. Wilson v *)
PROG
(PARI) print1(1, ", "); for(n=2, 60, q=n^2+n-1; m=1; while(lift(Mod(n, q)^m)!=1, m++); print1(m, ", ")) - (Klaus Brockhaus, Aug 09 2006)
CROSSREFS
KEYWORD
nonn
AUTHOR
John H. Mason, Aug 09 2006
EXTENSIONS
More terms from Klaus Brockhaus and Robert G. Wilson v, Aug 09 2006
STATUS
approved