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.

User: Hugh Williamson

Hugh Williamson's wiki page.

Hugh Williamson has authored 1 sequences.

A354538 a(n) is the least k such that A322523(k) = n.

Original entry on oeis.org

1, 3, 8, 17, 44, 125, 368, 1097, 3284, 9845, 29528, 88577, 265724, 797165, 2391488, 7174457, 21523364, 64570085, 193710248, 581130737, 1743392204, 5230176605, 15690529808, 47071589417, 141214768244, 423644304725, 1270932914168, 3812798742497, 11438396227484
Offset: 0

Author

Hugh Williamson, Aug 17 2022

Keywords

Comments

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."
The sequence and associated partition are closely related to powers of 3.

Examples

			1, 2 go in box 0 {1,2};
3=1+2 so goes in box 1 {3};
4 goes in box 0 {1,2,4};
5=1+4 so goes in box 1 {3,5};
6=2+4 so goes in box 1 {3,5,6};
7 goes in box 0 {1,2,4,7};
8=7+1=3+5 so goes in box 2 {8};
...
Box 0: {1,2,4,7,10,13,16,19,22,...} = {1} mod 3 U misfit entry 2;
Box 1: {3,5,6,12,14,21,23,...}      = {3,5} mod 9 U misfit entry 6;
Box 2: {{8,9,11,15} mod 27} U {18};
Box 3: {{17,20,24,26,27,29,33,45} mod 81} U {54};
...
		

Crossrefs

Cf. A322523.

Programs

  • Mathematica
    Join[{1, 3}, (3^Range[2, 50] + 7)/2] (* or *)
    LinearRecurrence[{4, -3}, {1, 3, 8, 17}, 50] (* Paolo Xausa, Jun 10 2024 *)
  • Python
    from itertools import count
    def A354538(n):
        for k in count(1):
            c, m = 0, k
            while not (a:=divmod(m,3))[1]:
                c += 1
                m = a[0]
            if not (m==2 or m%3==1):
                c += 1
                m = (m+1)//3-2
                while (a:=divmod(m,3))[1]:
                    c += 1
                    m = a[0]
            if c == n: return k # Chai Wah Wu, Oct 15 2022
    def A354538(n): return (n<<1)+1 if n<2 else 3**n+7>>1 # based on formula, Chai Wah Wu, Oct 15 2022

Formula

For n >= 2, a(n) = (3^n + 7)/2.
For n >= 0, the contents of the n-th box are (conjecture):
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).
2) The additional 'misfit' entry 2*3^n.
[For the correctness and the formula and the conjecture see A322523. - Jianing Song, Oct 17 2022]

Extensions

a(7)-a(15) from Michel Marcus, Sep 23 2022
a(16)-a(20) from Chai Wah Wu, Oct 15 2022
a(21)-a(28) from Paolo Xausa, Jun 10 2024