cp's OEIS Frontend

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.

A120621 Least positive k such that !n + k is prime, where !n is left factorial.

This page as a plain text file.
%I A120621 #9 Dec 24 2019 08:29:06
%S A120621 2,1,1,1,1,3,3,3,9,3,7,9,7,13,49,27,9,37,19,33,7,93,103,9,73,27,13,27,
%T A120621 165,49,39,93,97,27,37,39,135,7,193,249,39,103,13,33,213,129,33,13,39,
%U A120621 115,187,19,7,387,19,489,303,63,33,235,297,495,657,465,235,193,369,129
%N A120621 Least positive k such that !n + k is prime, where !n is left factorial.
%H A120621 Amiram Eldar, <a href="/A120621/b120621.txt">Table of n, a(n) for n = 0..1000</a>
%t A120621 a[n_] := Module[{k = 1, lf = Sum[i!, {i, 0, n - 1}]}, While[!PrimeQ[lf + k], k++]; k]; Array[a, 100, 0] (* _Amiram Eldar_, Dec 24 2019 *)
%Y A120621 Cf. A003422, A033932 (with n! instead of !n).
%K A120621 easy,nonn
%O A120621 0,1
%A A120621 _Jason Earls_, Aug 17 2006