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.

A100380 a(n) = least k such that prime(n) + A002110(k) is prime.

Original entry on oeis.org

0, 1, 1, 2, 1, 2, 1, 4, 2, 1, 2, 2, 1, 3, 2, 2, 1, 2, 2, 1, 2, 3, 2, 5, 2, 1, 2, 1, 3, 5, 3, 2, 1, 4, 1, 2, 2, 3, 2, 2, 1, 3, 1, 2, 1, 3, 3, 2, 1, 4, 2, 1, 3, 2, 2, 2, 1, 2, 2, 1, 3, 4, 2, 1, 4, 3, 2, 3, 1, 3, 2, 3, 2, 2, 3, 2, 3, 4, 3, 3, 1, 4, 1, 2, 5, 2, 3, 2, 1, 4, 4, 3, 5, 3, 4, 2, 4, 1, 4, 2
Offset: 1

Views

Author

Pierre CAMI, Dec 30 2004

Keywords

Comments

Conjecture: every prime number can be written as +- p(n) -+ p(k)# where p(i)=i-th prime, p(i)#=i-th primorial.
The sequence grows remarkably slowly. The largest number occurring within the first 50000 elements is 90. - Stefan Steinerberger, Apr 10 2006
a(1) = 0 is the minimum value of a(n). It is also unrepeated in this sequence. - Altug Alkan, Dec 02 2015

Examples

			prime(8)=19;
19 + 2 = 21 = 3*7,
19 + 6 = 25 = 5*5, and
19 + 30 = 49 = 7*7, but
19 + 210 = 229, which is prime; 210=prime(4)#, so a(8)=4.
		

Crossrefs

Programs

  • Maple
    primorial:= proc(n) option remember: ithprime(n)*procname(n-1) end proc:
    primorial(0):= 1:
    f:= proc(n) local k, p;
      p:= ithprime(n);
      for k from 0 do if isprime(p+primorial(k)) then return k fi od:
    end proc:
    map(f, [$1..100]);# Robert Israel, Aug 27 2015
  • Mathematica
    Table[k := 0;While[Not[PrimeQ[Prime[n]+Product[Prime[i],{i,1,k}]]],k++ ];k,{n,1, 100}] (* Stefan Steinerberger, Apr 10 2006 *)
  • PARI
    primo(n) = prod(i=1, n, prime(i));
    a(n) = {k=0; while(!isprime(prime(n)+primo(k)), k++); k;} \\ Michel Marcus, Aug 27 2015
    
  • Python
    from itertools import count, islice
    from sympy import isprime, prime, primorial
    def A002110(n): return primorial(n) if n > 0 else 1
    def A100380(n):
        pn = prime(n)
        return next(k for k in count(0) if isprime(pn+A002110(k)))
    print([a(n) for n in range(1, 101)]) # Michael S. Branicky, Jan 10 2025

Extensions

More terms from Stefan Steinerberger, Apr 10 2006
a(1) = 0 added and name edited by Altug Alkan, Dec 02 2015