login
A036449
Values square, differences triangular.
4
0, 1, 4, 25, 196, 1681, 2116, 18769, 168100, 1510441, 13586596, 14577124, 15856324, 16120225, 16289296, 16736281, 150601984, 151782400, 1365967681, 1368334081, 1393379584, 1640655025, 1649578225, 1669212736, 1725737764
OFFSET
1,3
LINKS
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)
A036449_list = list(islice(A036449_gen(), 20)) # Chai Wah Wu, Nov 14 2022
CROSSREFS
Cf. A000217, A010052, A000290, A010054, A189475 (first differences).
Sequence in context: A171791 A060908 A322442 * A051500 A206179 A151342
KEYWORD
nonn,nice
EXTENSIONS
Offset corrected by Donovan Johnson, Jan 20 2011
STATUS
approved