login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A338101 Smallest odd prime dividing n is a(n)-th prime, or 0 if no such prime exists. 1
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, 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, 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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
LINKS
FORMULA
a(n) = A000720(A020639(A000265(n))).
a(n) = A000720(A078701(n)).
EXAMPLE
70 = 2 * 5 * 7 = prime(1) * prime(3) * prime(4), 3 < 4, so a(70) = 3.
MAPLE
f:= proc(n) local w;
w:= numtheory:-factorset(n) minus {2};
if w = {} then 0 else numtheory:-pi(min(w)) fi
end proc:
map(f, [$1..100]); # Robert Israel, Nov 13 2020
MATHEMATICA
Array[If[Or[# == 1, ! IntegerQ@ #], 0, PrimePi@ #] &@ SelectFirst[FactorInteger[#][[All, 1]], OddQ] &, 90] (* Michael De Vlieger, Nov 13 2020 *)
PROG
(PARI) a(n) = my(v = select(x->((x%2)==1), factor(n)[, 1])); if (#v, primepi(vecmin(v)), 0); \\ Michel Marcus, Nov 13 2020
CROSSREFS
Cf. A000079 (positions of 0's), A000265, A000720, A020639, A055396, A078701.
Sequence in context: A077962 A353484 A349134 * A338490 A213607 A298932
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Nov 10 2020
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 04:14 EDT 2024. Contains 371918 sequences. (Running on oeis4.)