A053669 Smallest prime not dividing n.
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
Offset: 1
Examples
a(60) = 7, since all primes smaller than 7 divide 60 but 7 does not. a(90) = a(120) = a(150) = a(180) = 7 because 90,120,150,180 all have same squarefree kernel = 30 = A002110(3), and 7 is the smallest prime which does not divide 30. - _David James Sycamore_, Dec 04 2024
Links
- T. D. Noe, Table of n, a(n) for n = 1..10000
- Dylan Fridman, Juli Garbulsky, Bruno Glecer, James Grime and Massi Tron Florentin, A Prime-Representing Constant, The American Mathematical Monthly, Vol. 126, No. 1 (2019), pp. 70-73; ResearchGate link.
- James Grime and Brady Haran, 2.920050977316, Numberphile video (2020)
- Igor Rivin, Geodesics with one self-intersection, and other stories, Advances in Mathematics, Vol. 231, No. 5 (2012), pp. 2391-2412; arXiv preprint, arXiv:0901.2543 [math.GT], 2009-2011.
Crossrefs
Programs
-
Haskell
a053669 n = head $ dropWhile ((== 0) . (mod n)) a000040_list -- Reinhard Zumkeller, Nov 11 2012
-
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 *)
-
PARI
a(n)=forprime(p=2,,if(n%p,return(p))) \\ Charles R Greathouse IV, Nov 20 2012
-
Python
from sympy import nextprime def a(n): p = 2 while True: if n%p: return p else: p=nextprime(p) # Indranil Ghosh, May 12 2017
-
Python
# using standard library functions only import math def a(n): k = 2 while math.gcd(n,k) > 1: k += 1 return k # Ely Golden, Nov 26 2020
-
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
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
a(2k+1) = 2. - Bernard Schott, Jun 03 2019
Asymptotic mean: lim_{n->oo} (1/n) * Sum_{k=1..n} a(k) = A249270. - Amiram Eldar, Oct 29 2020
a(n) = A000040(A257993(n)) = A020639(A276086(n)) = A276086(n) / A324895(n). - Antti Karttunen, Apr 24 2022
a(n) << log n. For every e > 0, there is some N such that for all n > N, a(n) < (1 + e)*log n. - Charles R Greathouse IV, Dec 03 2022
Extensions
More terms from Andrew Gacek (andrew(AT)dgi.net), Feb 21 2000 and James Sellers, Feb 22 2000
Entry revised by David W. Wilson, Nov 25 2006
Comments