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 A226718 #14 Feb 03 2025 18:54:32 %S A226718 0,2,6,4,15,48,0,0,45,120,66,168,0,0,120,288,153,360,0,0,231,528,0,0, %T A226718 0,0,378,840,435,960,0,0,0,0,630,1368,0,0,780,1680,861,1848,0,0,1035, %U A226718 2208,0,0,0,0,1326,2808,0,0,0,0,1653,3480,1770,3720,0,0,0,0,2145,4488 %N A226718 n! mod tetrahedral(n), that is A000142(n) mod A000292(n). %H A226718 Ivan Neretin, <a href="/A226718/b226718.txt">Table of n, a(n) for n = 1..10000</a> %F A226718 a(n) = n! mod (n*(n+1)*(n+2)/6). %F A226718 For n>4: if neither n+1 nor n+2 is prime, then a(n)=0. Otherwise, a(n)=n(n+1)/2 for odd n and a(n)=n(n+2) for even n. - _Ivan Neretin_, May 18 2015 %p A226718 A226718 := proc(n) %p A226718 n! mod ( n*(n+1)*(n+2)/6) ; %p A226718 end proc: # _R. J. Mathar_, Jun 18 2013 %t A226718 Table[Mod[n!, n (n + 1) (n + 2)/6], {n, 66}] (* _Ivan Neretin_, May 18 2015 *) %o A226718 (Python) %o A226718 f = 1 %o A226718 for i in range(1, 100): %o A226718 f *= i %o A226718 print(f % (i*(i+1)*(i+2)//6), end=', ') %Y A226718 Cf. A000142, A000292, A119690. %K A226718 nonn,easy %O A226718 1,2 %A A226718 _Alex Ratushnyak_, Jun 15 2013