OFFSET
1,2
COMMENTS
The sequence is completely determined by its first 3 terms. If the first terms are x, y, z, then the following terms are 2*x-3*y+3*z, 6*x-7*y+6*z, 12*x-12*y+11*z, 22*x-21*y+21*z, 42*x-41*y+42*z, 84*x-84*y+85*z, 170*x-171*y+171*z, 342*x-343*y+342*z. - Giovanni Resta, Jun 21 2016
Is it a theorem that, if x,y,z = 1,3,9, the sequence has the desired properties, or is it just a conjecture? - N. J. A. Sloane, Jun 21 2016
From Charlie Neder, Jan 10 2019: (Start)
No two terms among this sequence and its first and second differences are equal.
Proof: Representing the first and second differences by b(n) and c(n), we have that a-b is [-1, -3, -2, 1, 3, 2] with period 6, a-c is [-3, -2, -1, 3, 2, 1] with period 6, and b-c is [-2, 1, 3, 2, -1, -3] with period 6. Therefore, no two terms at the same index are equal. Since the sequence is forced to grow exponentially, only the first few terms need to be checked to confirm that no two terms at different indices are equal, proving the criterion always holds. (End)
LINKS
David A. Corneth, Table of n, a(n) for n = 1..3318
Mathematics Stack Exchange, Conjectured recurrence/generating function for a binomial sum.
Index entries for linear recurrences with constant coefficients, signature (3,-3,2).
FORMULA
From Colin Barker, Jan 11 2019: (Start)
G.f.: x*(1 + 3*x^2) / ((1 - 2*x)*(1 - x + x^2)).
a(n) = 3*a(n-1) - 3*a(n-2) + 2*a(n-3) for n>2.
(End)
a(n) = Sum_{k=0..n-1} binomial(n-1,k)*(2^k mod 7). - Fabio Visonà, Sep 05 2023
EXAMPLE
1 3 9 20 39 75 148 297 597 1196
2 6 11 19 36 73 149 300 599
4 5 8 17 37 76 151 299
1 3 9 20 39 75 148 <-- the starting sequence
MATHEMATICA
d = Differences; i = Intersection; sol = Solve[d@ d@ d@ Array[x, 50] == Array[x, 47], Array[x, 47, 4]][[1]]; a = (Array[x, 50] /. sol) /. {x[1] -> 1, x[2] -> 3, x[3] -> 9}; Print["Check = ", {i[a, d@ a], i[a, d@ d@ a], i[d@ a, d@ d@ a]}]; a (* Giovanni Resta, Jun 21 2016 *)
PROG
(PARI) first(n) = {n = max(n, 4); my(res = vector(n)); for(i = 1, 3, res[i] = 3^(i - 1)); for(i = 4, n, res[i] = 3 * res[i - 1] - 3 * res[i - 2] + 2 * res[i - 3]); res } \\ David A. Corneth, Jan 11 2019
(PARI) Vec(x*(1 + 3*x^2) / ((1 - 2*x)*(1 - x + x^2)) + O(x^40)) \\ Colin Barker, Jan 12 2019
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Eric Angelini, Jun 21 2016
EXTENSIONS
a(18)-a(33) from Giovanni Resta, Jun 21 2016
STATUS
approved