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.

A255127 Ludic array: square array A(row,col), where row n lists the numbers removed at stage n in the sieve which produces Ludic numbers. Array is read by antidiagonals A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), ...

This page as a plain text file.
%I A255127 #50 Nov 18 2024 07:36:05
%S A255127 2,4,3,6,9,5,8,15,19,7,10,21,35,31,11,12,27,49,59,55,13,14,33,65,85,
%T A255127 103,73,17,16,39,79,113,151,133,101,23,18,45,95,137,203,197,187,145,
%U A255127 25,20,51,109,163,251,263,281,271,167,29,22,57,125,191,299,325,367,403,311,205,37,24,63,139,217,343,385,461,523,457,371,253,41
%N A255127 Ludic array: square array A(row,col), where row n lists the numbers removed at stage n in the sieve which produces Ludic numbers. Array is read by antidiagonals A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), ...
%C A255127 The starting offset of the sequence giving the terms of square array is 2. However, we can tacitly assume that a(1) = 1 when the sequence is used as a permutation of natural numbers. However, term 1 itself is out of the array.
%C A255127 The choice of offset = 2 for the terms starting in rows >= 1 is motivated by the desire to have a permutation of the integers n -> a(n) with a(n) = A(A002260(n-1), A004736(n-1)) for n > 1 and a(1) := 1. However, since this sequence is declared as a "table", offset = 2 would mean that the first *row* (not element) has index 2. I think the sequence should have offset = 1 and the permutation of the integers would be n -> a(n-1) with a(0) := 1 (if a(1) = A(1,1) = 2). Or, the sequence could have offset 0, with an additional row 0 of length 1 with the only element a(0) = A(0,1) = 1, the permutation still being n -> a(n-1) if a(n=0, 1, 2, ...) = (1, 2, 4, ...). This would be in line with considering 1 as the first ludic number, and A(n, 1) = A003309(n+1) for n >= 0. - _M. F. Hasler_, Nov 12 2024
%H A255127 Antti Karttunen, <a href="/A255127/b255127.txt">Table of n, a(n) for n = 2..10441; the first 144 antidiagonals of array, flattened</a>
%F A255127 From _M. F. Hasler_, Nov 12 2024: (Start)
%F A255127 A(r, c) = A(r, c-P(r)) + S(r) = A(r, ((c-1) mod P(r)) + 1) + floor((c-1)/P(r))*S(r) with periods P = (1, 1, 2, 8, 48, 480, 5760, ...) = A377469, and shifts S = (2, 6, 30, 210, 2310, 30030, 510510) = A376237(2, 3, ...). For example:
%F A255127 A(1, c) = A(1, c-1) + 2 = 2 + (c-1)*2 = 2*c,
%F A255127 A(2, c) = A(2, c-1) + 6 = 3 + (c-1)*6 = 6*c - 3,
%F A255127 A(3, c) = A(3, c-2) + 30 = {5 if c is odd else 19} + floor((c-1)/2)*30 = 15*c - 11 + (c mod 2),
%F A255127 A(4, c) = A(4, c-8) + 210 = A(4, ((c-1) mod 8)+1) + floor((c-1)/8)*210, etc. (End)
%e A255127 The top left corner of the array:
%e A255127    2,   4,   6,   8,  10,  12,   14,   16,   18,   20,   22,   24,   26
%e A255127    3,   9,  15,  21,  27,  33,   39,   45,   51,   57,   63,   69,   75
%e A255127    5,  19,  35,  49,  65,  79,   95,  109,  125,  139,  155,  169,  185
%e A255127    7,  31,  59,  85, 113, 137,  163,  191,  217,  241,  269,  295,  323
%e A255127   11,  55, 103, 151, 203, 251,  299,  343,  391,  443,  491,  539,  587
%e A255127   13,  73, 133, 197, 263, 325,  385,  449,  511,  571,  641,  701,  761
%e A255127   17, 101, 187, 281, 367, 461,  547,  629,  721,  809,  901,  989, 1079
%e A255127   23, 145, 271, 403, 523, 655,  781,  911, 1037, 1157, 1289, 1417, 1543
%e A255127   25, 167, 311, 457, 599, 745,  883, 1033, 1181, 1321, 1469, 1615, 1753
%e A255127   29, 205, 371, 551, 719, 895, 1073, 1243, 1421, 1591, 1771, 1945, 2117
%e A255127 ...
%t A255127 rows = 12; cols = 12; t = Range[2, 3000]; r = {1}; n = 1; While[n <= rows, k = First[t]; AppendTo[r, k]; t0 = t; t = Drop[t, {1, -1, k}]; ro[n++] = Complement[t0, t][[1 ;; cols]]]; A = Array[ro, rows]; Table[ A[[n - k + 1, k]], {n, 1, rows}, {k, n, 1, -1}] // Flatten (* _Jean-François Alcover_, Mar 14 2016, after _Ray Chandler_ *)
%o A255127 (Scheme)
%o A255127 (define (A255127 n) (if (<= n 1) n (A255127bi (A002260 (- n 1)) (A004736 (- n 1)))))
%o A255127 (define (A255127bi row col) ((rowfun_n_for_A255127 row) col))
%o A255127 ;; definec-macro memoizes its results:
%o A255127 (definec (rowfun_n_for_A255127 n) (if (= 1 n) (lambda (n) (+ n n)) (let* ((rowfun_for_remaining (rowfun_n_for_remaining_numbers (- n 1))) (eka (rowfun_for_remaining 0))) (COMPOSE rowfun_for_remaining (lambda (n) (* eka (- n 1)))))))
%o A255127 (definec (rowfun_n_for_remaining_numbers n) (if (= 1 n) (lambda (n) (+ n n 3)) (let* ((rowfun_for_prevrow (rowfun_n_for_remaining_numbers (- n 1))) (off (rowfun_for_prevrow 0))) (COMPOSE rowfun_for_prevrow (lambda (n) (+ 1 n (floor->exact (/ n (- off 1)))))))))
%o A255127 (Python)
%o A255127 a255127 = lambda n: A255127(A002260(k-1), A004736(k-1))
%o A255127 def A255127(n, k):
%o A255127     A = A255127; R = A.rows
%o A255127     while len(R) <= n or len(R[n]) < min(k, A.P[n]): A255127_extend(2*n)
%o A255127     return R[n][(k-1) % A.P[n]] + (k-1)//A.P[n] * A.S[n]
%o A255127 A=A255127; A.rows=[[1],[2],[3]]; A.P=[1]*3; A.S=[0,2,6]; A.limit=30
%o A255127 def A255127_extend(rMax=9, A=A255127):
%o A255127     A.limit *= 2; L = [x+5-x%2 for x in range(0, A.limit, 3)]
%o A255127     for r in range(3, rMax):
%o A255127         if len(A.P) == r:
%o A255127             A.P += [ A.P[-1] * (A.rows[-1][0] - 1) ]  # A377469
%o A255127             A.rows += [[]]; A.S += [ A.S[-1] * L[0] ] # ludic factorials
%o A255127         if len(R := A.rows[r]) < A.P[r]: # append more terms to this row
%o A255127             R += L[ L[0]*len(R) : A.S[r] : L[0] ]
%o A255127         L = [x for i, x in enumerate(L) if i%L[0]] # _M. F. Hasler_, Nov 17 2024
%Y A255127 Transpose: A255129.
%Y A255127 Inverse: A255128. (When considered as a permutation of natural numbers with a(1) = 1).
%Y A255127 Cf. A260738 (index of the row where n occurs), A260739 (of the column).
%Y A255127 Main diagonal: A255410.
%Y A255127 Column 1: A003309 (without the initial 1). Column 2: A254100.
%Y A255127 Row 1: A005843, Row 2: A016945, Row 3: A255413, Row 4: A255414, Row 5: A255415, Row 6: A255416, Row 7: A255417, Row 8: A255418, Row 9: A255419.
%Y A255127 A192607 gives all the numbers right of the leftmost column, and A192506 gives the composites among them.
%Y A255127 Cf. A272565, A271419, A271420 and permutations A269379, A269380, A269384.
%Y A255127 Cf. also related or derived arrays A260717, A257257, A257258 (first differences of rows), A276610 (of columns), A276580.
%Y A255127 Analogous arrays for other sieves: A083221, A255551, A255543.
%Y A255127 Cf. A376237 (ludic factorials), A377469 (ludic analog of A005867).
%K A255127 nonn,tabl,look
%O A255127 2,1
%A A255127 _Antti Karttunen_, Feb 22 2015