%I #52 Dec 30 2023 23:46:26
%S 0,1,3,6,3,6,2,0,1,3,6,3,6,2,0,1,3,6,3,6,2,0,1,3,6,3,6,2,0,1,3,6,3,6,
%T 2,0,1,3,6,3,6,2,0,1,3,6,3,6,2,0,1,3,6,3,6,2,0,1,3,6,3,6,2,0,1,3,6,3,
%U 6,2,0,1,3,6,3,6,2,0,1,3,6,3,6,2,0,1,3,6,3,6,2,0,1,3,6,3,6,2,0,1,3,6,3,6,2,0
%N Order of n (mod 7).
%H <a href="/index/Rec#order_07">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,0,0,0,1).
%F G.f.: x*(1 + 3*x + 6*x^2 + 3*x^3 + 6*x^4 + 2*x^5)/(1 - x^7). - _Bruno Berselli_, Mar 22 2016
%F a(n) = -(35*(n mod 7)^6 - 603*(n mod 7)^5 + 3860*(n mod 7)^4 - 11235*(n mod 7)^3 + 14465*(n mod 7)^2 - 6882*(n mod 7))/360. - _Luce ETIENNE_, Oct 20 2017
%t ReplacePart[Table[MultiplicativeOrder[n, 7], {n, 105}], List /@ Range[7, 105, 7] -> 0] (* _Alonso del Arte_, Mar 23 2016 *)
%t PadRight[{},120,{0,1,3,6,3,6,2}] (* _Harvey P. Dale_, Apr 26 2020 *)
%o (Magma) [Modorder(n,7): n in [0..110]]; // _Bruno Berselli_, Mar 22 2016
%o (PARI) a(n) = if (n % 7, znorder(Mod(n, 7)), 0); \\ _Michel Marcus_, Mar 22 2016
%o (PARI) x='x+O('x^200); concat(0, Vec(x*(1+3*x+6*x^2+3*x^3+6*x^4+2*x^5)/(1-x^7))) \\ _Altug Alkan_, Mar 23 2016
%Y Cf. A010876, A218256.
%K nonn,easy
%O 0,3
%A _Felice Russo_
%E More terms from Larry Reeves (larryr(AT)acm.org), Apr 04 2000