login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A231631 Least positive integer k < n with k!*(n-k) + 1 prime, or 0 if such an integer k does not exist. 7
0, 1, 1, 2, 1, 3, 1, 2, 3, 2, 1, 4, 1, 3, 3, 2, 1, 4, 1, 2, 3, 2, 1, 3, 2, 3, 6, 2, 1, 3, 1, 2, 3, 6, 2, 3, 1, 2, 6, 3, 1, 5, 1, 6, 5, 2, 1, 3, 3, 2, 4, 2, 1, 3, 2, 2, 6, 2, 1, 11, 1, 5, 5, 3, 2, 3, 1, 5, 3, 2, 1, 6, 1, 7, 3, 2, 2, 4, 1, 2, 6, 4, 1, 3, 2, 3, 4, 2, 1, 3, 2, 2, 3, 3, 6, 7, 1, 2, 3, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,4
COMMENTS
Conjecture: 0 < a(n) < sqrt(n)*(log n) for all n > 2.
See also the conjecture in A231516.
LINKS
EXAMPLE
a(4) = 2 since 1!*3 + 1 = 4 is not prime, but 2!*2 + 1 = 5 is prime.
MATHEMATICA
Do[Do[If[PrimeQ[x!*(n-x)+1], Print[n, " ", x]; Goto[aa]], {x, 1, n-1}];
Print[n, " ", 0]; Label[aa]; Continue, {n, 1, 100}]
lpik[n_]:=Module[{k=1}, While[!PrimeQ[k!(n-k)+1], k++]; k]; Join[{0}, Array[ lpik, 100, 2]] (* Harvey P. Dale, Apr 19 2019 *)
CROSSREFS
Sequence in context: A132589 A054843 A277427 * A280700 A356149 A038566
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Nov 11 2013
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 27 06:50 EDT 2024. Contains 375462 sequences. (Running on oeis4.)