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.

A108422 Greatest number of ones that can be used to write in binary representation 2*n as sum of two primes.

This page as a plain text file.
%I A108422 #21 Sep 02 2024 21:57:48
%S A108422 2,4,4,5,5,6,5,6,6,6,6,6,6,7,6,7,7,8,7,8,8,8,7,8,8,9,7,8,9,10,7,8,8,9,
%T A108422 8,9,9,10,8,9,9,8,9,10,10,10,8,8,9,9,9,10,10,10,9,9,8,10,10,10,8,10,8,
%U A108422 9,9,10,9,10,10,9,9,10,9,11,9,10,11,12,9,10,10,10,10,11,9,12,8,9,11,10,8,12
%N A108422 Greatest number of ones that can be used to write in binary representation 2*n as sum of two primes.
%C A108422 a(n) = Max{A000120(p)+A000120(q) : p,q prime and p+q=2*n}.
%C A108422 a(n) = A108423(n) + A108421(n).
%H A108422 Robert Israel, <a href="/A108422/b108422.txt">Table of n, a(n) for n = 2..10000</a>
%H A108422 <a href="/index/Go#Goldbach">Index entries for sequences related to Goldbach conjecture</a>
%H A108422 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%p A108422 N:= 200: # to get a(2)..a(N)
%p A108422 Primes:= select(isprime, [seq(i, i=3..2*N-3, 2)]):
%p A108422 Ones:= map(t -> convert(convert(t, base, 2), `+`), Primes):
%p A108422 V:= Vector(N): V[2]:= 2:
%p A108422 for i from 1 to nops(Primes) do
%p A108422   p:= Primes[i];
%p A108422   for j from 1 to i do
%p A108422     k:= (p+Primes[j])/2;
%p A108422     if k > N then break fi;
%p A108422     t:= Ones[i]+Ones[j];
%p A108422     if t > V[k] then V[k]:= t fi
%p A108422   od
%p A108422 od:
%p A108422 convert(V[2..N], list); # _Robert Israel_, Mar 26 2018
%Y A108422 Cf. A004676, A005843, A007088, A108421.
%K A108422 nonn,base
%O A108422 2,1
%A A108422 _Reinhard Zumkeller_, Jun 03 2005