|
|
A230386
|
|
Least sum of a set of n evil numbers (A001969) such that any two or more add to an odious number (A000069).
|
|
5
|
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
Row sums of A230385: see there for the corresponding sets. See A230387 for a "dual" version.
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?
By definition, this is a subsequence of the odious numbers A000069.
|
|
LINKS
|
|
|
EXAMPLE
|
n=1: {0} with sum = 0,
n=2: {3, 5} with sum = 8,
n=3: {5, 9, 17} or {9, 10, 12} with sum = 31,
n=4: {5, 9, 17, 33} with sum = 64,
n=5: {33, 34, 36, 40, 48} with sum = 191,
n=6: {257, 264, 278, 288, 326, 384} with sum = 1797.
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.
n=7: {801, 802, 804, 808, 816, 4896, 9536} with sum = 18463.
|
|
PROG
|
(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. */
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,more,hard
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|