login
A390944
Value of T[4] after the n-th iteration, when the map T is initialized with T[1] = 1 and in subsequent iterations, T[v] = k + (T[v] if defined else 0) for all key-value pairs (k, v) in T; a(n) = 0 if T[4] isn't defined yet.
2
0, 0, 0, 0, 1, 4, 10, 12, 24, 46, 80, 160, 320, 616, 1222, 2444, 4842, 9684, 19368, 38736, 77472, 154944, 309888, 619776, 1239552, 2479104, 4958208, 9916416, 19832832, 39665664, 79331328, 158662656, 317325312, 634650624, 1269301248, 2538602496, 5077204992, 10154409984, 20308819968, 40617639936, 81235279872, 162470559744, 324941119488, 649882238976
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
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
Cf. A390939 (main entry: list of keys as they are added to the map T).
Sequence in context: A007319 A352213 A175436 * A354024 A074939 A038464
KEYWORD
nonn,easy
AUTHOR
M. F. Hasler, Nov 24 2025
STATUS
approved