|
|
A354538
|
|
a(n) is the least k such that A322523(k) = n.
|
|
1
|
|
|
1, 3, 8, 17, 44, 125, 368, 1097, 3284, 9845, 29528, 88577, 265724, 797165, 2391488, 7174457, 21523364, 64570085, 193710248, 581130737, 1743392204
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
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.
|
|
LINKS
|
|
|
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]
|
|
EXAMPLE
|
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};
...
|
|
PROG
|
(Python)
from itertools import count
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]
def A354538(n): return (n<<1)+1 if n<2 else 3**n+7>>1 # based on formula, Chai Wah Wu, Oct 15 2022
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|