login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Minimal m>=0 such that prime(n)+2*m-1 has form 2^k*p, where k>=0 and p is prime.
1

%I #30 Mar 18 2019 12:59:48

%S 1,0,0,0,0,0,0,1,0,0,1,1,0,1,0,0,0,1,1,2,1,1,0,0,0,2,1,0,2,0,1,2,0,2,

%T 0,1,1,1,0,0,0,2,1,0,3,2,1,1,0,2,0,3,2,2,0,0,0,1,1,2,1,0,4,2,1,0,1,4,

%U 0,2,0,0,1,2,2,0,0,1,2,2,2,1,3,2,4,2,0

%N Minimal m>=0 such that prime(n)+2*m-1 has form 2^k*p, where k>=0 and p is prime.

%C Or, for n>2, a(n) is the minimal m>=0 such that the divided on prime(n) sum of prime(n) consecutive integers beginning with m has form 2^k*p, where k>=0 and p is prime.

%C a(n)=0 if and only if prime(n) is in A074781. - _Robert Israel_, Mar 18 2019

%H Robert Israel, <a href="/A209287/b209287.txt">Table of n, a(n) for n = 1..10000</a>

%e Let n=7. Then prime(7)=17 and, for m=0, 17+2m-1=16=2^3*p, where p=2. Thus a(7)=0.

%p f:= proc(n) local v,m,p;

%p p:= ithprime(n)-3;

%p for m from 0 do

%p p:= p+2;

%p v:= p/2^padic:-ordp(p,2);

%p if v=1 or isprime(v) then return m fi

%p od;

%p end proc:

%p f(1):= 1:

%p map(f, [$1..100]); # _Robert Israel_, Mar 18 2019

%t good[n_] := Module[{k = n/2^IntegerExponent[n, 2]}, n > 1 && (k == 1 || PrimeQ[k])]; Table[p = Prime[n]; m = 0; While[! good[p + 2*m - 1], m++]; m, {n, 87}] (* _T. D. Noe_, Feb 26 2013 *)

%Y Cf. A074781.

%K nonn

%O 1,20

%A _Vladimir Shevelev_, Feb 18 2013

%E More terms from _T. D. Noe_, Feb 26 2013