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.

This page as a plain text file.
%I A100380 #43 Jan 10 2025 10:08:48
%S A100380 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,
%T A100380 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,
%U A100380 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
%N A100380 a(n) = least k such that prime(n) + A002110(k) is prime.
%C A100380 Conjecture: every prime number can be written as +- p(n) -+ p(k)# where p(i)=i-th prime, p(i)#=i-th primorial.
%C A100380 The sequence grows remarkably slowly. The largest number occurring within the first 50000 elements is 90. - _Stefan Steinerberger_, Apr 10 2006
%C A100380 a(1) = 0 is the minimum value of a(n). It is also unrepeated in this sequence. - _Altug Alkan_, Dec 02 2015
%H A100380 Robert Israel, <a href="/A100380/b100380.txt">Table of n, a(n) for n = 1..10000</a> (corrected by Ray Chandler, Jan 19 2019)
%e A100380 prime(8)=19;
%e A100380 19 + 2 = 21 = 3*7,
%e A100380 19 + 6 = 25 = 5*5, and
%e A100380 19 + 30 = 49 = 7*7, but
%e A100380 19 + 210 = 229, which is prime; 210=prime(4)#, so a(8)=4.
%p A100380 primorial:= proc(n) option remember: ithprime(n)*procname(n-1) end proc:
%p A100380 primorial(0):= 1:
%p A100380 f:= proc(n) local k, p;
%p A100380   p:= ithprime(n);
%p A100380   for k from 0 do if isprime(p+primorial(k)) then return k fi od:
%p A100380 end proc:
%p A100380 map(f, [$1..100]);# _Robert Israel_, Aug 27 2015
%t A100380 Table[k := 0;While[Not[PrimeQ[Prime[n]+Product[Prime[i],{i,1,k}]]],k++ ];k,{n,1, 100}] (* _Stefan Steinerberger_, Apr 10 2006 *)
%o A100380 (PARI) primo(n) = prod(i=1, n, prime(i));
%o A100380 a(n) = {k=0; while(!isprime(prime(n)+primo(k)), k++); k;} \\ _Michel Marcus_, Aug 27 2015
%o A100380 (Python)
%o A100380 from itertools import count, islice
%o A100380 from sympy import isprime, prime, primorial
%o A100380 def A002110(n): return primorial(n) if n > 0 else 1
%o A100380 def A100380(n):
%o A100380     pn = prime(n)
%o A100380     return next(k for k in count(0) if isprime(pn+A002110(k)))
%o A100380 print([a(n) for n in range(1, 101)]) # _Michael S. Branicky_, Jan 10 2025
%Y A100380 Cf. A002110, A265109.
%K A100380 easy,nonn
%O A100380 1,4
%A A100380 _Pierre CAMI_, Dec 30 2004
%E A100380 More terms from _Stefan Steinerberger_, Apr 10 2006
%E A100380 a(1) = 0 added and name edited by _Altug Alkan_, Dec 02 2015