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.

A338101 Smallest odd prime dividing n is a(n)-th prime, or 0 if no such prime exists.

This page as a plain text file.
%I A338101 #32 Nov 15 2020 08:21:45
%S A338101 0,0,2,0,3,2,4,0,2,3,5,2,6,4,2,0,7,2,8,3,2,5,9,2,3,6,2,4,10,2,11,0,2,
%T A338101 7,3,2,12,8,2,3,13,2,14,5,2,9,15,2,4,3,2,6,16,2,3,4,2,10,17,2,18,11,2,
%U A338101 0,3,2,19,7,2,3,20,2,21,12,2,8,4,2,22,3,2,13,23,2,3,14,2,5,24,2
%N A338101 Smallest odd prime dividing n is a(n)-th prime, or 0 if no such prime exists.
%H A338101 Robert Israel, <a href="/A338101/b338101.txt">Table of n, a(n) for n = 1..10000</a>
%H A338101 <a href="/index/Pri#prime_indices">Index entries for sequences computed from indices in prime factorization</a>
%F A338101 a(n) = A000720(A020639(A000265(n))).
%F A338101 a(n) = A000720(A078701(n)).
%e A338101 70 = 2 * 5 * 7 = prime(1) * prime(3) * prime(4), 3 < 4, so a(70) = 3.
%p A338101 f:= proc(n) local w;
%p A338101    w:= numtheory:-factorset(n) minus {2};
%p A338101    if w = {} then 0 else numtheory:-pi(min(w)) fi
%p A338101 end proc:
%p A338101 map(f, [$1..100]); # _Robert Israel_, Nov 13 2020
%t A338101 Array[If[Or[# == 1, ! IntegerQ@ #], 0, PrimePi@ #] &@ SelectFirst[FactorInteger[#][[All, 1]], OddQ] &, 90] (* _Michael De Vlieger_, Nov 13 2020 *)
%o A338101 (PARI) a(n) = my(v = select(x->((x%2)==1), factor(n)[, 1])); if (#v, primepi(vecmin(v)), 0); \\ _Michel Marcus_, Nov 13 2020
%Y A338101 Cf. A000079 (positions of 0's), A000265, A000720, A020639, A055396, A078701.
%K A338101 nonn
%O A338101 1,3
%A A338101 _Ilya Gutkovskiy_, Nov 10 2020