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-4 of 4 results.

A341520 Square array A(n,k) = A156552(A005940(1+n)*A005940(1+k)), read by antidiagonals.

Original entry on oeis.org

0, 1, 1, 2, 3, 2, 3, 5, 5, 3, 4, 7, 6, 7, 4, 5, 9, 11, 11, 9, 5, 6, 11, 10, 15, 10, 11, 6, 7, 13, 13, 19, 19, 13, 13, 7, 8, 15, 14, 23, 12, 23, 14, 15, 8, 9, 17, 23, 27, 21, 21, 27, 23, 17, 9, 10, 19, 18, 31, 22, 27, 22, 31, 18, 19, 10, 11, 21, 21, 35, 39, 29, 29, 39, 35, 21, 21, 11, 12, 23, 22, 39, 20, 47, 30, 47, 20, 39, 22, 23, 12
Offset: 0

Views

Author

Antti Karttunen, Feb 13 2021

Keywords

Comments

The indices run as A(0,0), A(0,1), A(1,0), A(0,2), A(1,1), A(2,0), etc. The array is symmetric.
This array defines a binary operation on the nonnegative integers that matches up the zeros in the binary representation of each operand (starting from the right, and including as many leading zeros as necessary) and concatenates the two (possibly null) strings of ones to the right of each matched pair of zeros. See the examples. - Peter Munn, Feb 14 2021.
As such it could be useful for implementing multiplication, say, in Turing machines, with a "tape-like" unary-binary encoding of the prime factorization of n (A156552). However, such representation is not very useful if addition or subtraction is also needed.

Examples

			The top left {0..15} X {0..16} corner of the array:
   0,  1,  2,  3,  4,  5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
   1,  3,  5,  7,  9, 11,  13,  15,  17,  19,  21,  23,  25,  27,  29,  31,
   2,  5,  6, 11, 10, 13,  14,  23,  18,  21,  22,  27,  26,  29,  30,  47,
   3,  7, 11, 15, 19, 23,  27,  31,  35,  39,  43,  47,  51,  55,  59,  63,
   4,  9, 10, 19, 12, 21,  22,  39,  20,  25,  26,  43,  28,  45,  46,  79,
   5, 11, 13, 23, 21, 27,  29,  47,  37,  43,  45,  55,  53,  59,  61,  95,
   6, 13, 14, 27, 22, 29,  30,  55,  38,  45,  46,  59,  54,  61,  62, 111,
   7, 15, 23, 31, 39, 47,  55,  63,  71,  79,  87,  95, 103, 111, 119, 127,
   8, 17, 18, 35, 20, 37,  38,  71,  24,  41,  42,  75,  44,  77,  78, 143,
   9, 19, 21, 39, 25, 43,  45,  79,  41,  51,  53,  87,  57,  91,  93, 159,
  10, 21, 22, 43, 26, 45,  46,  87,  42,  53,  54,  91,  58,  93,  94, 175,
  11, 23, 27, 47, 43, 55,  59,  95,  75,  87,  91, 111, 107, 119, 123, 191,
  12, 25, 26, 51, 28, 53,  54, 103,  44,  57,  58, 107,  60, 109, 110, 207,
  13, 27, 29, 55, 45, 59,  61, 111,  77,  91,  93, 119, 109, 123, 125, 223,
  14, 29, 30, 59, 46, 61,  62, 119,  78,  93,  94, 123, 110, 125, 126, 239,
  15, 31, 47, 63, 79, 95, 111, 127, 143, 159, 175, 191, 207, 223, 239, 255,
  16, 33, 34, 67, 36, 69,  70, 135,  40,  73,  74, 139,  76, 141, 142, 271,
...
From _Peter Munn_, Feb 24 2021: (Start)
We consider the case of n = 10, k = 41, following the procedure in the Feb 14 2021 comment.
First, write 10 and 41 in binary:
  10 = 1010_2
  41 = 101001_2
Add at least one leading zero to each number, equalizing number of zeros:
  0  0  1  0  1  0
  0  1  0  1  0  0  1
Align zeros, but separate ones:
  0     0  1     0  1  0
  |     |        |     |
  0  1  0     1  0     0  1
---------------------------
  0  1  0  1  1  0  1  0  1
Concatenating the ones, as shown above, we get 10110101_2 = 181.
So A(10, 41) = 181.
(End)
		

Crossrefs

Cf. A088698 (main diagonal).
Rows/columns 0-3: A001477, A005408, A341522, A004767. Row/column 7: A004771.
Cf. A341521 (the lower triangular section).

Programs

  • Mathematica
    Block[{nn = 12, a = {1}}, Do[AppendTo[a, If[EvenQ[i], Times @@ Map[Prime[PrimePi[#1] + 1]^#2 & @@ # &, FactorInteger[#]] &@ a[[(i/2) + 1]], 2 a[[((i - 1)/2) + 1]]]], {i, nn}]; Table[Floor@ Total@ Flatten@ MapIndexed[#1 2^(#2 - 1) &, Flatten[Table[2^(PrimePi@ #1 - 1), {#2}] & @@@ FactorInteger@ #]] &[a[[1 + n - k]]*a[[1 + k]] ], {n, 0, nn}, {k, n, 0, -1}]] // Flatten (* Michael De Vlieger, Feb 24 2021 *)
  • PARI
    up_to = 105;
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); (t); };
    A156552(n) = { my(f = factor(n), p, p2 = 1, res = 0); for(i = 1, #f~, p = 1 << (primepi(f[i, 1]) - 1); res += (p * p2 * (2^(f[i, 2]) - 1)); p2 <<= f[i, 2]); res };
    A341520sq(n,k) = A156552(A005940(1+n)*A005940(1+k));
    A341520list(up_to) = { my(v = vector(1+up_to), i=0); for(a=0,oo, for(col=0,a, i++; if(i > #v, return(v)); v[i] = A341520sq(col,(a-(col))))); (v); };
    v341520 = A341520list(up_to);
    A341520(n) = v341520[1+n];

Formula

A(x, y) = A156552(A005940(1+x) * A005940(1+y)).
For all n>=0, A(0, n) = A(n, 0) = n.
For all x>=0, y>=0, A(x, y) = A(y, x).
For all x, y, z >= 0, A(x, A(y, z)) = A(A(x, y), z).
From Antti Karttunen, Feb 27 2022: (Start)
For all x, y >= 0, A(x, y) = A(A351961(x,y), A351962(x,y)).
For x >= 0, y > 0, A(x, y) = A351960(x, A(x, A297164(y))).
(End)

A297164 Permutation of nonnegative integers: a(n) = A156552(A005940(1+n)-1).

Original entry on oeis.org

0, 1, 2, 3, 4, 7, 8, 5, 6, 17, 16, 23, 64, 65, 10, 9, 32, 19, 128, 129, 512, 67, 256, 47, 24, 4097, 20, 4099, 32768, 79, 1024, 11, 18, 31, 14, 29, 4096, 2049, 66, 515, 514, 263, 65536, 2053, 8388608, 524289, 16384, 87, 16777216, 2097153, 70, 524291, 17179869184, 287, 524288, 1037, 8388610, 289, 134217728, 1071, 520, 97, 38, 15, 12, 257, 8192, 63
Offset: 1

Views

Author

Antti Karttunen, Jan 05 2018

Keywords

Comments

Note the indexing: although the domain starts from 1, the range includes also zero.

Crossrefs

Inverse: A297163.
Cf. also A297166, A341520, A351960.

Programs

  • PARI
    A005940(n) = { my(p=2,t=1); n--; until(!n\=2, if(n%2, t*=p, p=nextprime(p+1))); t };
    A156552(n) = {my(f = factor(n), p, p2 = 1, res = 0); for(i = 1, #f~, p = 1 << (primepi(f[i, 1]) - 1); res += (p * p2 * (2^(f[i, 2]) - 1)); p2 <<= f[i, 2]); res}; \\ From A156552
    A297164(n) = A156552(A005940(1+n)-1); \\ Antti Karttunen, Feb 27 2022
  • Scheme
    (define (A297164 n) (A156552 (+ -1 (A005940 (+ 1 n)))))
    

Formula

a(n) = A156552(A005940(1+n)-1).

A351961 Square array A(n,k) = A156552(gcd(A005940(1+n), A005940(1+k))), read by antidiagonals.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 0, 1, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 1, 2, 1, 4, 1, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 0, 5, 0, 3, 0, 1, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 1, 2, 1, 0, 1, 6, 1, 0, 1, 2, 1, 0, 0, 0, 2, 0, 4, 0, 0, 0, 0, 4, 0, 2, 0, 0
Offset: 0

Views

Author

Antti Karttunen, Feb 26 2022

Keywords

Comments

The indices run as A(0,0), A(0,1), A(1,0), A(0,2), A(1,1), A(2,0), etc. The array is symmetric.

Examples

			The top left corner of the array:
   n=  0  1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17
-----|--------------------------------------------------------------
k= 0 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0,  0,  0,  0,  0,  0,
   1 | 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,  0,  1,  0,  1,  0,  1,  0,  1,
   2 | 0, 0, 2, 0, 0, 2, 2, 0, 0, 0,  2,  2,  0,  2,  2,  0,  0,  0,
   3 | 0, 1, 0, 3, 0, 1, 0, 3, 0, 1,  0,  3,  0,  1,  0,  3,  0,  1,
   4 | 0, 0, 0, 0, 4, 0, 0, 0, 0, 4,  4,  0,  4,  0,  0,  0,  0,  0,
   5 | 0, 1, 2, 1, 0, 5, 2, 1, 0, 1,  2,  5,  0,  5,  2,  1,  0,  1,
   6 | 0, 0, 2, 0, 0, 2, 6, 0, 0, 0,  2,  2,  0,  6,  6,  0,  0,  0,
   7 | 0, 1, 0, 3, 0, 1, 0, 7, 0, 1,  0,  3,  0,  1,  0,  7,  0,  1,
   8 | 0, 0, 0, 0, 0, 0, 0, 0, 8, 0,  0,  0,  0,  0,  0,  0,  0,  8,
   9 | 0, 1, 0, 1, 4, 1, 0, 1, 0, 9,  4,  1,  4,  1,  0,  1,  0,  1,
  10 | 0, 0, 2, 0, 4, 2, 2, 0, 0, 4, 10,  2,  4,  2,  2,  0,  0,  0,
  11 | 0, 1, 2, 3, 0, 5, 2, 3, 0, 1,  2, 11,  0,  5,  2,  3,  0,  1,
  12 | 0, 0, 0, 0, 4, 0, 0, 0, 0, 4,  4,  0, 12,  0,  0,  0,  0,  0,
  13 | 0, 1, 2, 1, 0, 5, 6, 1, 0, 1,  2,  5,  0, 13,  6,  1,  0,  1,
  14 | 0, 0, 2, 0, 0, 2, 6, 0, 0, 0,  2,  2,  0,  6, 14,  0,  0,  0,
  15 | 0, 1, 0, 3, 0, 1, 0, 7, 0, 1,  0,  3,  0,  1,  0, 15,  0,  1,
  16 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0,  0,  0,  0, 16,  0,
  17 | 0, 1, 0, 1, 0, 1, 0, 1, 8, 1,  0,  1,  0,  1,  0,  1,  0, 17,
		

Crossrefs

Cf. A001477 (main diagonal).
Cf. also A341520, A351960, A351962.

Programs

  • PARI
    up_to = 104; \\ 10439 = binomial(144+1,2)-1
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); (t); };
    A156552(n) = { my(f = factor(n), p, p2 = 1, res = 0); for(i = 1, #f~, p = 1 << (primepi(f[i, 1]) - 1); res += (p * p2 * (2^(f[i, 2]) - 1)); p2 <<= f[i, 2]); res };
    A351961sq(n,k) = A156552(gcd(A005940(1+n),A005940(1+k)));
    A351961list(up_to) = { my(v = vector(1+up_to), i=0); for(a=0,oo, for(col=0,a, i++; if(i > #v, return(v)); v[i] = A351961sq(col,(a-(col))))); (v); };
    v351961 = A351961list(up_to);
    A351961(n) = v351961[1+n];

Formula

For all x, y >= 0, A(x, y) = A(x, A351960(x,y)) = A(A351960(x,y), y).

A351962 Square array A(n,k) = A156552(lcm(A005940(1+n), A005940(1+k))), read by antidiagonals.

Original entry on oeis.org

0, 1, 1, 2, 1, 2, 3, 5, 5, 3, 4, 3, 2, 3, 4, 5, 9, 11, 11, 9, 5, 6, 5, 10, 3, 10, 5, 6, 7, 13, 5, 19, 19, 5, 13, 7, 8, 7, 6, 11, 4, 11, 6, 7, 8, 9, 17, 23, 27, 21, 21, 27, 23, 17, 9, 10, 9, 18, 7, 22, 5, 22, 7, 18, 9, 10, 11, 21, 21, 35, 39, 13, 13, 39, 35, 21, 21, 11, 12, 11, 10, 19, 20, 23, 6, 23, 20, 19, 10, 11, 12
Offset: 0

Views

Author

Antti Karttunen, Feb 26 2022

Keywords

Comments

The indices run as A(0,0), A(0,1), A(1,0), A(0,2), A(1,1), A(2,0), etc. The array is symmetric.

Examples

			The top left corner of the array:
      n=0   1   2   3   4   5    6    7    8   9   10   11   12
-----|-----------------------------------------------------------
k= 0 |  0,  1,  2,  3,  4,  5,   6,   7,   8,  9,  10,  11,  12,
   1 |  1,  1,  5,  3,  9,  5,  13,   7,  17,  9,  21,  11,  25,
   2 |  2,  5,  2, 11, 10,  5,   6,  23,  18, 21,  10,  11,  26,
   3 |  3,  3, 11,  3, 19, 11,  27,   7,  35, 19,  43,  11,  51,
   4 |  4,  9, 10, 19,  4, 21,  22,  39,  20,  9,  10,  43,  12,
   5 |  5,  5,  5, 11, 21,  5,  13,  23,  37, 21,  21,  11,  53,
   6 |  6, 13,  6, 27, 22, 13,   6,  55,  38, 45,  22,  27,  54,
   7 |  7,  7, 23,  7, 39, 23,  55,   7,  71, 39,  87,  23, 103,
   8 |  8, 17, 18, 35, 20, 37,  38,  71,   8, 41,  42,  75,  44,
   9 |  9,  9, 21, 19,  9, 21,  45,  39,  41,  9,  21,  43,  25,
  10 | 10, 21, 10, 43, 10, 21,  22,  87,  42, 21,  10,  43,  26,
  11 | 11, 11, 11, 11, 43, 11,  27,  23,  75, 43,  43,  11, 107,
  12 | 12, 25, 26, 51, 12, 53,  54, 103,  44, 25,  26, 107,  12,
  13 | 13, 13, 13, 27, 45, 13,  13,  55,  77, 45,  45,  27, 109,
  14 | 14, 29, 14, 59, 46, 29,  14, 119,  78, 93,  46,  59, 110,
  15 | 15, 15, 47, 15, 79, 47, 111,  15, 143, 79, 175,  47, 207,
  16 | 16, 33, 34, 67, 36, 69,  70, 135,  40, 73,  74, 139,  76,
		

Crossrefs

Cf. A001477 (main diagonal).
Cf. also A341520, A351960, A351961.

Programs

  • PARI
    up_to = 104;
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); (t); };
    A156552(n) = { my(f = factor(n), p, p2 = 1, res = 0); for(i = 1, #f~, p = 1 << (primepi(f[i, 1]) - 1); res += (p * p2 * (2^(f[i, 2]) - 1)); p2 <<= f[i, 2]); res };
    A351962sq(n,k) = A156552(lcm(A005940(1+n),A005940(1+k)));
    A351962list(up_to) = { my(v = vector(1+up_to), i=0); for(a=0,oo, for(col=0,a, i++; if(i > #v, return(v)); v[i] = A351962sq(col,(a-(col))))); (v); };
    v351962 = A351962list(up_to);
    A351962(n) = v351962[1+n];
Showing 1-4 of 4 results.