cp's OEIS Frontend

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.

A060276 a(1) = 2; a(n) = smallest prime > a(n-1) such that the sum of any three nondecreasing terms, chosen from a(1), ..., a(n-1) and a(n), is unique.

This page as a plain text file.
%I A060276 #18 Sep 05 2023 18:26:10
%S A060276 2,3,7,19,59,73,211,257,631,919,1291,1979,3229,4397,5557,7151,10657,
%T A060276 12049,17827,19577,25919,32143,35951,46141,54499,64433,81199,92507,
%U A060276 116009,132511,145303,171763,193679,232417,260549,289573,302009,340111,424967,465151,506507
%N A060276 a(1) = 2; a(n) = smallest prime > a(n-1) such that the sum of any three nondecreasing terms, chosen from a(1), ..., a(n-1) and a(n), is unique.
%H A060276 Chai Wah Wu, <a href="/A060276/b060276.txt">Table of n, a(n) for n = 1..194</a>
%e A060276 For {2,3,5} the sums are not unique: 2+2+5 = 3+3+3. Three terms chosen from {2,3,7} can be 2+2+2; 2+2+3; 2+3+3; 3+3+3; 2+2+7; 2+3+7; 3+3+7; 2+7+7; 3+7+7; 7+7+7; the sums are all distinct, so a(3) = 7.
%o A060276 (PARI) {unique(v)=local(b); b=1; for(j=2,length(v),if(v[j-1]==v[j],b=0)); b}
%o A060276 {news(v,q)=local(s); s=[]; for(i=1,length(v),s=concat(s,v[i]+q)); s}
%o A060276 {m=310000; print1(p=2,","); w1=[p]; w2=[p+p]; w3=[p+p+p]; q=nextprime(p+1); while(q<m,y1=concat(w1,q); y2=concat(w2,news(y1,q)); y3=vecsort(concat(w3,news(y2,q))); if(unique(y3),w1=y1; w2=y2; w3=y3; print1(q,",")); q=nextprime(q+1))}
%o A060276 (Python)
%o A060276 from itertools import count, islice
%o A060276 from sympy import nextprime
%o A060276 def A060276_gen(): # generator of terms
%o A060276     aset1, aset2, aset3, alist, k = set(), set(), set(), [], 2
%o A060276     while True:
%o A060276         bset2, bset3 = {k<<1}, {3*k}
%o A060276         if 3*k not in aset3:
%o A060276             for d in aset1:
%o A060276                 if (m:=d+(k<<1)) in aset3:
%o A060276                     break
%o A060276                 bset2.add(d+k)
%o A060276                 bset3.add(m)
%o A060276             else:
%o A060276                 for d in aset2:
%o A060276                     if (m:=d+k) in aset3:
%o A060276                         break
%o A060276                     bset3.add(m)
%o A060276                 else:
%o A060276                     yield k
%o A060276                     alist.append(k)
%o A060276                     aset1.add(k)
%o A060276                     aset2.update(bset2)
%o A060276                     aset3.update(bset3)
%o A060276         k = nextprime(k)
%o A060276 A060276_list = list(islice(A060276_gen(),40)) # _Chai Wah Wu_, Sep 05 2023
%Y A060276 Cf. A051912.
%K A060276 nonn
%O A060276 1,1
%A A060276 _Naohiro Nomoto_, Mar 23 2001
%E A060276 Edited and extended by _Klaus Brockhaus_, May 16 2003
%E A060276 More terms from _Chai Wah Wu_, Sep 05 2023