OFFSET
0,2
COMMENTS
LINKS
Andrey Zabolotskiy, Table of n, a(n) for n = 0..5000
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 *)
PROG
(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=', ')
(PARI) a(n) = {k = 1; while (! issquare(n^2 + k*(k+1)/2), k++); k; } \\ Michel Marcus, Nov 20 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
Alex Ratushnyak, Nov 19 2013
STATUS
approved