login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

a(n) = A108422(n) - A108421(n).
3

%I #11 Mar 26 2018 19:52:22

%S 0,0,0,1,0,1,0,1,2,2,1,0,1,2,0,3,2,2,2,3,3,3,1,2,2,4,1,3,3,3,0,1,0,4,

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

%U 5,4,3,4,4,5,3,5,5,5,2,3,4,4,4,5,3,6,1,3,5,3,1,5,4,2,1,4,4,6,4,4,4,6,2,6,4

%N a(n) = A108422(n) - A108421(n).

%C a(A000079(n)) = 0.

%H Robert Israel, <a href="/A108423/b108423.txt">Table of n, a(n) for n = 2..10000</a>

%p N:= 200: # to get a(2)..a(N)

%p Primes:= select(isprime, [seq(i, i=3..2*N-3, 2)]):

%p Ones:= map(t -> convert(convert(t, base, 2), `+`), Primes):

%p VL:= Vector(N): VL[2]:= 2:

%p VH:= Vector(N): VH[2]:= 2:

%p for i from 1 to nops(Primes) do

%p p:= Primes[i];

%p for j from 1 to i do

%p k:= (p+Primes[j])/2;

%p if k > N then break fi;

%p t:= Ones[i]+Ones[j];

%p if t > VH[k] then VH[k]:= t fi;

%p if VL[k]=0 or t < VL[k] then VL[k]:= t fi;

%p od

%p od:

%p convert((VH-VL)[2..N], list); # _Robert Israel_, Mar 26 2018

%K nonn,base

%O 2,9

%A _Reinhard Zumkeller_, Jun 03 2005