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-7 of 7 results.

A092789 a(n) = smallest prime of the form prime(n)+m! for some m >= 0.

Original entry on oeis.org

3, 5, 7, 13, 13, 19, 19, 43, 29, 31, 37, 43, 43, 67, 53, 59, 61, 67, 73, 73, 79, 103, 89, 113, 103, 103, 109, 109, 229, 137, 151, 137, 139, 163, 151, 157, 163, 283, 173, 179, 181, 363061, 193, 199, 199, 223, 331, 229, 229, 349, 239, 241, 5281, 257, 263, 269, 271
Offset: 1

Views

Author

Cino Hilliard, Apr 14 2004

Keywords

Comments

n! + p is composite for n >= p since p divides n! for n >= p.
Is it known that such a prime always exists? If not the definition should say "or -1 if no such prime exists". - N. J. A. Sloane, Aug 11 2011

Crossrefs

Programs

  • Magma
    SmallestP:=function(p) for m in [0..p-1] do q:=p+Factorial(m); if IsPrime(q) then return q; end if; end for; return -1; end function; [ SmallestP(NthPrime(n)): n in [1..80] ]; // Klaus Brockhaus, Mar 02 2010
  • Maple
    A092789 := proc(n) local q,m ; for m from 0 do q := ithprime(n)+m! ; if isprime(q) then return q; end if; end do ; end proc:
    seq(A092789(n),n=1..80) ; # R. J. Mathar, Mar 02 2010
  • PARI
    nfactpm3(n) = { forprime(p=1,n, c=0; for(x=0,n,y=x!+p;if(isprime(y),c++;print1(y",");break)); ) }
    

Extensions

Definition and offset corrected following a suggestion from Leroy Quet. - Klaus Brockhaus, Mar 02 2010

A092790 a(n) = (n+1)*phi(n-1)/2.

Original entry on oeis.org

2, 5, 6, 14, 8, 27, 20, 33, 24, 65, 28, 90, 48, 68, 72, 152, 60, 189, 88, 138, 120, 275, 104, 270, 168, 261, 180, 434, 128, 495, 272, 350, 288, 444, 228, 702, 360, 492, 336, 860, 264, 945, 460, 564, 528, 1127, 400, 1071, 520, 848, 648, 1430, 504, 1140, 696, 1062, 840, 1769
Offset: 3

Views

Author

N. J. A. Sloane, Nov 04 2008

Keywords

Comments

[The old entry with this sequence number was a duplicate of A082470.]
Prepending [0, 3] and setting offset = 0 the sequence becomes the row sums of A378068. - Peter Luschny, Dec 27 2024
a(n) is the sum of row n-1 of A078401. - Amiram Eldar, May 12 2025

Crossrefs

Cf. A000010 (phi), A078401, A378068.

Programs

  • Mathematica
    Table[(n+1) EulerPhi[n-1]/2,{n,3,60}] (* Harvey P. Dale, Apr 22 2012 *)
  • PARI
    a(n) = (n+1)*eulerphi(n-1)/2; \\ Michel Marcus, Sep 18 2017

A175193 a(n) is the smallest positive integer such that (the n-th prime)+a(n)! is prime, or -1 if no such prime exists.

Original entry on oeis.org

1, 2, 2, 3, 2, 3, 2, 4, 3, 2, 3, 3, 2, 4, 3, 3, 2, 3, 3, 2, 3, 4, 3, 4, 3, 2, 3, 2, 5, 4, 4, 3, 2, 4, 2, 3, 3, 5, 3, 3, 2, 9, 2, 3, 2, 4, 5, 3, 2, 5, 3, 2, 7, 3, 3, 3, 2, 3, 3, 2, 4, 4, 3, 2, 4, 8, 3, 5, 2, 4, 3, 4, 3, 3, 5, 3, 5, 4, 5, 4, 2, 5, 2, 3, 4, 3, 5, 3, 2, 4, 4, 4, 5, 7, 4, 3, 6, 2, 4, 3, 4, 3, 3, 2, 3
Offset: 1

Views

Author

Leroy Quet, Mar 01 2010

Keywords

Comments

A175194(n) = a(n)!.

Examples

			From _Michael De Vlieger_, Nov 24 2017: (Start)
Records and their indices in a(n):
    i          n   a(n)
   --------------------
    1        1      1
    2        2      2
    3        4      3
    4        8      4
    5       29      5
    6       42      9
    7      233     10
    8      254     42
    9     4508     49
   10     7003    124
   11     7385    276
   12    60650    311
   13    97146    542
(End)
		

Crossrefs

Programs

  • Mathematica
    Fold[Append[#1, SelectFirst[Range[12], Function[k, PrimeQ[Prime[#2] + k!]]]] &, {1}, Range[2, 105]] (* Michael De Vlieger, Nov 24 2017 *)
  • PARI
    a(n) = {my(k = 1, p = prime(n)); while (!isprime(p + k!), k++); k;} \\ Michel Marcus, Nov 25 2017

Formula

A092789(n) = A000040(n) + a(n)!.

Extensions

Extended by Ray Chandler, Mar 04 2010

A352912 Irregular triangle read by rows: row n (n>=1) lists the primes of the form prime(n) + k! for k >= 0.

Original entry on oeis.org

3, 3, 5, 7, 11, 29, 13, 31, 127, 727, 13, 17, 131, 5051, 3628811, 19, 37, 733, 19, 23, 41, 137, 362897, 39916817, 43, 139, 739, 5059, 3628819, 39916819, 87178291219, 29, 47, 743, 40343, 362903, 20922789888023, 31, 53, 149, 39916829, 479001629, 2432902008176640029, 37, 151, 751, 40351, 362911, 39916831, 355687428096031, 51090942171709440031, 1124000727777607680031
Offset: 1

Views

Author

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

Keywords

Examples

			The initial rows, prefixed by prime(n), are:
[2]: 3, 3,
[3]: 5,
[5]: 7, 11, 29,
[7]: 13, 31, 127, 727,
[11]: 13, 17, 131, 5051, 3628811,
[13]: 19, 37, 733,
[17]: 19, 23, 41, 137, 362897, 39916817,
[19]: 43, 139, 739, 5059, 3628819, 39916819, 87178291219,
[23]: 29, 47, 743, 40343, 362903, 20922789888023,
[29]: 31, 53, 149, 39916829, 479001629, 2432902008176640029,
[31]: 37, 151, 751, 40351, 362911, 39916831, 355687428096031, 51090942171709440031, 1124000727777607680031,
[37]: 43, 61, 157, 757, 5077, 40357, 39916837, 6402373705728037, 2432902008176640037, 51090942171709440037, 8683317618811886495518194401280000037,
...
		

Crossrefs

Cf. A352913 (last term in each row), A082470 (lengths of rows).

Programs

  • PARI
    forprime(p=2,59,print1([p],": ");for(k=0,p,if(ispseudoprime(p+k!),print1(p+k!,", ")));print())
    
  • 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

A175194 a(n) = the smallest factorial such that (the n-th prime)+a(n) is prime, or -1 if no such prime exists.

Original entry on oeis.org

1, 2, 2, 6, 2, 6, 2, 24, 6, 2, 6, 6, 2, 24, 6, 6, 2, 6, 6, 2, 6, 24, 6, 24, 6, 2, 6, 2, 120, 24, 24, 6, 2, 24, 2, 6, 6, 120, 6, 6, 2, 362880, 2, 6, 2, 24, 120, 6, 2, 120, 6, 2, 5040, 6, 6, 6, 2, 6, 6, 2, 24, 24, 6, 2, 24, 40320, 6, 120, 2, 24, 6, 24, 6, 6, 120, 6, 120, 24, 120, 24, 2, 120, 2
Offset: 1

Views

Author

Leroy Quet, Mar 01 2010

Keywords

Comments

a(n) = A175193(n)!.

Crossrefs

Formula

A092789(n) = A000040(n) + a(n).

Extensions

Extended by Ray Chandler, Mar 04 2010

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-7 of 7 results.