Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #23 Nov 14 2022 20:02:20
%S 0,1,4,25,196,1681,2116,18769,168100,1510441,13586596,14577124,
%T 15856324,16120225,16289296,16736281,150601984,151782400,1365967681,
%U 1368334081,1393379584,1640655025,1649578225,1669212736,1725737764
%N Values square, differences triangular.
%H Donovan Johnson, <a href="/A036449/b036449.txt">Table of n, a(n) for n = 1..145</a>
%t 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 *)
%o (Haskell)
%o a036449 n = a036449_list !! (n-1)
%o a036449_list = map fst listsOfValsAndDiffs
%o a189475 n = a189475_list !! (n-1)
%o a189475_list = tail $ map snd listsOfValsAndDiffs
%o listsOfValsAndDiffs = (0,1) : f (0,1) where
%o f (x,y) = (u,v) : f (u,v) where
%o u = x + v
%o v = head $ dropWhile ((== 0) . a010052 . (+ x)) $ tail a000217_list
%o -- _Reinhard Zumkeller_, Apr 23 2011
%o (Python)
%o from itertools import count, islice
%o from sympy import integer_nthroot
%o def A036449_gen(): # generator of terms
%o yield (a:=0)
%o for n in count(1):
%o if integer_nthroot(((b:=n**2)-a<<3)+1,2)[1]:
%o yield (a:=b)
%o A036449_list = list(islice(A036449_gen(),20)) # _Chai Wah Wu_, Nov 14 2022
%Y Cf. A000217, A010052, A000290, A010054, A189475 (first differences).
%K nonn,nice
%O 1,3
%A _David W. Wilson_
%E Offset corrected by _Donovan Johnson_, Jan 20 2011