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.

A380539 The second smallest prime not dividing n.

Original entry on oeis.org

3, 5, 5, 5, 3, 7, 3, 5, 5, 7, 3, 7, 3, 5, 7, 5, 3, 7, 3, 7, 5, 5, 3, 7, 3, 5, 5, 5, 3, 11, 3, 5, 5, 5, 3, 7, 3, 5, 5, 7, 3, 11, 3, 5, 7, 5, 3, 7, 3, 7, 5, 5, 3, 7, 3, 5, 5, 5, 3, 11, 3, 5, 5, 5, 3, 7, 3, 5, 5, 11, 3, 7, 3, 5, 7, 5, 3, 7, 3, 7, 5, 5, 3, 11, 3, 5, 5, 5, 3, 11, 3, 5, 5, 5, 3, 7, 3, 5, 5, 7, 3, 7, 3, 5, 11
Offset: 1

Views

Author

Antti Karttunen, Feb 12 2025

Keywords

Examples

			For n = 1, the least prime not dividing it is 2, and the second least prime not dividing is 3, thus a(1) = 3.
For n = 3, the least nondividing prime is 2, the second least nondividing prime is 5, thus a(3) = 5.
For n = 6 = 2*3, the least nondividing prime is 5, and the second least nondividing prime is 7, thus a(6) = 7.
		

Crossrefs

Cf. also A351566.

Programs

  • Mathematica
    a[n_] := Module[{p = 1, c = 0}, While[c < 2, p = NextPrime[p]; If[! Divisible[n, p], c++]]; p]; Array[a, 105] (* Amiram Eldar, Feb 14 2025 *)
  • PARI
    A380539(n) = { my(c=0); forprime(p=2, , if(n%p, c++; if(2==c, return(p)))); };

Formula

Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 5.159142... (A381113). - Amiram Eldar, Feb 14 2025