OFFSET
0,6
COMMENTS
See the main entry A390939 for additional information.
From the 8th iteration on, T[4] is the largest entry of the map T.
From the 16th iteration on, its value doubles at each iteration, cf. formula.
LINKS
M. F. Hasler, Table of n, a(n) for n = 0..199
FORMULA
a(n+1) = 2*a(n) except for n = 3, 4, 5, 6, 8, 9, 12, 13 and 15, where a(n+1) - 2*a(n) = 1, 2, 2, -8, -2, -12, -24, -10 and -46.
a(n) = 2^(n-16)*a(16) = 2^(n-15)*2421 for all n > 15.
EXAMPLE
After the first few iterations, the map looks as follows:
n | T
-----+---------------------
0 | {1: 1}
1 | {1: 2}
2 | {1: 2, 2: 1}
3 | {1: 4, 2: 2}
4 | {1: 4, 2: 4, 4: 1}
5 | {1: 8, 2: 4, 4: 4} # T[4] received 1+2 from T[1] = T[2] = 4.
6 | {1: 8, 2: 4, 4: 10, 8: 1} # T[4] received 2+4 from T[2] = T[4] = 4.
7 | {1: 16, 2: 4, 4: 12, 8: 2, 10: 4}
8 | {1: 16, 2: 12, 4: 24, 8: 2, 10: 4, 12: 4, 16: 1}
9 | {1: 32, 2: 20, 4: 46, 8: 2, 10: 4, 12: 6, 16: 2, 24: 4}
The third "column" above = value in T corresponds to this sequence: Since T[4] is set only at iteration 4, we have a(0..3) = 0, then the subsequent values of T[4] are a(4, 5, ...) = 1, 4, 10, 12, 24, 46, ...
PROG
(Python)
def A390944(n):
if not hasattr(A := A390944, 'T'): A.T = {1:1}; A.terms = [0]
if not hasattr(A, 'N'): A.N = 17 # number of terms to compute
while A.N > n >= len(A.terms):
for k, v in tuple(A.T.items()): A.T[v] = A.T.get(v, 0)+k
A.terms.append(A.T.get(4, 0))
return A.terms[n] if n<len(A.terms) else A.terms[-1]<< n-len(A.terms)+1
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
M. F. Hasler, Nov 24 2025
STATUS
approved
