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.

Previous Showing 21-23 of 23 results.

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

Original entry on oeis.org

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, 165, 49, 39, 93, 97, 27, 37, 39, 135, 7, 193, 249, 39, 103, 13, 33, 213, 129, 33, 13, 39, 115, 187, 19, 7, 387, 19, 489, 303, 63, 33, 235, 297, 495, 657, 465, 235, 193, 369, 129
Offset: 0

Views

Author

Jason Earls, Aug 17 2006

Keywords

Crossrefs

Cf. A003422, A033932 (with n! instead of !n).

Programs

  • Mathematica
    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 *)

A269485 Least k > 0 such that n! + k^2 is prime.

Original entry on oeis.org

1, 1, 1, 1, 7, 11, 7, 13, 17, 31, 13, 1, 47, 17, 19, 19, 23, 73, 43, 29, 47, 31, 43, 29, 31, 37, 167, 1, 29, 43, 79, 229, 89, 71, 137, 37, 53, 1, 79, 131, 137, 1, 71, 83, 89, 89, 53, 97, 53, 101, 59, 173, 79, 71, 353, 191, 103, 523, 229, 191, 103, 401, 67, 257
Offset: 0

Views

Author

Jean-Marc Rebert, Feb 28 2016

Keywords

Comments

a(n) = A033932(n) = 1 for n in A002981.

Examples

			a(4) = 7, because 4! + 7^2 = 73 is prime and for 0 < i < 7, 4! + i^2 is not prime.
		

Crossrefs

Programs

  • Mathematica
    Table[SelectFirst[Range@ 10000, PrimeQ[n! + #^2] &], {n, 120}]
    (* Version 10, or *)
    Table[k = 1; While[! PrimeQ[n! + k^2], k++]; k, {n, 120}] (* Michael De Vlieger, Feb 28 2016 *)
  • PARI
    a(n) = {my(k=1); while (!isprime(n! + k^2), k++); k;} \\ Michel Marcus, Feb 29 2016

A257886 Least positive m such that floor(n! / (2*(floor(n/2)!))) + m is prime.

Original entry on oeis.org

2, 1, 2, 1, 1, 1, 1, 13, 1, 1, 29, 1, 1, 37, 29, 17, 31, 71, 71, 37, 23, 1, 37, 1, 41, 41, 31, 31, 59, 31, 41, 41, 41, 41, 41, 37, 41, 193, 83, 41, 53, 67, 149, 97, 59, 73, 113, 107, 137, 59, 137, 67, 101, 83, 73, 101, 241, 71, 73, 79, 83, 227, 199, 223, 127, 83, 83, 181, 227, 149, 103, 1, 587, 179, 229, 167, 127, 163, 109, 83
Offset: 1

Views

Author

David Morales Marciel, May 11 2015

Keywords

Comments

Conjecture: No term is composite (similar conjecture to A033932 for a different expression).

Examples

			n = 1, floor(1! / (2*(floor(1/2)!)))=0, m = 2, and 0+2=2 is prime.
n = 2, floor(2! / (2*(floor(2/2)!)))=1, m = 1, and 1+1=2 is prime.
...
n = 15, floor(15! / (2*(floor(15/2)!)))=129729600, m = 29, and 129729600+29 = 129729629 is prime.
		

Crossrefs

Cf. A033932.

Programs

  • Mathematica
    lpm[n_]:=Module[{c=Floor[n!/(2Floor[n/2]!)]},NextPrime[c]-c]; Array[lpm,80] (* Harvey P. Dale, May 15 2018 *)
  • Python
    from sympy import factorial, nextprime
    [(nextprime(int(factorial(n)/(2*factorial(n//2)))))-int(factorial(n)/(2*factorial(n//2))) for n in range(1,10**5)]

Extensions

Edited. Wolfdieter Lang, Jun 08 2015
Previous Showing 21-23 of 23 results.