|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
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
(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
|
|
|
STATUS
|
approved
|
|
|
|