A232176 Least positive k such that n^2 + triangular(k) is a square.
1, 2, 6, 10, 14, 18, 7, 5, 8, 34, 6, 42, 46, 15, 54, 16, 14, 66, 70, 74, 23, 82, 9, 90, 17, 98, 102, 10, 110, 15, 25, 122, 126, 16, 39, 48, 40, 21, 150, 34, 158, 29, 54, 48, 30, 13, 182, 63, 55, 194, 56, 202, 14, 45, 214, 63, 222, 26, 41, 234, 31, 42, 39, 250, 32, 63
Offset: 0
Keywords
Links
- Andrey Zabolotskiy, Table of n, a(n) for n = 0..5000
Crossrefs
Programs
-
Mathematica
lpk[n_]:=Module[{k=1},While[!IntegerQ[Sqrt[n^2+(k(k+1))/2]],k++];k]; Array[ lpk,70,0] (* Harvey P. Dale, May 04 2018 *)
-
PARI
a(n) = {k = 1; while (! issquare(n^2 + k*(k+1)/2), k++); k;} \\ Michel Marcus, Nov 20 2013
-
Python
import math for n in range(77): n2 = n*n y=1 for k in range(1,10000001): sum = n2 + k*(k+1)//2 r = int(math.sqrt(sum)) if r*r == sum: print(str(k), end=',') y=0 break if y: print('-', end=',')
Comments