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 A332788 #20 May 12 2022 10:01:48 %S A332788 5,31,59,107,271,223,269,313,647,457,503,941,1579,12919,3571,1667, %T A332788 2897,3037,3187,1993,3461,2179,10141,5927,11969,4957,13627,5519,22787, %U A332788 3851,3889,3929,15217,44221,65867,21799,10211,31727,24623,11467,6983,7039,16651,73351 %N A332788 Positive-pan primes (see Comments). %C A332788 Take a double-pan balance scale and name the pans "negative" and "positive". At each step, the question is: "Is there an unused prime that would balance the scale if added to the positive pan?" If the answer is yes, add that prime to the positive pan. Otherwise, add the smallest unused prime to the negative pan. %C A332788 Is the number of primes in the positive pan (P) infinite? If it is, is fractalization of P, i.e., further subdivision into PN and PP subpans, possible (including infinitely)? %H A332788 Michael S. Branicky, <a href="/A332788/b332788.txt">Table of n, a(n) for n = 1..10000</a> %e A332788 2 and 3 unbalance the scale (and go to the negative pan N), but 5 = 2 + 3 balances it (and goes to the positive pan P). %t A332788 a[1]=-2;a[n_]:=a[n]=Module[{tab=Table[a[i],{i,1,n-1}], %t A332788 totalN=Abs[Total[Select[Table[a[i],{i,1,n-1}],Negative]]], %t A332788 totalP=Total[Select[Table[a[i],{i,1,n-1}],Positive]], %t A332788 l=NextPrime[Last[Select[Table[a[i],{i,1,n-1}],Negative]],-1], %t A332788 m=NextPrime[Abs[Last[Select[Table[a[i],{i,1,n-1}],Negative]]]]}, %t A332788 If[totalN==totalP, %t A332788 If[PrimePi[tab[[-1]]]-PrimePi[Abs[tab[[-2]]]]==1,-NextPrime[tab[[-1]]], %t A332788 If[FreeQ[Abs[tab],m],-m,While[! FreeQ[Abs[tab],m],m=NextPrime[m]];-m]], %t A332788 If[PrimeQ[totalN-totalP]&&FreeQ[Abs[tab],totalN-totalP],totalN-totalP, %t A332788 If[FreeQ[Abs[tab],Abs[l]],l,While[!FreeQ[Abs[tab],Abs[l]],l=NextPrime[l,-1]];l] %t A332788 ]]];Select[a/@Range[370],Positive] %o A332788 (Python) %o A332788 from itertools import islice %o A332788 from sympy import isprime, nextprime %o A332788 def agen(): # generator of terms %o A332788 used, d, nextp = set(), 0, 2 %o A332788 while True: %o A332788 if d > 0 and d not in used and isprime(d): %o A332788 used.add(d); yield d; d = 0 %o A332788 while nextp in used: %o A332788 nextp = nextprime(nextp) %o A332788 used.add(nextp); d += nextp %o A332788 print(list(islice(agen(), 44))) # _Michael S. Branicky_, May 12 2022 %Y A332788 Cf. A075326, A332341, A332787. %K A332788 nonn %O A332788 1,1 %A A332788 _Ivan N. Ianakiev_, Feb 24 2020 %E A332788 a(41) and beyond from _Michael S. Branicky_, May 12 2022