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 A354538 #42 Jun 10 2024 13:31:38 %S A354538 1,3,8,17,44,125,368,1097,3284,9845,29528,88577,265724,797165,2391488, %T A354538 7174457,21523364,64570085,193710248,581130737,1743392204,5230176605, %U A354538 15690529808,47071589417,141214768244,423644304725,1270932914168,3812798742497,11438396227484 %N A354538 a(n) is the least k such that A322523(k) = n. %C A354538 Linked to its derivation from A322523, this sequence has a natural description: "Given a series of boxes (starting at 0), put each positive integer, in sequence, in the first box in which it is not the sum of two different numbers already in that box. The sequence is the smallest number in each box." %C A354538 The sequence and associated partition are closely related to powers of 3. %H A354538 Paolo Xausa, <a href="/A354538/b354538.txt">Table of n, a(n) for n = 0..1000</a> %H A354538 <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (4,-3). %F A354538 For n >= 2, a(n) = (3^n + 7)/2. %F A354538 For n >= 0, the contents of the n-th box are (conjecture): %F A354538 1) All the positive integers == b(i) mod 3^(n+1) where 1 <= i <= 2^n and {b(i)} is some strictly increasing sequence of 2^n integers such that b(1)=a(n), b(2^n)= 5*3^(n-1). %F A354538 2) The additional 'misfit' entry 2*3^n. %F A354538 [For the correctness and the formula and the conjecture see A322523. - _Jianing Song_, Oct 17 2022] %e A354538 1, 2 go in box 0 {1,2}; %e A354538 3=1+2 so goes in box 1 {3}; %e A354538 4 goes in box 0 {1,2,4}; %e A354538 5=1+4 so goes in box 1 {3,5}; %e A354538 6=2+4 so goes in box 1 {3,5,6}; %e A354538 7 goes in box 0 {1,2,4,7}; %e A354538 8=7+1=3+5 so goes in box 2 {8}; %e A354538 ... %e A354538 Box 0: {1,2,4,7,10,13,16,19,22,...} = {1} mod 3 U misfit entry 2; %e A354538 Box 1: {3,5,6,12,14,21,23,...} = {3,5} mod 9 U misfit entry 6; %e A354538 Box 2: {{8,9,11,15} mod 27} U {18}; %e A354538 Box 3: {{17,20,24,26,27,29,33,45} mod 81} U {54}; %e A354538 ... %t A354538 Join[{1, 3}, (3^Range[2, 50] + 7)/2] (* or *) %t A354538 LinearRecurrence[{4, -3}, {1, 3, 8, 17}, 50] (* _Paolo Xausa_, Jun 10 2024 *) %o A354538 (Python) %o A354538 from itertools import count %o A354538 def A354538(n): %o A354538 for k in count(1): %o A354538 c, m = 0, k %o A354538 while not (a:=divmod(m,3))[1]: %o A354538 c += 1 %o A354538 m = a[0] %o A354538 if not (m==2 or m%3==1): %o A354538 c += 1 %o A354538 m = (m+1)//3-2 %o A354538 while (a:=divmod(m,3))[1]: %o A354538 c += 1 %o A354538 m = a[0] %o A354538 if c == n: return k # _Chai Wah Wu_, Oct 15 2022 %o A354538 def A354538(n): return (n<<1)+1 if n<2 else 3**n+7>>1 # based on formula, _Chai Wah Wu_, Oct 15 2022 %Y A354538 Cf. A322523. %K A354538 nonn,easy %O A354538 0,2 %A A354538 _Hugh Williamson_, Aug 17 2022 %E A354538 a(7)-a(15) from _Michel Marcus_, Sep 23 2022 %E A354538 a(16)-a(20) from _Chai Wah Wu_, Oct 15 2022 %E A354538 a(21)-a(28) from _Paolo Xausa_, Jun 10 2024