Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #27 Aug 16 2021 05:34:19
%S 0,1,3,36,9801,40755,121771,297045,631125,1212751,2158695,3617601,
%T 5773825,8851275,13117251,18886285,26523981,36450855,49146175,
%U 65151801,85076025,109597411,139468635,175520325,218664901,269900415,330314391,401087665,483498225,578925051,688851955,814871421
%N Least nonnegative number greater than the previous number which is simultaneously an n-gonal and (n+1)-gonal number.
%C Also the least nontrivial number simultaneously an n and (n+1)-gonal number for n greater than one.
%C 0 and 1 are always terms of any sequence of polygonal numbers of a particular rank beginning with index 0.
%C Since the formula for the k-th n-gonal number P(n,k) is k*(4+k*(n-2)-n)/2, one can extrapolate for the non-geometrical terms 0, 1 and 2.
%C Indices of the n and (n+1)-gonal numbers by pairs: {0, 0} {1, 1}, {3, 2}, {8, 6}, {99, 81}, {165, 143}, {247, 221}, {345, 315}, {459, 425}, {589, 551}, {735, 693}, {897, 851} ..., .
%C {x, y} of the above are {8n^2 + 10n - 3, 8n^2 - 10n - 7} for n>3 (A303295).
%C In the first 1000 terms, 1 is congruent to 0 (mod 6), 333 are congruent to 1 (mod 6), and 666 are congruent to 3 (mod 6).
%H <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (6,-15, 20,-15,6,-1).
%F a(n) = 32n^5 - 112n^4 + 70n^3 + 93n^2 - 57n - 35 for n > 3; a(0) = 0, a(1) = 1, a(2) = 3, a(3) = 36.
%F G.f.: x*(1 - 3*x + 33*x^2 + 9610*x^3 - 17556*x^4 + 23575*x^5 - 17753*x^6 + 7122*x^7 - 1189*x^8)/(1 - x)^6. - _Stefano Spezia_, Jun 08 2021
%e a(3) is the least triangular and square number > 3, which is 36: A001110(2).
%e a(4) is the least square and pentagonal number > 36, which is 9801: A036353(2).
%t a[n_] := Intersection[ Table[ PolygonalNumber[n, i], {i, 2, 10000}], Table[ PolygonalNumber[n + 1, i], {i, 2, 10000}]][[1]]; a[0] = 0; a[1] = 1; Array[a, 30, 0] (* Or *)
%t a[n_] := a[n] = 6a[n - 1] -15a[n - 2] +20a[n - 3] -15a[n - 4] +6a[n - 5] -a[n - 6]; a[0] = 0; a[1] = 1; a[2] = 3; a[3] = 36; a[4] = 9801; a[5] = 40755; a[6] = 121771; a[7] = 297045; a[8] = 631125; a[9] = 1212751; Array[a, 30, 0]
%Y Cf. A001110, A036353, A046180, A048903, A048906, A048924, A203627, A189216.
%K nonn,easy
%O 0,3
%A _Robert G. Wilson v_, Jun 04 2021