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.

Showing 1-3 of 3 results.

A352001 Square array A(n, k), n, k >= 1, read by antidiagonals upwards; A(n, k) = Product_{ i >= 1 } prime(k*i)^e_i where n = Product_{ i >= 1 } prime(i)^e_i (where prime(i) denotes the i-th prime number).

Original entry on oeis.org

1, 2, 1, 3, 3, 1, 4, 7, 5, 1, 5, 9, 13, 7, 1, 6, 13, 25, 19, 11, 1, 7, 21, 23, 49, 29, 13, 1, 8, 19, 65, 37, 121, 37, 17, 1, 9, 27, 37, 133, 47, 169, 43, 19, 1, 10, 49, 125, 53, 319, 61, 289, 53, 23, 1, 11, 39, 169, 343, 71, 481, 73, 361, 61, 29, 1
Offset: 1

Views

Author

Rémy Sigrist, Feb 27 2022

Keywords

Comments

In other words, in prime factorization of n, replace prime(i) by prime(k*i).
For any k >= 1, n -> A(n, k) is completely multiplicative.

Examples

			Square array A(n, k) begins:
  n\k|   1   2    3    4     5     6     7     8      9     10
  ------------------------------------------------------------
    1|   1   1    1    1     1     1     1     1      1      1
    2|   2   3    5    7    11    13    17    19     23     29
    3|   3   7   13   19    29    37    43    53     61     71
    4|   4   9   25   49   121   169   289   361    529    841
    5|   5  13   23   37    47    61    73    89    103    113
    6|   6  21   65  133   319   481   731  1007   1403   2059
    7|   7  19   37   53    71    89   107   131    151    173
    8|   8  27  125  343  1331  2197  4913  6859  12167  24389
    9|   9  49  169  361   841  1369  1849  2809   3721   5041
   10|  10  39  115  259   517   793  1241  1691   2369   3277
		

Crossrefs

Main diagonal gives A352028.

Programs

  • Maple
    A:= (n, k)-> mul(ithprime(k*numtheory[pi](i[1]))^i[2], i=ifactors(n)[2]):
    seq(seq(A(d+1-k, k), k=1..d), d=1..12);  # Alois P. Heinz, Feb 28 2022
  • Mathematica
    Table[If[# == 1, 1, Times @@ Map[Prime[#3*PrimePi[#1]]^#2 & @@ Flatten[{#1, k}] &, FactorInteger[#]]] &[n - k + 1], {n, 11}, {k, n}] // Flatten (* Michael De Vlieger, Feb 28 2022 *)
  • PARI
    A(n,k) = { my (f=factor(n)); prod (i=1, #f~, prime(k * primepi(f[i,1])) ^ f[i,2]) }

Formula

A(A(n, k), k') = A(n, k*k').
A(n, 1) = n.
A(n, 2) = A297002(n).
A(1, k) = 1.
A(2, k) = prime(k) (the k-th prime number).
A(3, k) = prime(2*k) = A031215(k).
A(4, k) = A001248(k).

A361995 Order array of A361993, read by descending antidiagonals.

Original entry on oeis.org

1, 2, 4, 3, 6, 7, 5, 10, 11, 8, 9, 16, 18, 14, 12, 15, 26, 29, 23, 19, 13, 24, 42, 46, 38, 31, 22, 17, 39, 68, 74, 62, 50, 36, 28, 20, 63, 110, 119, 100, 81, 59, 45, 32, 21, 102, 111, 192, 101, 131, 97, 73, 52, 35, 25, 165, 179, 310, 162, 212, 158, 118, 84
Offset: 1

Views

Author

Clark Kimberling, Apr 05 2023

Keywords

Comments

This array is an interspersion (hence a dispersion, as in A114537 and A163255), so every positive integer occurs exactly once. See A333029 for the definition of order array.

Examples

			Corner:
   1    2    3    5    9   15   24 ...
   4    6   10   16   26   42   68 ...
   7   11   18   29   46   74  119 ...
   8   14   23   38   62  100  162 ...
  12   19   31   50   81  131  212 ...
  13   22   36   59   97  158  191 ...
  ...
		

Crossrefs

Programs

  • Mathematica
    zz = 300; z = 40;
    w[n_, k_] := w[n, k] = Fibonacci[k + 1] Floor[n*GoldenRatio] + (n - 1) Fibonacci[k];
    b[h_, k_] := b[h, k] = w[2 h - 1, k] + w[2 h, k];
    s = Flatten[Table[b[h, k], {h, 1, zz}, {k, 1, z}]];
    r[h_, k_] := Length[Select[s, # <= b[h, k] &]]
    TableForm[Table[r[h, k], {h, 1, 50}, {k, 1, 12}]]  (*A351995, array*)
    v = Table[r[n - k + 1, k], {n, 12}, {k, n, 1, -1}] // Flatten  (*A351995, sequence*)

A385674 Triangle read by rows: T(n,n) = 1 and T(n,k) = (T(n-1,k) | T(n-2,k) | ... | T(n-k,k)) + 1, where | is bitwise OR, (0<=k<=n).

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 2, 1, 1, 4, 4, 2, 1, 1, 5, 7, 4, 2, 1, 1, 6, 8, 8, 4, 2, 1, 1, 7, 16, 15, 8, 4, 2, 1, 1, 8, 25, 16, 16, 8, 4, 2, 1, 1, 9, 26, 32, 31, 16, 8, 4, 2, 1, 1, 10, 28, 64, 32, 32, 16, 8, 4, 2, 1, 1, 11, 31, 113, 64, 63, 32, 16, 8, 4, 2, 1, 1, 12, 32, 114, 128, 64, 64, 32, 16, 8, 4, 2, 1
Offset: 0

Views

Author

Natalia L. Skirrow, Aug 04 2025

Keywords

Comments

For the purposes of the recurrence, the region of the array above the triangle is filled with 0's.
In the cellular automaton, on binary representations, that starts with s = 2^n-1 on iteration t=0, then each iteration sets s := s XOR (s<<1 AND s<<2 AND ... AND s<
With respect to n, T(n,k) is in Theta(n^k); this corresponds with the k-th cellular automaton growing with width Theta(t^(1/k)).
Rows are not always unimodal! Row 18 (1 < 18 < 104 < 512 > 496 < 1986 < 2048 > 1024 > 512 = 512 > 256 > 128 > 64 > 32 > 16 > 8 > 4 > 2 > 1) is the first exception.

Examples

			Table begins
  n\k| 0  1  2   3   4   5   6   7   8  9 10 11 12 13 14 15
  ---+-----------------------------------------------------
   0 | 1
   1 | 1  1
   2 | 1  2  1
   3 | 1  3  2   1
   4 | 1  4  4   2   1
   5 | 1  5  7   4   2   1
   6 | 1  6  8   8   4   2   1
   7 | 1  7 16  15   8   4   2   1
   8 | 1  8 25  16  16   8   4   2   1
   9 | 1  9 26  32  31  16   8   4   2  1
  10 | 1 10 28  64  32  32  16   8   4  2  1
  11 | 1 11 31 113  64  63  32  16   8  4  2  1
  12 | 1 12 32 114 128  64  64  32  16  8  4  2  1
  13 | 1 13 64 116 256 128 127  64  32 16  8  4  2  1
  14 | 1 14 97 120 481 256 128 128  64 32 16  8  4  2  1
  15 | 1 15 98 127 482 512 256 255 128 64 32 16  8  4  2  1
Binary expansions of the k=2 column:
  . . . . . . . . . . . . 11111111111111111111111
  . . . . . . . . . . . .1 1111111111111111111111
  . . . . . . 11111111111 . . . . . . 11111111111
  . . . . . .1 1111111111 . . . . . .1 1111111111
  . . . 11111 . . . 11111 . . . 11111 . . . 11111
  . . .1 1111 . . .1 1111 . . .1 1111 . . .1 1111
  . .11 . .11 . .11 . .11 . .11 . .11 . .11 . .11
  . 1 1 . 1 1 . 1 1 . 1 1 . 1 1 . 1 1 . 1 1 . 1 1
  .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 .1
The recurrence emulates binary counting, albeit with k X k 'metabits' in this diagram; the bit being  carried to is filled along the diagonal, followed by a single number in which all metabits are full and the 0th bit is on.
		

Crossrefs

Cf. A338888 (column k=2).

Programs

  • Mathematica
    A351995[n_, k_] := If[n <= 1, n, Total[2^(k*(Flatten[Position[Reverse[IntegerDigits[n, 2]], 1]] - 1))]];
    A385674[n_, k_] := 2*(2^k - 1)*A351995[#[[1]], k] + If[#[[2]] == k, 1, 2*2^(k*IntegerExponent[#[[1]], 2])*(1 + 2^#[[2]] - 2^k)] & [QuotientRemainder[n, k + 1]];
    Table[A385674[n, k], {n, 0, 15}, {k, 0, n}] (* Paolo Xausa, Sep 04 2025 *)
  • PARI
    lista(nn) = my(m=matrix(nn, nn)); for (n=1, nn, m[n,n] = 1; for (k=1, n-1, for (i=1, k-1, m[n,k] = bitor(m[n,k], m[n-i,k]);); m[n,k]++;);); my(vrows=vector(nn, i, vector(i, k, m[i,k]))); vrows; \\ Michel Marcus, Aug 04 2025
  • Python
    from functools import reduce
    ORsum=lambda l: reduce(int._or_,l,0)
    A351995=lambda n,k: ORsum(map(lambda i: (n>>i&1)<<(i*k),range(n.bit_length()))) if k else n.bit_count()
    T=lambda n,k: 2*~(~0<A351995(d:=n//(k+1),k)+((r:=n%(k+1))==k or (d&-d)**k*2*(1+2**r-2**k))
    #corollary 1:
    T=lambda n,k: T(n-(k+1<<(l:=(d:=n//(k+1)).bit_length()-1)),k)|(~(~0<k else int(n==k)
    bit=lambda n,k,i: (i%k==n%(k+1) if n%(k+1)>i//k&1) if i else n%(k+1)==k #returns i-th bit of T(n,k)
    

Formula

Let d = floor(n/(k+1)) and m = n mod (k+1), then
T(n,k) = 2 * (2^k-1) * A351995(d,k) + b(n,k) where b(n,k) = 1 if n==k (mod k+1), otherwise b(n,k) = 2*2^(k*val_2(d))*(1+2^m-2^k).
Bounds: 2*(n/(k+1))^k <= T(n,k) <= 2*(2^k-1) * ((n-k)/(k+1))^k+1, with upper equality when n is of form 2^(k*i+1) and lower when n is of form (2^k-1)*2^(k*i+1).
T(n,k) = T(n-(k+1)*2^floor(log_2(d)),k) + 2^(k*floor(log_2(d))+1)*(if d is a power of 2 and m != k then 2^m, else 2^k-1).
O.g.f. for k-th column: 2*(2^k-1) * (Sum_{i>=0} 2^(k*i) * x^((k+1)*2^i) / (1+x^((k+1)*2^i))) / (1-x) + x^k / (1-x^(k+1)) + 2 * ((1-2^k) * (1-x^k)/(1-x) + (1-(2*x)^k)/(1-2*x)) * Sum_{i>=0} 2^(k*i) * x^((k+1)*2^i) / (1-x^((k+1)*2^(i+1))).
Showing 1-3 of 3 results.