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.

A370526 Square array read by descending antidiagonals: Define function b(i,n,k) where b(0,n,k) = n, b(1,n,k) = k, b(i,n,k) = A038502(b(i-1,n,k) + b(i-2,n,k)). T(n,k) is the number of steps until reaching the cyclic part of {b(i,n,k)}, or -1 if no cycle exists.

Original entry on oeis.org

0, 0, 0, 12, 0, 4, 3, 24, 13, 7, 6, 0, 14, 0, 1, 11, 12, 11, 5, 5, 18, 17, 12, 23, 0, 15, 4, 3, 2, 4, 19, 2, 8, 5, 1, 1, 17, 3, 4, 24, 0, 13, 12, 7, 5, 4, 11, 14, 10, 27, 23, 10, 19, 14, 5, 4, 6, 10, 0, 11, 14, 9, 0, 12, 1, 4, 14, 13, 11, 10, 22, 10, 29, 15
Offset: 1

Views

Author

Yifan Xie, Feb 21 2024

Keywords

Comments

b(i,n,k) = (b(i-1,n,k) + b(i-2,n,k))/p^valuation(b(i-1,n,k) + b(i-2,n,k), p), i.e., b(i,n,k) is b(i-1,n,k) + b(i-2,n,k) with all factors of p removed, where p = 3 in this sequence. Therefore, b(i,n,k) is not divisible by 3 for i >= 3.
At least one of b(i,n,k) < b(i-1,n,k) + b(i-2,n,k) and b(i+1,n,k) < b(i-1,n,k) + b(i,n,k) is true for i >= 5.
It appears that all repetends have the form of (1, 1, 2) (the position of 2 possibly changed), multiplied by G = A038502(gcd(n,k)).
Conjecture: T(n,k) >= 0.
This conjecture can be supported by a heuristic argument: Using dynamic programming, we can compute that for p's in A000057, the probability that b(i-1,n,k) + b(i-2,n,k) is not divisible by p is (p-2)/p, and the probability that valuation(b(i-1,n,k) + b(i-2,n,k), p) = x (x >= 1) is 2*(p-1)/p^(x+1). Therefore, the mathematical expectation of a(i) is (a(i-1,n,k) + a(i-2,n,k))*(p-1)/(p+1), which is exactly the average of the earlier two terms when p = 3, and larger when p >= 5.

Examples

			Array begins:
  n\k|  1   2   3   4   5   6   7
  ---+--------------------------------
  1  |  0,  0, 12,  3,  6, 11, 17, ...
  2  |  0,  0, 24,  0, 12, 12,  4, ...
  3  |  4, 13, 14, 11, 23, 19,  4, ...
  4  |  7,  0,  5,  0,  2, 24, 10, ...
  5  |  1,  5, 15,  8,  0, 27, 11, ...
  6  | 18,  4,  5, 13, 23, 14, 10, ...
  7  |  3,  1, 12, 10,  9,  7, 29, ...
  ...
T(1,4) = 3 because its sequence b begins with b(0) = 1, b(1) = 4, b(2) = A038502(1+4) = 5, b(3) = A038502(4+5) = 1, b(4) = 2, b(5) = 1, b(6) = 1, which has reached the cyclic part of (1, 2, 1) at i=3.
		

Crossrefs

Programs

  • PARI
    T(n, k)={my(i=-1, z=0); while((z != 2*n || z != 2*k) && (n != 2*z || n != 2*k) && (k != 2*n || k != 2*z), z=n; n=k; k=(z+n)/3^(valuation(z+n, 3)); i++); i; };

Formula

T(n,k) = 0 iff n = k, n = 2*k or k = 2*n and gcd(x,y) is not divisible by 3.