OFFSET
1,2
REFERENCES
Adalbert Kerber, Applied Finite Group Actions, Springer, 2nd Revised and Expanded Edition, p. 114.
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..3000
FORMULA
a(n) = 0 if n >= 5 is prime.
For composite n > 8, a(n) = n * ((n-2) mod 4) + 1. - Ivan Neretin, Jun 25 2015
MAPLE
seq((1 + n*(n-2)+(n-1)!) mod (4*n), n = 1 .. 1000); # Robert Israel, Jun 25 2015
MATHEMATICA
Table[Mod[1 + n (n - 2) + (n - 1)!, 4 n], {n, 80}] (* Michael De Vlieger, Jul 01 2015 *)
PROG
(PARI) vector(80, n, (1 + n*(n - 2) + (n - 1)!) % (4*n)) \\ Michel Marcus, Jun 25 2015
(Magma) [(1+n*(n-2)+Factorial(n-1)) mod (4*n): n in [1..80]]; // Vincenzo Librandi, Feb 18 2018
(GAP) List([1..80], n -> (1+n*(n-2)+Factorial(n-1)) mod (4*n)); # Muniru A Asiru, Feb 18 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Neven Juric, Feb 04 2010
STATUS
approved