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.

A345038 Triangle T(n,k) read by rows of the smallest centered n-gonal number greater than 1 that is also centered k-gonal, or 0 if none exists, for 1 <= k <= n.

Original entry on oeis.org

2, 7, 3, 4, 31, 4, 0, 13, 85, 5, 16, 31, 31, 181, 6, 7, 7, 19, 61, 331, 7, 22, 43, 316, 841, 106, 547, 8, 121, 0, 361, 25, 22801, 169, 841, 9, 0, 91, 10, 0, 1891, 91, 253, 1225, 10, 11, 31, 31, 61, 31, 61, 2101, 361, 1711, 11, 67, 111, 166, 8581, 1156, 397, 6931, 179479609, 496, 2311, 12
Offset: 1

Views

Author

Mohammed Yaseen, Jun 06 2021

Keywords

Comments

The i-th centered j-gonal number is j*i*(i-1)/2 + 1. Thus if the p-th centered n-gonal number is also the q-th centered k-gonal number, then n*p*(p-1) = k*q*(q-1). Therefore T(n,k) = n*p*(p-1)/2 + 1 = k*q*(q-1)/2 + 1 iff n*p*(p-1) = k*q*(q-1) has a nontrivial positive integer solution. Otherwise T(n,k) = 0. It also implies that when T(n,k) = 0, T(r*n,r*k) = 0 for any positive integer r.

Examples

			The triangle begins:
   2;
   7,   3;
   4,  31,   4;
   0,  13,  85,   5;
  16,  31,  31, 181,   6;
   7,   7,  19,  61, 331,   7;
  22,  43, 316, 841, 106, 547,   8;
  ...
		

Crossrefs

Programs

  • PARI
    iszero(n,k)={if(issquare(n) && issquare(k) && n<>k, my(t=n-k); fordiv(t, d, my(p=(d+t/d)/2/sqrtint(n), q=(d-t/d)/2/sqrtint(k)); if(abs(p)!=1 && !frac(p) && !frac(q) && p%2==1 && q%2==1, return(0))); 1, 0)}
    T(n, k)={my(g=gcd(n,k)); n/=g; k/=g; if(iszero(n, k), 0, for(p=2, oo, my(t=n*p*(p-1)/2); if(t%k==0 && ispolygonal(t/k, 3), return(t*g+1))))} \\ Andrew Howroyd, Jun 08 2021

Formula

T(n,n) = n+1.