OFFSET
0,2
COMMENTS
Bit position 0 (which is sum 0) is the least significant bit of a(n).
The resulting binary string is palindromic for all n. A subset sum of zero marks one end of the binary string, while the sum of the first n arithmetic numbers marks the other end. This is true for all sets of positive integers. See A368491 for the encoding applied to the first n primes.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..65
FORMULA
a(n) = a(n-1) OR a(n-1)*2^A003601(n) for n>=1, a(0) = 1.
EXAMPLE
For n = 0, there are no terms from which to calculate a subset sum. An empty array gives zero as the only possible sum. This is designated by the binary string 1.
For n = 2, sums of 0, 1, 3, 4 are possible, yielding a binary string of 11011, which has a value of 27 in base 10. The impossibility of the sum 2 is indicated by 0 in the binary string.
For n = 3, the arithmetic numbers are 1,3,5 and their subset sums 0, 1, 3, 4, 5, 6, 8, 9 are the positions of 1 bits in a(3) = 891.
MAPLE
b:= proc(n) option remember; uses numtheory; local k; for k from 1+
`if`(n=1, 0, b(n-1)) while irem(sigma(k), tau(k))>0 do od; k
end:
a:= proc(n) option remember; `if`(n=0, 1,
Bits[Or](a(n-1), a(n-1)*2^b(n)))
end:
seq(a(n), n=0..20); # Alois P. Heinz, Mar 20 2025
PROG
(Python)
from sympy import divisors, divisor_count
n = 20
tn = [a for a in range(1, n) if not sum(divisors(a)) % divisor_count(a)] #code from A003601
res = 1
a = []
a.append(res)
for v in tn:
res = (res | (res << v))
a.append(res)
print(a)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Yigit Oktar, Mar 20 2025
STATUS
approved
