login
A039739
a(n)=2*q-prime(n), where q is the prime < p(n) for which (prime(n) mod q) is maximal.
1
1, 1, 3, 3, 1, 5, 3, 3, 5, 3, 1, 5, 3, 11, 5, 3, 1, 7, 3, 1, 3, 3, 5, 9, 5, 3, 11, 9, 5, 7, 3, 5, 3, 9, 7, 1, 3, 11, 5, 15, 13, 3, 1, 5, 3, 3, 3, 27, 25, 21, 15, 13, 3, 5, 11, 5, 3, 1, 17, 15, 5, 7, 3, 1, 9, 3, 9, 11, 9, 5, 3, 15, 9, 3, 3, 5, 1, 21, 13, 3, 1
OFFSET
2,3
FORMULA
a(n) = 2*A039734(n)-prime(n). - R. J. Mathar, May 03 2021
MAPLE
A039739 := proc(n)
local p, maxmod, q, qpiv ;
p := ithprime(n) ;
for j from 1 to n-1 do
q := ithprime(j) ;
if j = 1 then
qpiv := q ;
maxmod := modp(p, q) ;
else
if modp(p, q) > maxmod then
maxmod := modp(p, q) ;
qpiv := q ;
end if;
end if;
end do:
2*qpiv-p ;
end proc:
seq(A039739(n), n=2..80) ; # R. J. Mathar, May 03 2021
CROSSREFS
Sequence in context: A316366 A111945 A002143 * A160496 A105663 A318319
KEYWORD
nonn
STATUS
approved