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.

A382834 Smallest number k > P(n) - prime(n+1)^2 which is coprime to P(n), where P(n)= A002110(n) are the primorials.

Original entry on oeis.org

-5, -17, -17, 97, 2143, 29747, 510151, 9699167, 223092031, 6469692277, 200560488763, 7420738133141, 304250263525363, 13082761331667823, 614889782588488607, 32589158477190041261, 1922760350154212635351, 117288381359406970978787, 7858321551080267055874051
Offset: 1

Views

Author

Jakub Buczak, Apr 06 2025

Keywords

Comments

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).
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).
There are no negative terms after a(3).

Examples

			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.
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.
		

Crossrefs

Programs

  • 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