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.
%I A382834 #53 Apr 17 2025 19:25:09 %S A382834 -5,-17,-17,97,2143,29747,510151,9699167,223092031,6469692277, %T A382834 200560488763,7420738133141,304250263525363,13082761331667823, %U A382834 614889782588488607,32589158477190041261,1922760350154212635351,117288381359406970978787,7858321551080267055874051 %N A382834 Smallest number k > P(n) - prime(n+1)^2 which is coprime to P(n), where P(n)= A002110(n) are the primorials. %C A382834 The difference d = P(n) - k is also coprime to P(n), and satisfies d < prime(n+1)^2, which means it must be prime since composite d would have at least one prime factor <= prime(n). %C A382834 There is always at least one prime strictly between prime(n) and prime(n+1)^2, consequently d is the largest prime < prime(n+1)^2, and so a(n) = A002110(n) - A054270(n+1). %C A382834 There are no negative terms after a(3). %H A382834 Jakub Buczak and Antony Theodorakopoulos, <a href="https://zenodo.org/records/15162501">How primorials can be used to generate primes</a>. %e A382834 a(4) = 97, since 2*3*5*7 - 11^2 = 89, the smallest number coprime to 2*3*5*7 greater than 89 is 97. %e A382834 a(2) = -17, since 2*3 - 5^2 = -19, the smallest number x>-19 coprime here is thus -17, and its difference d = 30 -(-17) = 47 is the largest prime < 7^2. %o A382834 (PARI) a(n) = my(P=vecprod(primes(n)), k=P-prime(n+1)^2+1); while (gcd(k,P)!=1, k++); k; \\ _Michel Marcus_, Apr 07 2025 %Y A382834 Cf. A002110, A034386, A054270, A064819. %K A382834 sign,easy %O A382834 1,1 %A A382834 _Jakub Buczak_, Apr 06 2025