OFFSET
1,3
LINKS
Donovan Johnson, Table of n, a(n) for n = 1..145
MATHEMATICA
triangularQ[n_] := IntegerQ[Sqrt[8n + 1]]; a[1] = 0; a[n_] := a[n] = (b = Sqrt[a[n-1]]; While[b++; ! triangularQ[b^2 - a[n-1]]]; b^2); Table[a[n], {n, 1, 25}] (* Jean-François Alcover, Oct 04 2011 *)
PROG
(Haskell)
a036449 n = a036449_list !! (n-1)
a036449_list = map fst listsOfValsAndDiffs
a189475 n = a189475_list !! (n-1)
a189475_list = tail $ map snd listsOfValsAndDiffs
listsOfValsAndDiffs = (0, 1) : f (0, 1) where
f (x, y) = (u, v) : f (u, v) where
u = x + v
v = head $ dropWhile ((== 0) . a010052 . (+ x)) $ tail a000217_list
-- Reinhard Zumkeller, Apr 23 2011
(Python)
from itertools import count, islice
from sympy import integer_nthroot
def A036449_gen(): # generator of terms
yield (a:=0)
for n in count(1):
if integer_nthroot(((b:=n**2)-a<<3)+1, 2)[1]:
yield (a:=b)
CROSSREFS
KEYWORD
nonn,nice
AUTHOR
EXTENSIONS
Offset corrected by Donovan Johnson, Jan 20 2011
STATUS
approved