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.

A057019 Difference between n!! and the first prime after n!! + 1.

This page as a plain text file.
%I A057019 #19 May 20 2022 08:32:49
%S A057019 2,3,2,3,2,5,2,5,2,7,4,11,16,11,8,17,4,19,64,17,2,17,2,13,8,71,2,61,4,
%T A057019 19,118,59,32,23,82,19,178,41,4,101,8,41,4,59,16,47,16,131,298,29,64,
%U A057019 31,16,83,194,31,2,41,298,53,316,193,8,67,334,53,32,43,226,149,386,37
%N A057019 Difference between n!! and the first prime after n!! + 1.
%C A057019 Analogous to the Fortunate numbers, but unlike them, not all terms here are prime. Many odd-indexed terms are powers of two and all even-indexed terms are prime.
%t A057019 NextPrime[ n_Integer ] := (k=n+1; While[ !PrimeQ[ k ], k++ ]; Return[ k ]); f[ n_Integer ] := (p = n!! + 1; q = NextPrime[ p ]; Return[ q - p + 1 ]); Table[ f[ n ], {n, 1, 75} ]
%t A057019 dfnp[n_]:=Module[{df=n!!},NextPrime[df+1]-df]; Array[dfnp,80] (* _Harvey P. Dale_, Mar 25 2012 *)
%o A057019 (MuPAD) for n from 1 to 72 do f := n!!:a := nextprime(f+2)-f:print(a) end_for; // _Zerinvary Lajos_, Feb 22 2007
%Y A057019 Cf. A006882, A057034.
%K A057019 nonn
%O A057019 1,1
%A A057019 _Robert G. Wilson v_, Sep 09 2000