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.

Showing 1-3 of 3 results.

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

Original entry on oeis.org

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, 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, 13, 11, 9, 19, 12, 13, 16, 11, 19, 17, 9, 13
Offset: 1

Views

Author

Jeff Burch, Apr 27 2003

Keywords

Comments

k! + p is composite for k >= p since p divides k! for k >= p.
The first 10^6 terms are nonzero. Remarkably, the number 7426189 + m! is composite for all m <= 1793. - T. D. Noe, Mar 02 2010
Apparently it is not known whether a(n) is ever zero. - N. J. A. Sloane, Aug 11 2011

Examples

			For n = 4, 3!+7 = 13, 4!+7=31, 5!+7=127 and 6!+7 = 727 are the 4 primes in n!+7.
		

Crossrefs

Cf. A092789, A175193, A175194, row lengths of A352912.

Programs

  • Maple
    A082470 := proc(n)
        local ctr,j ;
        ctr := 0:
        for j from 0 to ithprime(n)-1 do
            if isprime(j!+ithprime(n))=true then
                ctr := ctr+1
            end if ;
        end do ;
        ctr
    end proc:
    seq(A082470(n),n=1..50) ;
  • Mathematica
    Table[Count[Range[0,Prime[n]-1]!+Prime[n],?PrimeQ],{n,70}] (* _Harvey P. Dale, Feb 06 2019 *)
  • 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
  • Python
    from sympy import isprime, prime
    from itertools import count, islice
    def agen(): # generator of terms
        for n in count(1):
            pn, fk, an = prime(n), 1, 0
            for k in range(1, pn+1):
                if isprime(pn + fk): an += 1
                fk *= k
            yield an
    print(list(islice(agen(), 40))) # Michael S. Branicky, Apr 16 2022
    

Extensions

Edited by Franklin T. Adams-Watters, Aug 01 2006
Offset corrected by Robert Israel, May 26 2021

A352913 a(n) = largest prime of the form prime(n) + k! (k >= 0).

Original entry on oeis.org

3, 5, 29, 727, 3628811, 733, 39916817, 87178291219, 20922789888023, 2432902008176640029, 1124000727777607680031, 8683317618811886495518194401280000037, 15511210043330985984000041, 523022617466601111760007224100074291200000043, 2658271574788448768043625811014615890319638528000000047
Offset: 1

Views

Author

Editors of OEIS, based on a suggestion from Hemjyoti Nath, Apr 16 2022

Keywords

Crossrefs

These are the final entries in the rows of the triangle in A352912. See also A082470.

Programs

  • Python
    from sympy import isprime, prime
    from itertools import count, islice
    def agen(): # generator of terms
        for n in count(1):
            pn, fk = prime(n), 1
            for k in range(1, pn+1):
                if isprime(pn + fk): yield pn + fk
                fk *= k
    print(list(islice(agen(), 51))) # Michael S. Branicky, Apr 16 2022

A384181 Primes p such that k! + p or |k! - p| is composite for all k >= 0.

Original entry on oeis.org

2, 3, 71, 97, 179, 181, 211, 223, 251, 283, 431, 503, 577, 827, 857, 971, 1019, 1021, 1109, 1213, 1249, 1259, 1279, 1289, 1373, 1427, 1429, 1483, 1571, 1609, 1619, 1637, 1699, 1709, 1759, 1801, 2053, 2129, 2141, 2213, 2269, 2281, 2293, 2297, 2339, 2381, 2477, 2503
Offset: 1

Views

Author

Gonzalo Martínez, May 21 2025

Keywords

Comments

It is unknown whether there exists a prime p such that k! + p is composite for all k > = 0 (see A082470).
Every prime p in this list satisfies that at least one of the numbers k! + p, |k! - p| is composite; i.e., they cannot both be prime, for k >= 0.

Examples

			71 is in this sequence, since k! + 71 is prime only when k = 2, 5, 9, 14, 22, 43, 53 and 55, but |k! - 71| is composite for such values of k.
		

Crossrefs

Programs

  • Python
    from sympy import isprime, primerange, factorial
    def ok(p):
        return not any(isprime((fk := factorial(k)) + p) and isprime(abs(fk - p)) for k in range(1, p))
    print([p for p in primerange(2, 500) if ok(p)])

Extensions

a(17)-a(23) from Sean A. Irvine, May 28 2025
a(24)-a(48) from Michael S. Branicky, May 29 2025
Showing 1-3 of 3 results.