OFFSET
0,1
COMMENTS
From the 2006 Collaborative Problem Solving Contest, written by Tom Clymer. It repeats forever, obviously. If the terms are thought of as the absolute value of the difference of the digits, then the -7's should all be 7 instead, but the remaining terms are unchanged. (The original puzzle sequence had only 2,4,5,3,9 given).
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
National Assessment and Testing, the sponsor of the contest from which this problem comes.
The 2006 Collaborative Problem Solving Contest, 2006 is the source of this puzzle.
Index entries for linear recurrences with constant coefficients, signature (0,0,0,1).
FORMULA
From Colin Barker, Oct 21 2017: (Start)
G.f.: (2 + 4*x + 5*x^2 + 3*x^3 + 7*x^4 - 11*x^5) / ((1 - x)*(1 + x)*(1 + x^2)).
a(n) = (5 + 9*(-1)^n + (2 - 5*i)*(-i)^n + (2+5*i)*i^n) / 2 for n>1.
a(n) = a(n-4) for n>6.
(End)
EXAMPLE
Since a(0) = 2, a(1) = 2^2 = 4 and since a(1) = 4, a(2) = the difference of the digits of 16 = 5.
PROG
(PARI) Vec((2 + 4*x + 5*x^2 + 3*x^3 + 7*x^4 - 11*x^5) / ((1 - x)*(1 + x)*(1 + x^2)) + O(x^100)) \\ Colin Barker, Oct 21 2017
CROSSREFS
KEYWORD
base,sign,easy
AUTHOR
Joshua Zucker, Apr 06 2006
STATUS
approved