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.

A382747 Greedy partition of the positive integers into arithmetic progressions of length at most 4.

This page as a plain text file.
%I A382747 #44 May 12 2025 10:13:48
%S A382747 1,2,3,4,5,10,15,20,6,12,18,24,7,14,21,28,8,16,0,0,9,0,0,0,11,22,33,
%T A382747 44,13,26,39,52,17,34,51,68,19,38,57,76,23,46,69,92,25,50,75,100,27,
%U A382747 54,81,108,29,58,87,116,30,60,90,120,31,62,93,124,32,64,96,128,35,70,105,140,36,72,0,0,37,74,111,148,40,80,0,0
%N A382747 Greedy partition of the positive integers into arithmetic progressions of length at most 4.
%C A382747 Table by rows, rows have length 4.
%C A382747 Elements are a permutation of positive integers, intermixed with zeros.
%C A382747 Expanded description: Partition the positive integers into arithmetic progressions of the form k, 2k, 3k, 4k, putting every positive integer into the first progressions where it fits, allowing shortened progressions (which are padded with zeros):
%C A382747   k, 0, 0, 0;
%C A382747   k, 2k, 0, 0;
%C A382747   k, 2k, 3k, 0.
%C A382747 Construction:
%C A382747   1. Start by matrix M with rows indexed by positive integers, columns by 1,2,3,4.
%C A382747   2. M_ij = i*j.
%C A382747   3. Proceeding row by row, then column by column, if M_ij = M_rk with r < i, set M_is = 0 for i <= s <= 4; if j=0, remove entire row.
%C A382747   4. Call the resulting matrix A.
%C A382747 So starting with
%C A382747 M = [ 1  2  3  4]
%C A382747     [ 2  4  6  8]
%C A382747     [ 3  6  9 12]
%C A382747     [ 4  8 12 16]
%C A382747     [ 5 10 15 20]
%C A382747     [ 6 12 18 24]
%C A382747     [ 7 14 21 28]
%C A382747     [ 8 16 24 32]
%C A382747     [ 9 18 27 36]
%C A382747     [10 20 30 40]
%C A382747     [11 22 33 44]
%C A382747     [12 24 36 48]
%C A382747     [13 26 39 52]
%C A382747     [14 28 42 56]
%C A382747     [15 30 45 60]
%C A382747     [16 32 48 64]
%C A382747     [17 34 51 68]
%C A382747     [18 36 54 72]
%C A382747     [19 38 57 76]
%C A382747     [20 40 60 80]
%C A382747 we arrive at
%C A382747 A = [  1   2   3   4]
%C A382747     [  5  10  15  20]
%C A382747     [  6  12  18  24]
%C A382747     [  7  14  21  28]
%C A382747     [  8  16   0   0]
%C A382747     [  9   0   0   0]
%C A382747     [ 11  22  33  44]
%C A382747     [ 13  26  39  52]
%C A382747     [ 17  34  51  68]
%C A382747     [ 19  38  57  76]
%C A382747 Every row in A is an arithmetic progression (even when 0 is adjoined), and every positive integer occurs at precisely one position.
%C A382747 Thus we get a partition of the positive integers into parts which are arithmetic progressions; using this partition for every prime number p yields a regular (in the sense of Narkiewicz) convolution product on the vector space of arithmetic functions.
%C A382747 The first column of A contains those b such that p^b is primitive.
%C A382747 Alternative construction:
%C A382747 Form an infinite rooted tree T on the nonnegative integers in the following way.
%C A382747   1. 0 is the root.
%C A382747   2. Form a branch 0 - 1 - 2 -3 - 4.
%C A382747   3. Proceed inductively. Add n to end of an existing branch as either
%C A382747     0 - k=n
%C A382747     0 - k - 2k=n
%C A382747     0 - k - 2k - 3k=n
%C A382747     0 - k - 2k - 3k - 4k=n
%C A382747     with a preference for smaller k.
%C A382747   4. After infinitely many steps you have constructed T.
%C A382747   5. Read the positive integers branch by branch.
%H A382747 Jan Snellman, <a href="/A382747/b382747.txt">Table of n, a(n) for n = 1..20788</a>
%H A382747 W. Narkiewicz, <a href="https://eudml.org/doc/209799">On a class of arithmetical convolutions</a>, Colloq. Math. 10, 1963, pp 81-94.
%H A382747 Jan Snellman, <a href="https://arxiv.org/abs/2504.02795">Greedy Regular Convolutions</a>, arXiv:2504.02795 [math.NT], 2025.
%e A382747 Up to n=15 the branches of the aforementioned tree looks like
%e A382747   0 -  1 -  2 -  3 - 4,
%e A382747   0 -  5 - 10 - 15,
%e A382747   0 -  6 - 12,
%e A382747   0 -  7 - 14,
%e A382747   0 -  8,
%e A382747   0 -  9,
%e A382747   0 - 11,
%e A382747   0 - 13;
%e A382747 but since 20=5*4 the second branch may not be complete, so at this stage we only know the first row of the matrix A. Adding 16, 17, 18, 19, 20 we get
%e A382747   0 -  1 -  2 -  3 -  4,
%e A382747   0 -  5 - 10 - 15 - 20,
%e A382747   0 -  6 - 12 - 18,
%e A382747   0 -  7 - 14,
%e A382747   0 -  8 - 16,
%e A382747   0 -  9,
%e A382747   0 - 11,
%e A382747   0 - 13,
%e A382747   0 - 17,
%e A382747   0 - 19;
%e A382747 and now we know the first two rows of A.
%o A382747 (SageMath)
%o A382747 def greedy_matrix(blocklength=2,initial_cols=20):
%o A382747     m, n = blocklength, initial_cols
%o A382747     A = matrix(ZZ, m,n, lambda i,j: (i+1)*(j+1))
%o A382747     for c in range(2, n+1):
%o A382747         for r in range(1, m+1):
%o A382747             prev = set(flatten([list(_) for _ in A.columns()[:(c-1)]]))
%o A382747             v = A[r-1, c-1]
%o A382747             if v in prev:
%o A382747                 for j in range(r, m+1):
%o A382747                     A[j-1,c-1] = 0
%o A382747                 break
%o A382747     return A
%o A382747 def pruned_greedy_matrix(blocklength=2, initial_cols=20):
%o A382747     A = greedy_matrix(blocklength=blocklength, initial_cols=initial_cols)
%o A382747     return matrix([_ for _ in A.columns() if add(_) > 0]).transpose()
%o A382747 pruned_greedy_matrix(blocklength=4, initial_cols=20)
%o A382747 (Python)
%o A382747 def A382747_generator(blocklength=4):
%o A382747     a_set = set()
%o A382747     a0 = 1
%o A382747     while 1:
%o A382747         while a0 in a_set:
%o A382747             a_set.remove(a0)
%o A382747             a0 += 1
%o A382747         for i in range(1,blocklength+1):
%o A382747             a = i*a0
%o A382747             if i != 1 and a in a_set:
%o A382747                 for j in range(blocklength-i+1): yield 0
%o A382747                 break
%o A382747             yield a
%o A382747             a_set.add(a) # _Pontus von Brömssen_, Apr 30 2025
%Y A382747 First column yields A382748.
%Y A382747 A382749(n) = column where n occurs in this matrix.
%Y A382747 The case length=2 is A036552, when the latter is interpreted as a matrix with two columns.
%K A382747 nonn,tabf,easy
%O A382747 1,2
%A A382747 _Jan Snellman_, Apr 23 2025