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 A375277 #28 Oct 19 2024 08:33:04 %S A375277 1,1,2,1,4,1,6,2,5,1,10,1,12,3,8,1,16,1,18,4,11,1,22,22,6,5,14,1,28,1, %T A375277 30,33,20,31,18,1,36,7,20,1,40,1,42,8,23,1,46,19,11,9,26,1,52,30,27, %U A375277 10,29,1,58,1,60,43,53,56,33,1,66,12,35,1,70,1,72,27,23,66,39,1,78 %N A375277 a(n) = n! (mod nextprime(n)). %C A375277 Same as A360825 except at n=3. %C A375277 a(n) = 1 iff n+2 is prime (A040976). %C A375277 a(n) = n iff n+1 is prime (A006093). %C A375277 a(n) > n iff n is in A360805. %H A375277 Dominic McCarty, <a href="/A375277/b375277.txt">Table of n, a(n) for n = 0..10000</a> %t A375277 a[n_] := Mod[n!, NextPrime[n]]; Array[a, 79, 0](* for large n *) a[n_] := Block[{m = NextPrime@ n, k = p = 1}, While[k < n +1, p = Mod[p*k, m]; k++]; p] %o A375277 (Python) %o A375277 from functools import reduce %o A375277 from sympy import nextprime %o A375277 def A375277(n): return ((p:=nextprime(n))-1)*pow(reduce(lambda i, j:i*j%p, range(n+1,p),1),-1,p)%p # _Chai Wah Wu_, Oct 18 2024 %Y A375277 Cf. A360825 (essentially the same). %Y A375277 Cf. A000040, A000142, A006093, A040976, A360805. %K A375277 easy,nonn %O A375277 0,3 %A A375277 _Robert G. Wilson v_, Sep 18 2024