A Self-Banning Family of Sequences

77 views
Skip to first unread message

Joshua Weinstein

unread,
Sep 8, 2026, 4:33:24 AM (11 days ago) Sep 8
to SeqFan
Hello SeqFans,

For the past week or so, I have been thinking about a group of sequences with the following definition:

Lexicographically earliest sequence starting with a(1) = k in which a(n) is banned from use for the next a(n) terms after its appearance and the allowed integers are >= k.

I computed by hand some of the simpler cases and found that they are all purely periodic. Here are the periods of the first 3 cases:

k = 0:  0,  ... (trivial)

k = 1:  1, 2, 1, 3, ... (A364447)

k = 2:  2, 3, 4, 2, 5, 3, 2, 4, 6, 2, 3, 5, 2, 4, 3, 2, 6, 5, 2, 3, 4, 2, 7, 3, 2, 4, 5, 2, 3, 6, 2, 4, 3, 2, 5, 7, ...

My next thought was to make an irregular triangle sequence, where in each row the full period of a k value would be listed; however, I am glad that I also checked k = 3 before I did that because something interesting happens.

At k = 3 instead of the sequence being purely periodic there is a pre-periodic block (colored red) followed by a periodic block (colored green)

3, 4, 5, 6, 3, 7, 4, 8, 3, 5, 6, 4, 3, 7, 9, 5, 3, 4, 6, 8, 3, 5, 4, 7, 3, 6, 9, 4, 3, 5, 8, 7, 3, 4, 6, 5, 3, 9, 4, 7, 3, 5, 6, 4, 3, 8, 10, 5, 3, 4, 6, 7, 3, 5, 4, 8, 3, 6, 9, 4, 3, 5, 7, 10, 3, 4, 6, 5, 3, 8, 4, 7, 3, 5, 6, 4, 3, 9, 8,  ...


My main question now is how I could prove (or disprove, though my intuition thinks it should be prove) that this sequence is bounded for all k? I don't think I know how to do this, as I only ever learned basic examples of proof by induction/contradiction and I'm not a mathematician, so I would love some help on this. Also noteworthy is that someone else figured out that a similar banning sequence where you ban n for the next n^3 terms is unbounded, but n^2 isn't (see A364448 and A364449).

My other question is if I were to submit this sequence as an irregular triangle, does it make sense to include just the periodic block or also the pre-periodic block? And if I include both how do I indicate at what point it becomes periodic for each k.


Best regards,

Joshua Weinstein

M. F. Hasler

unread,
Sep 8, 2026, 11:46:44 AM (11 days ago) Sep 8
to seq...@googlegroups.com, Joshua Weinstein
Joshua,

I think that's interesting enough to include a few more related sequences :
- b(n) : length of the period (or 0 if the sequence never becomes periodic)
- c(n) : length of the pre-period (or -1 if the sequence never becomes periodic)
Maybe both triangles,
T(n,.) : row n gives the periodic part
row lengths = b(n)
S(n,.) : row n gives terms up to the end of the first period
row lengths = b(n)+c(n)
Of course, this S(n,.) is defined only if b(n) has no 0 <=> c(n) has no -1.
In case this isn't true or can't be proved,
you might submit S(n,.) as an infinite square array (read by antidiagonals),
where each row is the infinite sequence.
- Maximilian

--
You received this message because you are subscribed to the Google Groups "SeqFan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to seqfan+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/seqfan/ee6bd62c-33d9-417e-9dcd-f9be73e80e6bn%40googlegroups.com.


--
- Maximilian

Geoffrey Caveney

unread,
Sep 8, 2026, 12:39:37 PM (11 days ago) Sep 8
to seq...@googlegroups.com, weinstei...@gmail.com
Joshua,

I think this is a very interesting family of sequences. Personally I don't like the idea of submitting it as an irregular triangular array, since that would be confusing to follow. Rather, I would prefer that you submit the sequences for k=2, k=3, and perhaps a few others separately.

The foundation of a proof that the sequence is bounded for every k would begin with the famous fact that the harmonic series 1 + 1/2 + 1/3 + ... = zeta(1) is divergent and unbounded. For any given k, the densities of the successive integer values appearing in the sequence, i.e., k, k+1, k+2, ..., are 1/(k+1), 1/(k+2), 1/(k+3), etc., so the sum of their densities is 1/(k+1) + 1/(k+2) + 1/(k+3) + .... Since zeta(1) is divergent, this sum is also unbounded and grows to infinity, regardless of the value of k. This means that eventually, this sum of the densities of the integer values appearing in the sequence will reach 1 within a finite number of integer values. Let us call this point 1/(k+m+1). Since the sum of their densities 1/(k+1) + 1/(k+2) + 1/(k+3) + ... + 1/(k+m+1) is greater than 1, this implies that the integer values k, k+1, k+2, ..., k+m will comprise the entirety of the sequence from n=1 to infinity. Thus the sequence is bounded by some value k+m for every k.

For small values of k, the largest term in the sequence is = 3k or 3k+1. I am curious about the precise size of this bound in relation to k in general. One might also investigate the position of the first appearance of a(n) = 3k and a(n) = 3k+1 for each value of k. For example, a brief examination of the k=4 sequence finds that 3k+1 = 13 does appear, but only after a rather large number of terms, at a(157) I believe if I have not made a mistake in computing the terms of the sequence.

Also, if one restricts sequence A364448 (n is banned for n^2 terms) to integers >= 2, then it becomes unbounded. This is because when one removes the first term 1 from the sum of the reciprocals of the squares zeta(2), the resulting sum ((pi^2) / 6) - 1 is less than 1. This implies that for any finite number of integer values from 2 to m, the sum of their densities 1/(2^2 + 1) + 1/(3^2 + 1) + ... + 1/(m^2 + 1) can never reach 1, and thus no finite number of integer values from 2 to m can comprise the entirety of the sequence from n=1 to infinity.

Geoffrey


--

Joshua Weinstein

unread,
Sep 8, 2026, 10:17:50 PM (11 days ago) Sep 8
to SeqFan
Hi all,

I have now proposed for review A399708 and A399709 which are the full sequences for k = 2 and k = 3 respectively. I am also working on A398589, which is the irregular triangle but I am having trouble writing code to generate more terms of the sequence. My main problem is writing code that is able to detect when a row starts becoming periodic is not something that I know how to do. I think code would be necessary to generate a lot of the related sequences proposed by M. F. Hasler, so if you know how to write a program that can generate more terms, feel free to add it.

Also thank you Geoffrey for showing that the sequences are bounded for all values of k. I think investigating the positions of 3k and 3k+1 as well as the maximum number in each row would also be great ideas for sequences, but unfortunately I'm already at my max of 3 sequences.

Best regards,
Joshua

Geoffrey Caveney

unread,
Sep 9, 2026, 7:12:00 AM (10 days ago) Sep 9
to seq...@googlegroups.com, weinstei...@gmail.com
I can add that as k grows to infinity, the asymptotic limit of the largest term in the sequence will approach e*k. Proof sketch: The sum of the densities of the integer values k, k+1, k+2, ..., e*k appearing in the sequence is 1/(k+1) + 1/(k+2) + 1/(k+3) + .... 1/(e*k + 1). This value is = H_(e*k + 1) - H_(k+1), which approaches (log (e*k + 1) + gamma) - (log (k+1) + gamma) for large k, which is = log (e*k + 1) - log (k+1) = log [(e*k + 1) / (k+1)]. This value approaches log (e*k / k) = log e = 1. Since this sum of densities approaches 1, it follows that the integer values k, k+1, k+2, ..., e*k will comprise the entirety of the sequence from n=1 to infinity, and thus the largest term in each such sequence will approach the value of e*k.

Geoffrey

Martin Fuller

unread,
Sep 9, 2026, 1:03:09 PM (10 days ago) Sep 9
to SeqFan
Do we have a lower bound for the density of n that proves the harmonic series is relevant? The density is at most 1/(n+1) but an upper bound is not sufficient.

I have generated the sequences up to k=100. It seems possible that (largest term / k) approaches e, but unlikely that (largest term) approaches e*k.

Martin Fuller

k, period, pre-period, max(period), max(pre-period)
0, 1, 0, 0, 0
1, 4, 0, 3, 0
2, 36, 0, 7, 0
3, 32, 63, 10, 10
4, 300, 179, 13, 13
5, 216, 129, 16, 15
6, 1176, 1427, 20, 20
7, 512, 1597, 22, 22
8, 810, 1942, 25, 26
9, 2000, 1898, 28, 28
10, 726, 2151, 31, 31
11, 864, 3838, 34, 34
12, 5915, 4561, 38, 37
13, 8232, 7469, 40, 40
14, 5400, 7165, 43, 42
15, 6144, 16121, 46, 46
16, 13005, 36719, 49, 49
17, 5832, 6032, 52, 51
18, 25270, 47303, 55, 55
19, 12000, 43111, 58, 58
20, 29106, 51000, 61, 61
21, 21296, 52267, 63, 65
22, 12696, 29804, 66, 66
23, 13824, 50757, 69, 71
24, 73125, 140174, 72, 73
25, 70304, 137686, 75, 76
26, 40824, 152116, 78, 79
27, 54880, 177349, 81, 81
28, 201840, 186520, 85, 84
29, 81000, 427468, 87, 88
30, 169136, 606637, 91, 90
31, 81920, 236730, 92, 94
32, 55539, 235970, 95, 96
33, 117912, 232074, 98, 99
34, 176400, 254607, 101, 101
35, 139968, 384725, 105, 104
36, 338143, 488843, 107, 107
37, 493848, 751220, 111, 110
38, 182520, 601946, 113, 113
39, 224000, 1116551, 116, 117
40, 388311, 783005, 119, 119
41, 222264, 857676, 121, 122
42, 1220340, 987706, 125, 126
43, 894432, 2483743, 128, 128
44, 372600, 705771, 130, 131
45, 389344, 1773412, 133, 133
46, 530160, 1009694, 136, 136
47, 221184, 1105812, 139, 139
48, 2040850, 1798284, 143, 142
49, 1000000, 2335547, 145, 145
50, 473382, 1672483, 147, 148
51, 1265472, 3539783, 151, 151
52, 1061802, 2519765, 153, 154
53, 944784, 2756515, 156, 158
54, 1609300, 2438446, 160, 159
55, 790272, 2549370, 163, 163
56, 471105, 2644900, 165, 165
57, 1951120, 3242078, 168, 168
58, 939870, 2409268, 170, 170
59, 1296000, 3039295, 174, 174
60, 2422371, 5382022, 177, 178
61, 3574920, 8144190, 180, 180
62, 1016064, 3998118, 182, 182
63, 2883584, 4765181, 186, 185
64, 2370225, 6026695, 189, 188
65, 2156220, 6408994, 191, 191
66, 7020796, 5525476, 195, 194
67, 1729376, 8080367, 197, 199
68, 999810, 4561142, 199, 199
69, 2058000, 4926051, 202, 202
70, 5081328, 5000091, 205, 205
71, 933120, 5981804, 207, 208
72, 4929325, 13194369, 211, 212
73, 7294032, 8502434, 214, 213
74, 2137500, 7870390, 216, 219
75, 5706688, 23064170, 219, 220
76, 9249240, 12090444, 225, 223
77, 4270968, 12152370, 225, 225
78, 13480560, 14697618, 228, 229
79, 6656000, 16731938, 232, 231
80, 1883007, 14871479, 232, 234
81, 7719152, 17433114, 237, 236
82, 3472056, 11865484, 240, 241
83, 3556224, 18819353, 241, 243
84, 9009575, 20975778, 247, 246
85, 13357176, 20462898, 248, 248
86, 1998216, 15010624, 251, 251
87, 10222080, 17082220, 254, 253
88, 8198235, 24309331, 256, 258
89, 5103000, 21576857, 258, 260
90, 47234824, 40682165, 265, 263
91, 11680320, 24081262, 266, 266
92, 9756072, 16020175, 267, 268
93, 6644672, 19157660, 270, 270
94, 5198400, 25444519, 273, 274
95, 6193152, 25563037, 276, 278
96, 30428706, 77862800, 280, 281
97, 30118144, 31638243, 284, 284
98, 5880600, 28215862, 286, 288
99, 17000000, 41206033, 288, 289
100, 13526526, 43048809, 291, 291

Geoffrey Caveney

unread,
Sep 10, 2026, 9:29:07 AM (9 days ago) Sep 10
to seq...@googlegroups.com
Martin, you are correct. My claim that the largest term approaches e*k was premature. Establishing a lower bound for the density of n will require more work.

Martin's computation of the sequences up to k=100 is interesting. I am particularly struck by the period lengths 300 for k=4, 2000 for k=9, 5400 for k=14, 12000 for k=19, 81000 for k=29, exactly 1000000 for k=49, and 17000000 for k=99. There must be a reason behind this pattern, based on k occurring every 10x terms when k = 10x - 1 and other multiplicative properties of other values occurring in the sequences.

Geoffrey


M. F. Hasler

unread,
Sep 10, 2026, 12:29:10 PM (9 days ago) Sep 10
to seq...@googlegroups.com
Le jeu. 10 sept. 2026 à 09:29, Geoffrey Caveney <geoffre...@gmail.com> a écrit :
Martin's computation of the sequences up to k=100 is interesting.

I agree!
 
I am particularly struck by the period lengths 300 for k=4, 2000 for k=9, 5400 for k=14, 12000 for k=19, 81000 for k=29, exactly 1000000 for k=49, and 17000000 for k=99. There must be a reason behind this pattern, based on k occurring every 10x terms when k = 10x - 1 and other multiplicative properties of other values occurring in the sequences.

FWIW, I noticed that the period length L(k) is divisible by 4^v(k+1), where v is the 2-valuation ("ruler function"), 
for all of Martin's values, and the result is odd (i.e., v(L(k)) = 2 v(k+1), for 
k = 1, 12, 16, 24, 32, 36, 40, 56, 60, 64, 65, 72, 80, 84, 88...
But actually,  except for 1 & 65, all these are even, so that v(k+1) = 0 and L(k) is already odd.
In fact, the indices of odd L(k) are:
k = 0, 12, 16, 24, 32, 36, 40, 56, 60, 64, 72, 80, 84, 88...
That's almost all multiples of 4 except for 4 (1, 2, 5, 7, 11, 12, 13, 17, 19...)
which are just the primes up to 20, with the exception of 1 & 12 and missing 3.
I can't right now compute the sequence further to check whether this pattern prevails, but it looks probable.

I did make some more quick trivial computations and share the very simple code below, FWIW.

- Maximilian

On Tue, Sep 8, 2026 at 4:33 AM Joshua Weinstein <weinstei...@gmail.com> wrote:
For the past week or so, I have been thinking about a group of sequences with the following definition:
[some usual suspects should take notice] 
Lexicographically earliest sequence starting with a(1) = k in which a(n) is banned from use for the next a(n) terms after its appearance and the allowed integers are >= k.

def JW(k, upto=99):
  ban={}; N = range(k, 8<<88) # ~ infinity
  for n in range(1,upto): yield k; ban[k]=k+n; k=next(k for k in N if ban.get(k,0)<=n)

It gives
T = [list(JW(n,20-n))for n in range(1,9)]
print("\n".join(f"{k = }: {T[k-1]+[...]}"for k in range(1,9)))
k = 1: [1, 2, 1, 3, 1, 2, 1, 3, 1, 2, 1, 3, 1, 2, 1, 3, 1, 2, ...]
k = 2: [2, 3, 4, 2, 5, 3, 2, 4, 6, 2, 3, 5, 2, 4, 3, 2, 6, ...]
k = 3: [3, 4, 5, 6, 3, 7, 4, 8, 3, 5, 6, 4, 3, 7, 9, 5, ...]
k = 4: [4, 5, 6, 7, 8, 4, 9, 5, 10, 6, 4, 7, 11, 5, 8, ...]
k = 5: [5, 6, 7, 8, 9, 10, 5, 11, 6, 12, 7, 13, 5, 8, ...]
k = 6: [6, 7, 8, 9, 10, 11, 12, 6, 13, 7, 14, 8, 15, ...]
k = 7: [7, 8, 9, 10, 11, 12, 13, 14, 7, 15, 8, 16, ...]
k = 8: [8, 9, 10, 11, 12, 13, 14, 15, 16, 8, 17, ...]
For the records, read by falling antidiagonals this gives the sequence
[T[j][n-j] for n in range(10) for j in range(n+1)]
1, 2, 2, 1, 3, 3, 3, 4, 4, 4, 1, 2, 5, 5, 5, 2, 5, 6, 6, 6, 6, 1, 3, 3, 7, 7, 7, 7, 3, 2, 7, 8, 8, 8, 8, 8, 1, 4, 4, 4, 9, 9, 9, 9, 9, 2, 6, 8, 9, 10, 10, 10, 10, 10, 10, ...
We see and easily understand that the first n+1 terms of JW(n) are [n, ..., 2n], 
followed by JW(n)(n+2) = n, from where on it becomes nontrivial.
So the lower left triangular part is a bit dull, and we can decide to omit it,
and start each row k with  JW(k)(k+2) = k.
That would give the infinite square array
print(S := np.array([list(JW(n,15+n))[n+1:]for n in range(1,9)]))
[[ 1  3  1  2  1  3  1  2  1  3  1  2  1 ...
 [ 2  5  3  2  4  6  2  3  5  2  4  3  2
  ... 
 [ 3  7  4  8  3  5  6  4  3  7  9  5  3 ...
 [ 4  9  5 10  6  4  7 11  5  8  4  6  9
 ...
 [ 5 11  6 12  7 13  5  8  9  6 10 14  5
 ...
 [ 6 13  7 14  8 15  9  6 10 16  7 11 12
 ...
 [ 7 15  8 16  9 17 10 18  7 11 12  8 13
 ...
 [ 8 17  9 18 10 19 11 20 12  8 13 21  9
 ... ]
Read by antidiagonals this gives
1, 3, 2, 1, 5, 3, 2, 3, 7, 4, 1, 2, 4, 9, 5, 3, 4, 8, 5, 11, 6, 1, 6, 3, 10, 6, 13, 7, 2, 2, 5, 6, 12, 7, 15, 8, 1, 3, 6, 4, 7, 14, 8, 17, 9, 3, 5, 4, 7, 13, 8, 16, 9, 19, 10, ...

MF=[eval(t)for t in"""(paste Martin's results here)""".splitlines()]
# now elements of MF are t = (k, L(k), T(k), M(k), M'(k))

[t[0] for t in MF if t[1]&1] # indices of odd period lengths
[0, 12, 16, 24, 32, 36, 40, 56, 60, 64, 72, 80, 84, 88]

def v2(n): return(n & -n).bit_length()-1 # 2-valuation
[v2(t[1]) for t in MF]
[0, 2, 2, 5, 2, 3, 3, 9, 1, 4, 1, 5, 0, 3, 3, 11, 0, 3, 1, 5, 1, 4, 3, 9, 0, 5, 3, 5, 4, 3, 4, 14, 0, 3, 4, 6, 0, 3, 3, 8, 0, 3, 2, 5, 3, 5, 4, 13, 1, 6, 1, 6, 1, 4, 2, 8, 0, 4, 1, 7, 0, 3, 8, 18, 0, 2, 2, 5, 1, 4, 4, 8, 0, 4, 2, 6, 3, 3, 4, 12, 0, 4, 3, 7, 0, 3, 3, 9, 0, 3, 3, 6, 3, 6, 6, 15, 1, 8, 3, 6, 1] 
any(t[1] % 4**v2(t[0]+1) for t in MF) # anyone not divisible?
False
[t[1] // 4**v2(t[0]+1) for t in MF]
[1, 1, 36, 2, 300, 54, 1176, 8, 810, 500, 726, 54, 5915, 2058, 5400, 24, ...]
# many quotients remain even, but the remaining 2-valuations don't grow in general, even when we look only at the even terms.
[v2( t[1] // 4**v2(t[0]+1)) for t in MF[1::4]] # indices k=4m+1
[0, 1, 2, 1, 1, 2, 3, 1, 1, 1, 1, 3, 4, 2, 2, 1, 0, 2, 2, 1, 2, 1, 1, 4, 6]
[v2( t[1] // 4**v2(t[0]+1)) for t in MF[2::4]] # indices k=4m+2
[2, 3, 1, 3, 1, 3, 3, 4, 4, 3, 2, 4, 1, 2, 1, 8, 2, 4, 2, 4, 3, 3, 3, 6, 3]
[v2( t[1] // 4**v2(t[0]+1)) for t in MF[3::4]] # indices k=4m+3
[1, 3, 1, 3, 1, 3, 1, 4, 2, 2, 1, 5, 2, 2, 3, 6, 1, 2, 2, 4, 3, 3, 2, 5, 2]
Remember that L(65) / 4 is already odd, so v2(65+1) = 1 is the maximum power of 4 by which we can divide, although the odd-indexed L(k)'s usually have larger 2-valuations, while odd L(k) have 4|k :
[v2( t[1] // 4**v2(t[0]+1)) for t in MF[::4]]
[0, 2, 1, 0, 0, 1, 0, 4, 0, 0, 0, 3, 1, 1, 0, 0, 0, 1, 0, 3, 0, 0, 0, 3, 1, 1]
Reply all
Reply to author
Forward
0 new messages