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.

A038711 a(n) is the smallest m such that A002110(n) + m is prime.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 17, 19, 23, 37, 61, 1, 61, 71, 47, 107, 59, 61, 109, 89, 103, 79, 151, 197, 101, 103, 233, 223, 127, 223, 191, 163, 229, 643, 239, 157, 167, 439, 239, 199, 191, 199, 383, 233, 751, 313, 773, 607, 313, 383, 293, 443, 331, 283, 277, 271, 401, 307
Offset: 0

Views

Author

Labos Elemer, May 02 2000

Keywords

Comments

Any composite a(n) would disprove Fortune's conjecture, see A005235. - Jeppe Stig Nielsen, Oct 31 2003

Examples

			For n=11, 1 + A002110(11) = 200560490131 < 200560490197 = 67 + A002110(11); therefore, a(11)=1 but A005235(11)=67.
		

Crossrefs

Programs

  • Maple
    p:= proc(n) option remember; `if`(n<1, 1, p(n-1)*ithprime(n)) end:
    a:= n-> nextprime(p(n))-p(n):
    seq(a(n), n=0..60);  # Alois P. Heinz, Mar 16 2020
  • Mathematica
    nmax=2^16384; npd=1;n=1;npd=npd*Prime[n]; While[npdLei Zhou, Feb 15 2005 *)
  • PARI
    a(n) = my(P=vecprod(primes(n))); nextprime(P+1) - P; \\ Michel Marcus, Dec 12 2023

Formula

a(n) = Min(1, A005235(n)); a(n)=1 for n=1, 2, 3, 4, 5, 11, 75, ...
a(n) = 1 for n=0, 1, 2, 3, 4, 5, 11, 75, ... (A014545); a(n) = A005235(n) otherwise. - Jeppe Stig Nielsen, Oct 31 2003
a(n) = A038710(n) - A002110(n). - Alois P. Heinz, Mar 16 2020

Extensions

a(0)=1 prepended by Alois P. Heinz, Mar 16 2020