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!)
A276458 Smallest odd number not of the form p + 2^k with p prime and k >= 0 that is divisible by the n-th prime. 1

%I #14 Sep 08 2022 08:46:17

%S 1719,905,959,1199,1807,1207,2983,1541,2465,1271,5143,1271,2279,1927,

%T 2279,1829,5917,1541,1207,2263,3239,7387,4717,1649,6161,4841,7169,

%U 1199,1243,127,10873,959,1529,149,11023,2669,12877,2171,1211,1969,905,1719,7913,7289

%N Smallest odd number not of the form p + 2^k with p prime and k >= 0 that is divisible by the n-th prime.

%C a(n) <= A213529(n).

%H Robert Israel, <a href="/A276458/b276458.txt">Table of n, a(n) for n = 2..3000</a>

%e a(3) = 905 because it is the smallest de Polignac number (A006285) divisible by the third prime.

%p N:= 10^5: # to use de Polignac numbers <= N

%p P:= select(isprime,{2,seq(i,i=3..N,2)}):

%p dP:= {seq(i,i=1..N,2)}:

%p for k from 0 to ilog2(N) do

%p dP:= dP minus map(`+`,P,2^k)

%p od:

%p for m from 2 do

%p R:= ListTools:-SelectFirst(1, t -> t mod P[m] = 0, dP);

%p if R = {} then break fi;

%p A[m]:= R[1];

%p od:

%p seq(A[i],i=2..m-1); # _Robert Israel_, Sep 06 2016

%o (Magma) lst:=[]; for r in [2..45] do p:=NthPrime(r); n:=-p; f:=0; while IsZero(f) do n:=n+2*p; k:=-1; repeat k+:=1; a:=n-2^k; until a lt 1 or IsPrime(a); if a lt 1 then Append(~lst, n); f:=1; end if; end while; end for; lst;

%Y Cf. A006285, A098237, A213529.

%K nonn

%O 2,1

%A _Arkadiusz Wesolowski_, Sep 03 2016

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 23 11:35 EDT 2024. Contains 371912 sequences. (Running on oeis4.)