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.

This page as a plain text file.
%I A380539 #14 Feb 15 2025 14:29:17
%S A380539 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,
%T A380539 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,
%U A380539 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
%N A380539 The second smallest prime not dividing n.
%H A380539 Antti Karttunen, <a href="/A380539/b380539.txt">Table of n, a(n) for n = 1..30030</a>
%F A380539 Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 5.159142... (A381113). - _Amiram Eldar_, Feb 14 2025
%e A380539 For n = 1, the least prime not dividing it is 2, and the second least prime not dividing is 3, thus a(1) = 3.
%e A380539 For n = 3, the least nondividing prime is 2, the second least nondividing prime is 5, thus a(3) = 5.
%e A380539 For n = 6 = 2*3, the least nondividing prime is 5, and the second least nondividing prime is 7, thus a(6) = 7.
%t A380539 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 *)
%o A380539 (PARI) A380539(n) = { my(c=0); forprime(p=2, , if(n%p, c++; if(2==c, return(p)))); };
%Y A380539 Cf. A053669, A381031, A381113.
%Y A380539 Cf. also A351566.
%K A380539 nonn
%O A380539 1,1
%A A380539 _Antti Karttunen_, Feb 12 2025