A216267 Numbers that are both tetrahedral and pronic.
0, 20, 56, 7140, 1414910
Offset: 1
Programs
-
Mathematica
t = {}; Do[tet = n (n + 1) (n + 2)/6; s = Floor[Sqrt[tet]]; If[s^2 + s == tet, AppendTo[t, tet]], {n, 0, 1000}]; t (* T. D. Noe, Mar 18 2013 *) With[{nn=50000},Intersection[Binomial[Range[0,nn]+2,3],Table[n(n+1),{n,nn}]]] (* Harvey P. Dale, Apr 04 2016 *)
-
Python
def rootPronic(a): sr = 1<<33 while a < sr*(sr+1): sr>>=1 b = sr>>1 while b: s = sr+b if a >= s*(s+1): sr = s b>>=1 return sr for i in range(1<<20): a = i*(i+1)*(i+2)//6 t = rootPronic(a) if a == t*(t+1): print(a)
Extensions
fini, full keywords added by Max Alekseyev, Dec 28 2024
Comments