OFFSET
0,2
COMMENTS
It appears this sequence gives all nonnegative m such that 120*m^2 + 120*m + 1 is a square.
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (1,22,-22,-1,1).
FORMULA
a(n) = 22*a(n-2) - a(n-4) + 10, for n > 3.
G.f.: 2*x*(2 + x + 2*x^2)/((1-x)*(1-22*x^2+x^4)). - Maksym Voznyy (voznyy(AT)mail.ru), Aug 11 2009
MATHEMATICA
LinearRecurrence[{1, 22, -22, -1, 1}, {0, 4, 6, 98, 142}, 41] (* G. C. Greubel, Mar 14 2023 *)
PROG
(Magma) R<x>:=PowerSeriesRing(Integers(), 40); [0] cat Coefficients(R!( 2*x*(2+x+2*x^2)/((1-x)*(1-22*x^2+x^4)) )); // G. C. Greubel, Mar 14 2023
(SageMath)
@CachedFunction
def a(n): # a = A105037
if (n<5): return (0, 4, 6, 98, 142)[n]
else: return a(n-1) +22*a(n-2) -22*a(n-3) -a(n-4) +a(n-5)
[a(n) for n in range(41)] # G. C. Greubel, Mar 14 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Gerald McGarvey, Apr 03 2005
STATUS
approved