A100394 a(n) is the subscript of the greatest prime factor of (2*prime(n) + 1).
3, 4, 5, 3, 9, 2, 4, 6, 15, 17, 4, 3, 23, 10, 8, 28, 7, 13, 3, 6, 4, 16, 39, 41, 6, 10, 9, 14, 21, 49, 7, 56, 5, 11, 9, 26, 4, 29, 19, 69, 72, 5, 76, 14, 22, 8, 15, 35, 6, 7, 91, 92, 9, 96, 27, 11, 5, 42, 12, 103, 4, 107, 13, 24, 8, 31, 7, 3, 34, 51, 26, 128, 4, 23, 9, 17, 13, 16, 21, 6
Offset: 1
Keywords
Examples
For n = 1: q = prime(1) = 2; 2*q + 1 = 5; A006530(5) = 5, pi(5) = 3 = a(1). For n = 25: q = prime(25) = 97; 2*q + 1 = 195 = 3*5*13, whose greatest prime factor is 13, of which the subscript = pi(13) = 6 = a(25).
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
f:= n -> numtheory:-pi(max(numtheory:-factorset(2*ithprime(n)+1))): map(f, [$1..100]); # Robert Israel, Jul 08 2018
-
Mathematica
a[n_] := PrimePi[FactorInteger[2*Prime[n]+1][[-1, 1]]]; Array[a, 100] (* Amiram Eldar, Mar 13 2025 *)
-
PARI
a(n) = primepi(vecmax(factor(2*prime(n) + 1)[,1])); \\ Michel Marcus, Jul 09 2018; corrected Jun 14 2022