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.

A082470 a(n) is the number of k >= 0 such that k! + prime(n) is prime.

This page as a plain text file.
%I A082470 #29 Apr 26 2022 08:38:36
%S A082470 2,1,3,4,5,3,6,7,6,6,9,11,9,5,10,9,10,9,9,8,9,9,11,8,10,10,12,16,12,
%T A082470 10,10,13,14,14,16,11,12,9,15,10,9,8,12,9,10,6,8,7,14,13,10,21,15,9,
%U A082470 13,11,9,19,12,13,16,11,19,17,9,13
%N A082470 a(n) is the number of k >= 0 such that k! + prime(n) is prime.
%C A082470 k! + p is composite for k >= p since p divides k! for k >= p.
%C A082470 The first 10^6 terms are nonzero. Remarkably, the number 7426189 + m! is composite for all m <= 1793. - _T. D. Noe_, Mar 02 2010
%C A082470 Apparently it is not known whether a(n) is ever zero. - _N. J. A. Sloane_, Aug 11 2011
%H A082470 Robert Israel, <a href="/A082470/b082470.txt">Table of n, a(n) for n = 1..227</a>
%e A082470 For n = 4, 3!+7 = 13, 4!+7=31, 5!+7=127 and 6!+7 = 727 are the 4 primes in n!+7.
%p A082470 A082470 := proc(n)
%p A082470     local ctr,j ;
%p A082470     ctr := 0:
%p A082470     for j from 0 to ithprime(n)-1 do
%p A082470         if isprime(j!+ithprime(n))=true then
%p A082470             ctr := ctr+1
%p A082470         end if ;
%p A082470     end do ;
%p A082470     ctr
%p A082470 end proc:
%p A082470 seq(A082470(n),n=1..50) ;
%t A082470 Table[Count[Range[0,Prime[n]-1]!+Prime[n],_?PrimeQ],{n,70}] (* _Harvey P. Dale_, Feb 06 2019 *)
%o A082470 (Python)
%o A082470 from sympy import isprime, prime
%o A082470 from itertools import count, islice
%o A082470 def agen(): # generator of terms
%o A082470     for n in count(1):
%o A082470         pn, fk, an = prime(n), 1, 0
%o A082470         for k in range(1, pn+1):
%o A082470             if isprime(pn + fk): an += 1
%o A082470             fk *= k
%o A082470         yield an
%o A082470 print(list(islice(agen(), 40))) # _Michael S. Branicky_, Apr 16 2022
%o A082470 (PARI) nfactppct(n) = { forprime(p=1,n, c=0; for(x=0,n,y=x!+p;if(isprime(y),c++) ); print1(c",") ) } \\ _Cino Hilliard_, Apr 15 2004
%Y A082470 Cf. A092789, A175193, A175194, row lengths of A352912.
%K A082470 nonn
%O A082470 1,1
%A A082470 _Jeff Burch_, Apr 27 2003
%E A082470 Edited by _Franklin T. Adams-Watters_, Aug 01 2006
%E A082470 Offset corrected by _Robert Israel_, May 26 2021