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.

A348040 Square array A(n,k) = the length of the common prefix in binary expansions of A156552(n) and A156552(k), read by antidiagonals.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Sep 27 2021

Keywords

Examples

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

Crossrefs

Cf. A252464 (main diagonal).
Cf. also A347380, A347381.

Programs

  • PARI
    up_to = 105;
    Abincompreflen(n, m) = { my(x=binary(n),y=binary(m),u=min(#x,#y)); for(i=1,u,if(x[i]!=y[i],return(i-1))); (u);};
    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
    A348040sq(x,y) = Abincompreflen(A156552(x), A156552(y));
    A348040list(up_to) = { my(v = vector(up_to), i=0); for(a=1,oo, for(col=1,a, i++; if(i > up_to, return(v)); v[i] = A348040sq(col,(a-(col-1))))); (v); };
    v348040 = A348040list(up_to);
    A348040(n) = v348040[n];