This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A086330 #22 Apr 16 2024 16:52:55 %S A086330 0,2,4,7,2,18,8,17,12,43,8,73,32,17,24,113,26,159,12,32,76,203,8,112, %T A086330 164,89,60,334,32,496,88,164,232,67,44,706,292,164,32,863,74,874,164, %U A086330 62,456,1097,56,291,162,317,268,1124,116,142,88,425,566,1560,32,2033,930 %N A086330 a(n) = Sum_{m >= 2} m! mod n. %C A086330 A discrete infinite sum that has some rough analogies to the infinite series for exponentials. %F A086330 a(n) = -1 + Sum_{k=1..n} A062169(n, k). - _Vladeta Jovovic_, Sep 06 2003 %e A086330 a(7) = 2! mod 7 + 3! mod 7 + 4! mod 7 + 5! mod 7 + 6! mod 7 + 7! mod 7 + 8! mod 7 + . . . = 2 mod 7 + 6 mod 7 + 24 mod 7 + 120 mod 7 + 720 mod 7 + 5040 mod 7 + 40320 mod 7 + ... = 2 + 6 + 3 + 1 + 6 + (all further values are zero) = 18. %o A086330 (PARI) a(n) = sum(m=2, n, m! % n) \\ _Michel Marcus_, Jul 23 2013 %o A086330 (Python) %o A086330 def A086330(n): %o A086330 a, c = 0, 1 %o A086330 for m in range(2,n): %o A086330 c = c*m%n %o A086330 if c==0: %o A086330 break %o A086330 a += c %o A086330 return a # _Chai Wah Wu_, Apr 16 2024 %Y A086330 Cf. A062169. %K A086330 easy,nonn %O A086330 2,2 %A A086330 _Walter Carlini_, Aug 31 2003 %E A086330 Corrected and extended by _Vladeta Jovovic_, Sep 06 2003