login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A068374 Primes p such that positive values of p - A002110(k) are all primes for k > 0. 2

%I #26 Feb 16 2021 00:59:40

%S 2,5,13,19,43,73,103,109,229,313,883,1093,1489,1699,1789,2143,3463,

%T 3853,5653,15649,21523,43789,47743,50053,51199,59473,86293,88819,

%U 93493,101533,176053,197299,205663,235009,257503,296509,325543,338413,347989

%N Primes p such that positive values of p - A002110(k) are all primes for k > 0.

%H Robert Israel, <a href="/A068374/b068374.txt">Table of n, a(n) for n = 1..121</a>

%p primo:= proc(k) option remember; ithprime(k)*procname(k-1) end proc:

%p primo(1):= 2:

%p filter:= proc(p)

%p local k;

%p if not isprime(p) then return false fi;

%p for k from 1 do

%p if primo(k) >= p then return true

%p elif not isprime(p - primo(k)) then return false

%p fi

%p od

%p end proc:

%p select(filter, [2,seq(i,i=3..10^6,2)]); # _Robert Israel_, Dec 14 2015

%t s = Table[Product[Prime@ k, {k, n}], {n, 12}]; Select[Prime@ Range@ 30000, AllTrue[# - TakeWhile[s, Function[k, k < #]], PrimeQ@ # && # > 0 &] &] (* _Michael De Vlieger_, Dec 14 2015, Version 10 *)

%o (PARI) primo(n) = prod(k=1, n, prime(k));

%o isok(p) = {my(k=1); while ((pp=primo(k)) < p, if (! isprime(p-pp), return (0)); k++;); return (1);}

%o lista(nn) = forprime(p=2, nn, if (isok(p), print1(p, ", "));); \\ _Michel Marcus_, Dec 14 2015

%o (MATLAB)

%o Primes = primes(10^8);

%o A = Primes;

%o primorial = 1;

%o for k =1:10

%o primorial = primorial*Primes(k);

%o j = find(A > primorial,1,'first');

%o if numel(j) == 0

%o break

%o end

%o A = [A(1:j-1),intersect(A(j:end),Primes + primorial)];

%o end

%o A % _Robert Israel_, Dec 14 2015

%Y Cf. A002110.

%K easy,nonn

%O 1,1

%A _Naohiro Nomoto_, Mar 01 2002

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 18 22:18 EDT 2024. Contains 371782 sequences. (Running on oeis4.)