OFFSET
1,1
COMMENTS
Previous name: a(n) is the m-th prime number, where m is the smallest prime factor of n, a(1) = 2.
Given that the smallest prime factor of 6k + {-4, -3, -2, -1, 0, 1} is (2, 3, 2, p, 2, q) where p, q >= 5, p <> q, the sequence has from a(2) on the repeating pattern (3, 5, 3, prime(p), 3, prime(q)) of length 6, with prime(p), prime(q) >= prime(5) = 11 and prime(p) <> prime(q). - Bernard Schott, Dec 09 2018, edited by M. F. Hasler, Dec 10 2018
If n is in standard form and p is the smallest prime factor of n, then a(n) = prime(p) = A000040(p). - Muniru A Asiru, Jan 29 2019
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..16384
FORMULA
a(2*n) = 3. - Muniru A Asiru, Nov 10 2018
EXAMPLE
The smallest prime factor of 5 is 5. Hence a(5) is the 5th prime, which is 11.
The smallest prime factor of 6 is 2. Therefore a(6) = 3.
MATHEMATICA
Table[Prime[FactorInteger[n][[1, 1]]], {n, 2, 70}]
PROG
(PARI) g(n) = for(x=2, n, print1(prime(sdiv(x))", "))
sdiv(n) = { local(x); x=ifactor(n); return(x[1]) } \\ The smallest prime divisor of n
ifactor(n, m=0) = { local(f, j, k, flist); flist=[]; f=Vec(factor(n, m)); for(j=1, length(f[1]), for(k = 1, f[2][j], flist = concat(flist, f[1][j]) ); ); return(flist) } \\ The vector of the integer factors of n with multiplicity.
(PARI)
A020639(n) = if(1==n, n, factor(n)[1, 1]);
(GAP) P:=Filtered([1..350], IsPrime);; a:=List(List([1..Length(P)], Factors), i->P[i[1]]); # Muniru A Asiru, Nov 10 2018
(Magma) [2] cat [NthPrime(Min(PrimeFactors(n))):n in[2..70]]; // Vincenzo Librandi, Dec 09 2018
CROSSREFS
KEYWORD
nonn,less
AUTHOR
Cino Hilliard, May 03 2005
EXTENSIONS
Edited by Stefan Steinerberger, Jul 25 2007
Term a(1) = 2 prepended and offset corrected by Antti Karttunen, Nov 10 2018
New name from Michel Marcus, Dec 09 2018
STATUS
approved