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.

A179295 a(n) is the least prime number such that prime(n)+a(n)+1 is a prime or -1 if no such prime number exists.

This page as a plain text file.
%I A179295 #60 May 09 2021 08:18:24
%S A179295 2,3,5,3,5,3,5,3,5,7,5,3,5,3,5,5,7,5,3,7,5,3,5,7,3,5,3,5,3,13,3,5,11,
%T A179295 11,7,5,5,3,5,5,11,11,5,3,13,11,11,3,5,3,5,11,29,5,5,5,7,5,3,11,23,13,
%U A179295 3,5,3,13,5,11,5,3,5,7,5,5,3,5,7,3,7,11,11
%N A179295 a(n) is the least prime number such that prime(n)+a(n)+1 is a prime or -1 if no such prime number exists.
%C A179295 If Maillet's conjecture is true, then a(n) != -1 for all n. - _Chai Wah Wu_, Aug 01 2017
%H A179295 Chai Wah Wu, <a href="/A179295/b179295.txt">Table of n, a(n) for n = 1..10000</a>
%H A179295 Wen Huang and XiaoSheng Wu, <a href="https://doi.org/10.1090/proc/13533">On the set of the difference of primes</a>,  Proc. Amer. Math. Soc. 145 (2017), 3787-3793.
%H A179295 E. Maillet, <a href="https://archive.org/stream/lintermdiairede02lemogoog#page/n451/mode/2up">Réponse</a>, L’intermédiaire des math. 12 (1905), p. 108.
%e A179295 a(1) = 2, since prime(1) + 2 + 1 = 5.
%t A179295 Table[Block[{p=2}, While[!PrimeQ[Prime[n] + p + 1], p=NextPrime[p]]; p],{n, 100}] (* _Indranil Ghosh_, Jun 30 2017 *)
%o A179295 (ANS Forth)
%o A179295 \ https://github.com/Lehs/ANS-Forth-libraries
%o A179295 s" numbertheory.4th" included
%o A179295 : get_number \ p -- q
%o A179295   locals| p | 1
%o A179295   begin nextprime dup p + 1+ isprime
%o A179295   until ;
%o A179295 : list_numbers \ N --
%o A179295   locals| N | 1
%o A179295   begin nextprime dup
%o A179295      get_number cr .
%o A179295      dup N >
%o A179295   until ;
%o A179295 (PARI) a(n) = my(pn=prime(n), p=2); while(! isprime(pn+p+1), p = nextprime(p+1)); p; \\ _Michel Marcus_, Jun 30 2017
%o A179295 (Python)
%o A179295 from sympy import prime, isprime, nextprime
%o A179295 def a(n):
%o A179295     p=2
%o A179295     while not isprime(prime(n) + p + 1): p=nextprime(p)
%o A179295     return p
%o A179295 print([a(n) for n in range(1, 101)]) # _Indranil Ghosh_, Jun 30 2017
%K A179295 nonn
%O A179295 1,1
%A A179295 _Lars-Erik Svahn_, Jun 21 2017
%E A179295 Definition clarified by _Chai Wah Wu_, Aug 01 2017
%E A179295 More terms from _Chai Wah Wu_, Aug 02 2017