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.

A039739 a(n)=2*q-prime(n), where q is the prime < p(n) for which (prime(n) mod q) is maximal.

This page as a plain text file.
%I A039739 #7 May 03 2021 05:57:26
%S A039739 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,
%T A039739 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,
%U A039739 3,1,9,3,9,11,9,5,3,15,9,3,3,5,1,21,13,3,1
%N A039739 a(n)=2*q-prime(n), where q is the prime < p(n) for which (prime(n) mod q) is maximal.
%F A039739 a(n) = 2*A039734(n)-prime(n). - _R. J. Mathar_, May 03 2021
%p A039739 A039739 := proc(n)
%p A039739     local p,maxmod,q,qpiv ;
%p A039739     p := ithprime(n) ;
%p A039739     for j from 1 to n-1 do
%p A039739         q := ithprime(j) ;
%p A039739         if j = 1 then
%p A039739             qpiv := q ;
%p A039739             maxmod := modp(p,q) ;
%p A039739         else
%p A039739             if modp(p,q) > maxmod then
%p A039739                 maxmod := modp(p,q) ;
%p A039739                 qpiv := q ;
%p A039739             end if;
%p A039739         end if;
%p A039739     end do:
%p A039739     2*qpiv-p ;
%p A039739 end proc:
%p A039739 seq(A039739(n),n=2..80) ; # _R. J. Mathar_, May 03 2021
%K A039739 nonn
%O A039739 2,3
%A A039739 _Clark Kimberling_