login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A062065 a(1) = 1; for n >= 1, a(n+1) is smallest number such that the sums of any one, two or three of a(1), ..., a(n) are distinct (repetitions not allowed). 3

%I #21 Sep 12 2023 02:04:24

%S 1,2,4,8,15,28,52,96,165,278,460,663,980,1332,1864,2609,3375,4769,

%T 5600,6776,9141,11505,14453,17404,21904,25023,31159,35006,42780,51792,

%U 55799,68834,75036,87163,96746,116231,128924,144085,172606,193507,207826

%N a(1) = 1; for n >= 1, a(n+1) is smallest number such that the sums of any one, two or three of a(1), ..., a(n) are distinct (repetitions not allowed).

%H Chai Wah Wu, <a href="/A062065/b062065.txt">Table of n, a(n) for n = 1..230</a>

%e 1,2,1+2 are different so a(2) = 2; 1,2,3,1+2,1+3,2+3,1+2+3 are not all different (3 = 1+2) so a(3) is not 3; 1,2,4,1+2,1+4,2+4,1+2+4 are all different so a(3) = 4.

%o (PARI)

%o {unique(v)=local(b); b=1; for(j=2,length(v),if(v[j-1]==v[j],b=0)); b}

%o {news(v,q)=local(s); s=[]; for(i=1,length(v),s=concat(s,v[i]+q)); s}

%o {m=210000; print1(p=1,","); w1=[p]; w2=[]; w3=[]; q=p+1; while(q<m,y1=concat(w1,q); y2=concat(w2,news(w1,q)); y3=concat(w3,news(w2,q)); if(unique(vecsort(concat(concat(y1,y2),y3))),w1=y1; w2=y2; w3=y3; print1(q,",")); q=q+1)} \\ _Klaus Brockhaus_, May 17 2003

%o (Python)

%o from itertools import count, islice

%o def A062065_gen(): # generator of terms

%o aset2, aset3, alist = set(), set(), [1]

%o yield 1

%o for k in count(2):

%o bset2, bset3 = set(), set()

%o if not (k in aset2 or k in aset3):

%o for a in alist:

%o if (b2:=a+k) in aset2 or b2 in aset3:

%o break

%o bset2.add(b2)

%o else:

%o for a2 in aset2:

%o if (b3:=a2+k) in aset2 or b3 in aset3:

%o break

%o bset3.add(b3)

%o else:

%o yield k

%o alist.append(k)

%o aset2.update(bset2)

%o aset3.update(bset3)

%o A062065_list = list(islice(A062065_gen(),20)) # _Chai Wah Wu_, Sep 10 2023

%Y Cf. A036241, A051912.

%K nonn

%O 1,2

%A _Olivier GĂ©rard_, Jun 26 2001

%E More terms from _Naohiro Nomoto_, Oct 07 2001

%E Terms a(27) to a(41) from _Klaus Brockhaus_, May 17 2003

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 04:13 EDT 2024. Contains 371235 sequences. (Running on oeis4.)