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.
2, 3, 7, 19, 59, 73, 211, 257, 631, 919, 1291, 1979, 3229, 4397, 5557, 7151, 10657, 12049, 17827, 19577, 25919, 32143, 35951, 46141, 54499, 64433, 81199, 92507, 116009, 132511, 145303, 171763, 193679, 232417, 260549, 289573, 302009, 340111, 424967, 465151, 506507
Offset: 1
Keywords
Examples
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.
Links
- Chai Wah Wu, Table of n, a(n) for n = 1..194
Crossrefs
Cf. A051912.
Programs
-
PARI
{unique(v)=local(b); b=1; for(j=2,length(v),if(v[j-1]==v[j],b=0)); b} {news(v,q)=local(s); s=[]; for(i=1,length(v),s=concat(s,v[i]+q)); s} {m=310000; print1(p=2,","); w1=[p]; w2=[p+p]; w3=[p+p+p]; q=nextprime(p+1); while(q
-
Python
from itertools import count, islice from sympy import nextprime def A060276_gen(): # generator of terms aset1, aset2, aset3, alist, k = set(), set(), set(), [], 2 while True: bset2, bset3 = {k<<1}, {3*k} if 3*k not in aset3: for d in aset1: if (m:=d+(k<<1)) in aset3: break bset2.add(d+k) bset3.add(m) else: for d in aset2: if (m:=d+k) in aset3: break bset3.add(m) else: yield k alist.append(k) aset1.add(k) aset2.update(bset2) aset3.update(bset3) k = nextprime(k) A060276_list = list(islice(A060276_gen(),40)) # Chai Wah Wu, Sep 05 2023
Extensions
Edited and extended by Klaus Brockhaus, May 16 2003
More terms from Chai Wah Wu, Sep 05 2023