This site is supported by donations to The OEIS Foundation.

The OEIS is looking to hire part-time people to help edit core sequences, upload scanned documents, process citations, fix broken links, etc. - Neil Sloane, njasloane@gmail.com

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A053669 Smallest prime not dividing n. 49
 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 7, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 7, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 7, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,1 COMMENTS Smallest prime coprime to n. Smallest k >= 2 coprime to n. a(#(p-1)) = a(A034386(p-1)) = p is the first appearance of prime p in sequence. a(A005408(n)) = 2; for n > 2: a(n) = A112484(n,1). - Reinhard Zumkeller, Sep 23 2011 Average value is 2.920050977316134... - Charles R Greathouse IV, Nov 02 2013 Differs from A236454, "smallest number not dividing n^2", for the first time at n=210, where a(210)=11 while A236454(210)=8. A235921 lists all n for which a(n) differs from A236454. - Antti Karttunen, Jan 26 2014 LINKS T. D. Noe, Table of n, a(n) for n = 1..10000 Igor Rivin, Geodesics with one self-intersection, and other stories, arXiv:0901.2543 [math.GT], 2009-2011. FORMULA a(n) = A071222(n-1)+1. [Because the right hand side computes the smallest k >= 2 such that gcd(n,k) = gcd(n-1,k-1) which is equal to the smallest k >= 2 coprime to n] - Antti Karttunen, Jan 26 2014 a(n) = 1 + Sum_{k=1..n}(floor((n^k)/k!)-floor(((n^k)-1)/k!)) = 2 + Sum_{k=1..n} A001223(k)*( floor(n/A002110(k))-floor((n-1)/A002110(k)) ). - Anthony Browne, May 11 2016 a(n!) = A151800(n). - Anthony Browne, May 11 2016 EXAMPLE a(60) = 7, since all primes smaller than 7 divide 60 but 7 does not. MAPLE f:= proc(n) local p; p:= 2; while n mod p = 0 do p:= nextprime(p) od: p end proc: map(f, [\$1..100]); # Robert Israel, May 18 2016 MATHEMATICA Table[k := 1; While[Not[GCD[n, Prime[k]] == 1], k++ ]; Prime[k], {n, 1, 60}] (* Stefan Steinerberger, Apr 01 2006 *) With[{prs=Prime[Range[10]]}, Flatten[Table[Select[prs, !Divisible[ n, #]&, 1], {n, 110}]]] (* Harvey P. Dale, May 03 2012 *) PROG (Haskell) a053669 n = head \$ dropWhile ((== 0) . (mod n)) a000040_list -- Reinhard Zumkeller, Nov 11 2012 (PARI) a(n)=forprime(p=2, , if(n%p, return(p))) \\ Charles R Greathouse IV, Nov 20 2012 (Scheme) (define (A053669 n) (let loop ((i 1)) (cond ((zero? (modulo n (A000040 i))) (loop (+ i 1))) (else (A000040 i))))) ;; Antti Karttunen, Jan 26 2014 (Python) from sympy import nextprime def a(n):     p = 2     while True:         if n%p!=0: return p         else: p=nextprime(p) # Indranil Ghosh, May 12 2017 CROSSREFS One more than A071222(n-1). Cf. also A053670-A053674, A055874, A071222, A235921, A236454. Cf. A079578, A087560, A096014. Sequence in context: A123556 A284017 A236454 * A112047 A112048 A060395 Adjacent sequences:  A053666 A053667 A053668 * A053670 A053671 A053672 KEYWORD nonn,nice,easy,changed AUTHOR Henry Bottomley, Feb 15 2000 EXTENSIONS More terms from Andrew Gacek (andrew(AT)dgi.net), Feb 21 2000 and James A. Sellers, Feb 22 2000 Entry revised by David W. Wilson, Nov 25 2006 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 | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.