OFFSET
2,1
COMMENTS
On the Japanese TV show "Tsuki no Koibito", a girl told her boyfriend that she saw a heart in 4 coins. Actually there are a total of 6 distinct patterns appearing in 2 X 2 coins in which each pattern consists of a part of the perimeter of each coin and forms a continuous area.
LINKS
Kival Ngaokrajang, Illustration of initial terms (U)
Index entries for linear recurrences with constant coefficients, signature (0,2,0,-1).
FORMULA
From Colin Barker, Oct 30 2013: (Start)
a(n) = (-1 + (-1)^n - (-3 + (-1)^n)*n)/2 for n>3.
a(n) = n for n>3 and even.
a(n) = 2*n-1 for n > 3 and odd.
a(n) = 2*a(n-2) - a(n-4) for n>7.
G.f.: -x^2*(x^5-x^3-4*x-2) / ((x-1)^2*(x+1)^2).(End)
MATHEMATICA
With[{nn=60}, Join[{2, 4}, Riffle[Range[4, nn, 2], Range[9, 2nn+1, 4]]]] (* Harvey P. Dale, Feb 11 2015 *)
PROG
(Small Basic)
For n = 2 To 100
If Math.Remainder(n, 2) = 0 then
a = n
Else
a = a + n
If n = 3 then
a = a - 1
endif
EndIf
TextWindow.Write(a+", ")
EndFor
(PARI) Vec(-x^2*(x^5-x^3-4*x-2)/((x-1)^2*(x+1)^2) + O(x^100)) \\ Colin Barker, Oct 30 2013
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Kival Ngaokrajang, Oct 19 2013
STATUS
approved