login
Least sum of a set of n evil numbers (A001969) such that any two or more add to an odious number (A000069).
5

%I #21 Jan 02 2023 12:30:49

%S 0,8,31,64,191,1797,18463

%N Least sum of a set of n evil numbers (A001969) such that any two or more add to an odious number (A000069).

%C Row sums of A230385: see there for the corresponding sets. See A230387 for a "dual" version.

%C Is this sequence finite, or is there for any n at least one admissible set of n evil numbers, i.e., such that any sum of two or more elements add up to an odious number?

%C By definition, this is a subsequence of the odious numbers A000069.

%H M. F. Hasler, in reply to V. Shevelev, <a href="http://list.seqfan.eu/oldermail/seqfan/2013-October/011785.html">Peculiar sets of evil numbers (Cf. A001969)</a>, SeqFan list, Oct 17 2013

%e The table A230385 reads

%e n=1: {0} with sum = 0,

%e n=2: {3, 5} with sum = 8,

%e n=3: {5, 9, 17} or {9, 10, 12} with sum = 31,

%e n=4: {5, 9, 17, 33} with sum = 64,

%e n=5: {33, 34, 36, 40, 48} with sum = 191,

%e n=6: {257, 264, 278, 288, 326, 384} with sum = 1797.

%e For example, for n=4, all 11 numbers 5+9=14, 5+17=22, 5+33=38, 9+17=26, 9+33=42, 17+33=50, 5+9+17=31, 5+9+33=47, 5+17+33=55, 9+17+33=59, 5+9+17+33=64 are odious.

%e n=7: {801, 802, 804, 808, 816, 4896, 9536} with sum = 18463.

%o (PARI) (is_A69=n->bittest(hammingweight(n),0)); A1969=select(n->!is_A69(n), vector(1600,n,n)) /* no 0 here! */; A230386(n,m=9e9)={ local(v=vector(n,i,i), ve=vector(n,i,A1969[i]), t=0, s=vector(n,i,if(i>1,A230386(i-1))), S(v)=sum(j=1,#v,v[j]), ok(e)=!forstep(i=3,2^#e-1,2, is_A69( S( vecextract( e,i )))||return), inc(i)=for(j=1,n-i,v[j]=j); for(j=n-i+1,n-1, v[j]++<v[j+1] && return(ve[j]=A1969[v[j]]); ve[j]=A1969[v[j]=j])/*end for*/; ve[n]=A1969[v[n]++])/*end local()*/; while( s[n]+ve[n]<m, for(i=2,n, s[n-i+1]+sum(j=n-i+1,n,ve[j]) < m && ok(vecextract(ve,2^n-2^(n-i))) && next; inc(i); next(2)); m>S(ve) && /*print*/([m=S(ve),ve]); inc(n));m} /* This code is very fast up to n=5 and much too slow for n>5. */

%K nonn,more,hard

%O 1,2

%A _Vladimir Shevelev_ and _M. F. Hasler_, Oct 17 2013

%E a(6) added by _M. F. Hasler_, Oct 18 2013

%E a(7) from _Donovan Johnson_, Oct 27 2013