The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 56th year, we are closing in on 350,000 sequences, and we’ve crossed 9,700 citations (which often say “discovered thanks to the OEIS”).

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A234541 Least k such that floor(n/k) + (n mod k) is a prime, or 0 if no such k exists. 1
 0, 1, 1, 2, 1, 2, 1, 4, 2, 2, 1, 4, 1, 2, 3, 8, 1, 6, 1, 4, 2, 2, 1, 8, 2, 2, 5, 4, 1, 6, 1, 6, 2, 2, 3, 12, 1, 2, 3, 8, 1, 6, 1, 4, 2, 2, 1, 16, 3, 10, 3, 4, 1, 18, 3, 6, 2, 2, 1, 8, 1, 2, 6, 18, 3, 6, 1, 4, 3, 4, 1, 14, 1, 2, 9, 4, 5, 6, 1, 16, 2, 2, 1, 12, 2, 2 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,4 COMMENTS a(n) = 1 only if n is a prime. a(2m) <= m, because with k=m, floor(2m/m)+(2m mod m) = 2. a(2m+1) <= 2m: floor((2m+1)/2m) + ((2m+1) mod 2m) = 1 + 1 = 2. LINKS Antti Karttunen, Table of n, a(n) for n = 1..10000 PROG (Python 2) primes = [2, 3] primFlg = [0]*100000 primFlg[2] = primFlg[3] = 1 def appPrime(k):   for p in primes:     if k%p==0:  return     if p*p > k:  break   primes.append(k)   primFlg[k] = 1 for n in range(5, 100000, 6):   appPrime(n)   appPrime(n+2) for n in range(1, 100000):   a = 0   for k in range(1, n):     c = n//k + n%k     if primFlg[c]:  # if c in primes:       a = k       break   print str(a)+', ', (MIT/GNU Scheme, with Aubrey Jaffer's SLIB Scheme library and function A234575bi as defined in A234575) (require 'factor) ;; For predicate prime? from SLIB-library. (define (A234541 n) (let loop ((k 1)) (cond ((prime? (A234575bi n k)) k) ((> k n) 0) (else (loop (+ 1 k)))))) ;; Antti Karttunen, Dec 29 2013 CROSSREFS Cf. A000040, A234575. Sequence in context: A296131 A345344 A319004 * A066389 A077191 A317545 Adjacent sequences:  A234538 A234539 A234540 * A234542 A234543 A234544 KEYWORD nonn,easy AUTHOR Alex Ratushnyak, Dec 27 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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified December 3 22:32 EST 2021. Contains 349468 sequences. (Running on oeis4.)