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.

A240163 Numbers n such that (k!+n)/k is prime for some k.

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 9, 10, 12, 15, 16, 18, 20, 22, 24, 25, 27, 28, 30, 32, 33, 35, 36, 38, 40, 42, 44, 45, 46, 49, 51, 52, 56, 58, 60, 63, 65, 66, 68, 70, 72, 74, 78, 80, 81, 82, 84, 85, 87, 88, 91, 92, 95, 96, 100, 102, 104, 105, 106, 108, 112, 114, 115, 116, 117, 120, 121, 123, 124, 126
Offset: 1

Views

Author

Derek Orr, Aug 01 2014

Keywords

Comments

Complement of A245757.

Crossrefs

Programs

  • PARI
    a(n)=for(k=1, n, s=(k!+n)/k; if(floor(s)==s, if(ispseudoprime(s), return(k))))
    n=1;while(n<200,if(a(n),print1(n,", "));n++)

Extensions

Typo in PARI code fixed by Colin Barker, Aug 02 2014

A240160 Least number k such that (k!-n)/k is prime, or 0 if no such k exists.

Original entry on oeis.org

0, 0, 0, 4, 5, 0, 7, 8, 0, 0, 0, 4, 13, 0, 15, 4, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 31, 0, 33, 34, 5, 0, 0, 0, 39, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5
Offset: 1

Views

Author

Derek Orr, Aug 01 2014

Keywords

Comments

For a(n) > 0, a(n) is a divisor of n.
If a(n) = n, then n - 1 is in A002982.

Crossrefs

Programs

  • PARI
    a(n)=for(k=1,n,s=(k!-n)/k;if(floor(s)==s,if(ispseudoprime(s),return(k))))
    vector(150, n, a(n))

Extensions

Typo in PARI code fixed by Colin Barker, Aug 02 2014

A245757 Numbers n such that (k!+n)/k is never prime for any k.

Original entry on oeis.org

5, 7, 11, 13, 14, 17, 19, 21, 23, 26, 29, 31, 34, 37, 39, 41, 43, 47, 48, 50, 53, 54, 55, 57, 59, 61, 62, 64, 67, 69, 71, 73, 75, 76, 77, 79, 83, 86, 89, 90, 93, 94, 97, 98, 99, 101, 103, 107, 109, 110, 111, 113, 118, 119, 122, 125, 127, 128, 129, 131, 134, 137, 139, 141, 142, 143, 146
Offset: 1

Views

Author

Derek Orr, Jul 31 2014

Keywords

Comments

k <= n for all n so k can only be a finite set of numbers.
Only k dividing n need be considered.
By Wilson's theorem, all primes > 3 are in the sequence. - Robert Israel, Jul 31 2014

Examples

			(1!+5)/1 = 6 is not prime.
(2!+5)/2 = 7/2 is not prime.
(3!+5)/3 = 11/3 is not prime.
(4!+5)/4 = 29/4 is not prime.
(5!+5)/5 = 25 is not prime.
For any k > 5, (k!+5)/k = (k-1)! + 5/k will always be a fraction and thus, never prime. So 5 is a member of this sequence.
		

Crossrefs

Cf. A245756.

Programs

  • Maple
    filter:= proc(n) local k;
      for k in numtheory:-divisors(n) do
         if isprime((k!+n)/k) then return false fi
      od:
      true
    end proc:
    select(filter, [$1..1000]); # Robert Israel, Jul 31 2014
  • Mathematica
    filterQ[n_] := AllTrue[Divisors[n], !PrimeQ[(#! + n)/#]&];
    Select[Range[200], filterQ] (* Jean-François Alcover, Jul 27 2020 *)
  • PARI
    a(n)=for(k=1,n,s=(k!+n)/k;if(floor(s)==s,if(ispseudoprime(s),return(k))))
    n=1;while(n<200,if(!a(n),print1(n,", "));n++)
Showing 1-3 of 3 results.