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.

A039731 a(n) = max{prime(n) mod q, where prime q < prime(n) = n-th prime}.

This page as a plain text file.
%I A039731 #44 Jul 16 2024 08:09:10
%S A039731 1,2,2,4,6,6,8,10,12,14,18,18,20,18,24,28,30,30,34,36,38,40,42,44,48,
%T A039731 50,48,50,54,60,64,66,68,70,72,78,80,78,84,82,84,94,96,96,98,104,110,
%U A039731 100,102,106,112,114,124,126,126,132,134,138,132,134,144,150
%N A039731 a(n) = max{prime(n) mod q, where prime q < prime(n) = n-th prime}.
%C A039731 Sequence lists the maxima of rows of triangle A207409. - _Michel Marcus_, Oct 01 2013
%C A039731 If there is a prime q with p/2 < q < 2p/3, then p mod q = p - q and a(n) = p - nextprime(p/2). But by a result of Nagura, there is always a prime between x and 6x/5 for x > 25, so this holds for all p > 50 and (checking 2 <= n <= 15) for all n > 1. - _Charles R Greathouse IV_, Jul 12 2024
%H A039731 Charles R Greathouse IV, <a href="/A039731/b039731.txt">Table of n, a(n) for n = 2..10000</a>
%H A039731 Jitsuro Nagura, <a href="https://doi.org/10.3792/pja/1195570997">On the interval containing at least one prime number</a>, Proc. Japan Acad. 28: 177-181, 1952.
%F A039731 a(n) = p - nextprime(p/2), where p is the n-th prime, see Greathouse comment. - _Charles R Greathouse IV_, Jul 12 2024
%p A039731 a := proc(n) ithprime(n); % - nextprime(iquo(%, 2)) end: seq(a(n), n = 2..63);
%p A039731 # _Peter Luschny_, Jul 13 2024  (after _Charles R Greathouse IV_)
%t A039731 Map[# - NextPrime[#/2] &, Prime[Range[2, 100]]] (* _Paolo Xausa_, Jul 15 2024, after _Charles R Greathouse IV_ *)
%o A039731 (PARI) a(n)=maxp = 0; for (i = 1, n-1, mp = prime(n) % prime(i); maxp = max(mp, maxp);); maxp; \\ _Michel Marcus_, Oct 01 2013
%o A039731 (PARI) P=primes(100); vector(#P,i,mx=0;for(j=1,i-1, mx=max(P[i]%P[j], mx)); mx)[2..#P] \\ _Charles R Greathouse IV_, Oct 01 2013
%o A039731 (PARI) a(n) = my(p=prime(n)); p - nextprime(p/2) \\ _Charles R Greathouse IV_, Jul 12 2024
%Y A039731 Cf. A000040, A151800, A207409.
%K A039731 nonn,easy
%O A039731 2,2
%A A039731 _Clark Kimberling_