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.

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

This page as a plain text file.
%I A245756 #15 Aug 03 2014 23:24:41
%S A245756 1,1,3,1,0,1,0,2,3,1,0,1,0,0,3,1,0,1,0,2,0,1,0,2,5,0,3,1,0,1,0,2,3,0,
%T A245756 5,1,0,38,0,1,0,1,0,2,3,1,0,0,7,0,3,1,0,0,0,2,0,1,0,1,0,0,3,0,5,1,0,4,
%U A245756 0,1,0,1,0,74,0,0,0,1,0,2,3,1,0,2,5,0,3
%N A245756 Least number k such that (k! + n)/k is prime, or 0 if no such k exists.
%C A245756 If a(n) = n, then n is in A090660.
%C A245756 a(n) <= n for all n.
%C A245756 a(n) = 1 if and only if n + 1 is prime.
%H A245756 Jens Kruse Andersen, <a href="/A245756/b245756.txt">Table of n, a(n) for n = 1..1000</a>
%e A245756 (1! + 3)/1 = 4 is not prime.
%e A245756 (2! + 3)/2 = 5/2 is not prime.
%e A245756 (3! + 3)/3 = 3 is prime. Thus a(3) = 3.
%o A245756 (PARI)
%o A245756 a(n)=for(k=1,n,s=(k!+n)/k;if(floor(s)==s,if(ispseudoprime(s),return(k))))
%o A245756 n=1;while(n<150,print1(a(n),", ");n++)
%Y A245756 Cf. A090660.
%K A245756 nonn
%O A245756 1,3
%A A245756 _Derek Orr_, Jul 31 2014
%E A245756 Corrected by _Jens Kruse Andersen_, Aug 03 2014