A382279 a(n) is the integer whose bits encode subset sums of the first n arithmetic numbers (A003601).
1, 3, 27, 891, 57339, 7340027, 15032385531, 123145302310907, 2017612633061982203, 66113130760175032991739, 8665580274997661924293869563, 4543259751217974174964184288067579, 4763953136893138488487244504044754960379, 9990733848941719167408001786146465954679226363
Offset: 0
Examples
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.
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..65
Programs
-
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
-
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)
Formula
a(n) = a(n-1) OR a(n-1)*2^A003601(n) for n>=1, a(0) = 1.
Comments