OFFSET
1,2
COMMENTS
Ordered list of differences between even squares.
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,0,1,-1).
FORMULA
Numbers of the form (2m)^2 - (2n)^2, sorted.
From Chai Wah Wu, Sep 01 2024: (Start)
a(n) = a(n-1) + a(n-3) - a(n-4) for n > 4.
G.f.: 4*x^2*(x + 1)^2/(x^4 - x^3 - x + 1). (End)
EXAMPLE
(2*0)^2 - (2*0)^2 = 0,
(2*1)^2 - (2*0)^2 = 4,
(2*2)^2 - (2*1)^2 = 12,
(2*2)^2 - (2*0)^2 = 16,
(2*3)^2 - (2*2)^2 = 20,
...
MAPLE
a := proc(n) option remember; if n = 1 then 0 elif n = 2 then 4 elif n = 3 then 12 else a(floor((1/2)*n)) + a(1+ceil((1/2)*n)) end if; end proc:
seq(a(n), n = 1..50); # Peter Bala, Aug 03 2022
PROG
(Python)
def DifferenceOfEvenSquares(maximumBound):
sequence = set([0])
for x in range(0, maximumBound+1, 4):
if x % 16 != 8:
sequence.add(x)
print(sorted(sequence))
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Matthew Burch, Jan 22 2016
STATUS
approved