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.
%I A368491 #46 Mar 20 2025 15:10:39 %S A368491 1,5,45,1453,186285,381681581,3126736191405,409827566090715053, %T A368491 214867674970568857223085,1802440697199513680253124870061, %U A368491 967677980931418755473971539884090851245,2078072640579877586820864371518464918573279084461,285608128960093974754528418755948821932657172723113570336685 %N A368491 a(n) is the integer whose bits designate the possible subset sums of the first n prime numbers. %C A368491 Bit position 0 (which is sum 0) is the least significant bit of a(n). %C A368491 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 all n primes marks the other end. Therefore, starting from no primes and adding some and starting from all primes and omitting some correspond to the same pattern. (This is so for any values, not just primes.) %C A368491 It is observed that for an array of primes, for large values of n, the binary string starts with a certain pattern and ends with the reverse of this certain pattern and consists of all ones in the middle area. %F A368491 a(n) = a(n-1) BITOR a(n-1)*2^prime(n). %F A368491 a(n) = 91*2^(A007504(n)-6) - 83 for n > 3. %e A368491 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 which has a value of 1 in base 10. %e A368491 For n = 2, sums of 0,2,3,5 are possible, yielding a binary string of 101101, which has a value of 45 in base 10. The impossibility of sums 1 and 4 is indicated by 0's in the binary string. %e A368491 For n = 3, the primes are 2,3,5 and their subset sums 0, 2, 3, 5, 7, 8, 10 are the positions of 1 bits in a(3) = 1453, %e A368491 10 8 7 5 3 2 0 bit positions %e A368491 a(n) = 1 0 1 1 0 1 0 1 1 0 1 binary %p A368491 a:= proc(n) option remember; `if`(n=0, 1, %p A368491 Bits[Or](a(n-1), a(n-1)*2^ithprime(n))) %p A368491 end: %p A368491 seq(a(n), n=0..15); # _Alois P. Heinz_, Mar 20 2025 %o A368491 (Python) %o A368491 from primesieve import * %o A368491 n = 20 %o A368491 ps = generate_n_primes(n) %o A368491 res = 1 %o A368491 a = [] %o A368491 a.append(res) %o A368491 for v in ps: %o A368491 res = (res | (res << v)) %o A368491 a.append(res) %o A368491 print(a) %Y A368491 Cf. A000040, A082548 (number of sums), A007504 (see formula). %K A368491 base,nonn %O A368491 0,2 %A A368491 _Yigit Oktar_, Dec 27 2023