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.

A137330 a(n) = primorial(k) - prime(n) where k is the smallest number for which prime(n) <= primorial(k).

Original entry on oeis.org

0, 3, 1, 23, 19, 17, 13, 11, 7, 1, 179, 173, 169, 167, 163, 157, 151, 149, 143, 139, 137, 131, 127, 121, 113, 109, 107, 103, 101, 97, 83, 79, 73, 71, 61, 59, 53, 47, 43, 37, 31, 29, 19, 17, 13, 11, 2099, 2087, 2083, 2081, 2077, 2071, 2069, 2059, 2053, 2047, 2041
Offset: 1

Views

Author

Ctibor O. Zizka, Apr 07 2008

Keywords

Comments

Does each prime number appear in this sequence at least once?
Answer to previous: Neither 2 nor 5 will appear, as no prime > 5 can end in a 5 or be even. - Bill McEachen, Dec 05 2020

Examples

			a(6) = primorial(3) - prime(6) = 30-13 = 17.
		

Crossrefs

Programs

  • Mathematica
    Block[{a = {}, P = 2, j = 1}, Do[AppendTo[a, If[# > P, j++; P *= Prime[j], P] - #] &@ Prime[n], {n, 57}]; a] (* Michael De Vlieger, Dec 07 2020 *)
  • PARI
    a(n) = {my(pp=2, k=1, p=prime(n)); while (pp < p, k++; pp*=prime(k)); pp-p;} \\ Michel Marcus, Dec 06 2020