A342326 a(n) is the smallest nonnegative integer that can be written as a sum of two distinct nonzero triangular numbers in exactly n ways or -1 if no such integer exists.
0, 4, 16, 81, 471, 2031, 1381, 11781, 6906, 17956, 34531, 123256, 40056, 305256, 863281, 448906, 200281, 1957231, 520731, 10563906, 1001406, 11222656, 7631406, 3454506, 1482081, 75865156, 7172606106, 8852431, 25035156, 334020781, 13018281, 38531031, 7410406, 7014160156
Offset: 0
Keywords
Examples
a(1) = 4 = 1 + 3; a(2) = 16 = 1 + 15 = 6 + 10; a(3) = 81 = 3 + 78 = 15 + 66 = 36 + 45.
Links
- Martin Ehrenstein, Table of n, a(n) for n = 0..37
Programs
-
Mathematica
r = 125000; (* generates the first 12 terms of the sequence *) lst = Table[0, {r}]; lim = Floor[Sqrt[2r]]; Do[ num = (i^2 + i)/2 + (j^2 + j)/2; If[num <= r, lst[[num]]++], {i, lim}, {j, i - 1}]; First /@ (Flatten@Position[lst, #] & /@ Range[Max[lst]])
-
PARI
upto(n) = {my(v = vector(n)); res = vector(10); for(i = 1, (sqrtint(8*n + 1)-1)\2, bi = binomial(i + 1, 2); for(j = i+1, (sqrtint(8*(n - bi))-1)\2, v[bi + binomial(j+1, 2)]++ ) ); for(i = 1, #v, if(v[i] > 0, if(v[i] > #res, res = concat(res, vector(v[i] - #res)); ); if(res[v[i]] == 0, res[v[i]] = i ) ) ); concat(0, res) } \\ David A. Corneth, Mar 08 2021
Formula
a(n) = min { m >= 0 : A307597(m) = n }. - Alois P. Heinz, Mar 08 2021
Extensions
a(13)-a(18) from Alois P. Heinz, Mar 08 2021
a(19)-a(25) from David A. Corneth, Mar 08 2021
a(26)-a(33) from Jon E. Schoenfield, Mar 09 2021 (some terms first found by David A. Corneth)
Comments