%I #61 Sep 15 2023 04:25:35
%S 1,3,9,20,39,75,148,297,597,1196,2391,4779,9556,19113,38229,76460,
%T 152919,305835,611668,1223337,2446677,4893356,9786711,19573419,
%U 39146836,78293673,156587349,313174700,626349399,1252698795,2505397588,5010795177,10021590357
%N Lexicographically earliest sequence such that the sequence and its first and second differences share no terms, and the 3rd differences are equal to the original sequence.
%C 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
%C 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
%C From _Charlie Neder_, Jan 10 2019: (Start)
%C No two terms among this sequence and its first and second differences are equal.
%C 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)
%H David A. Corneth, <a href="/A202349/b202349.txt">Table of n, a(n) for n = 1..3318</a>
%H Mathematics Stack Exchange, <a href="https://math.stackexchange.com/q/4759478/573047">Conjectured recurrence/generating function for a binomial sum</a>.
%H <a href="/index/Se#sdian">Sequence and first differences include all numbers, etc.</a>
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (3,-3,2).
%F From _Colin Barker_, Jan 11 2019: (Start)
%F G.f.: x*(1 + 3*x^2) / ((1 - 2*x)*(1 - x + x^2)).
%F a(n) = 3*a(n-1) - 3*a(n-2) + 2*a(n-3) for n>2.
%F (End)
%F a(n) = Sum_{k=0..n-1} binomial(n-1,k)*(2^k mod 7). - _Fabio VisonĂ _, Sep 05 2023
%e 1 3 9 20 39 75 148 297 597 1196
%e 2 6 11 19 36 73 149 300 599
%e 4 5 8 17 37 76 151 299
%e 1 3 9 20 39 75 148 <-- the starting sequence
%t 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 *)
%o (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
%o (PARI) Vec(x*(1 + 3*x^2) / ((1 - 2*x)*(1 - x + x^2)) + O(x^40)) \\ _Colin Barker_, Jan 12 2019
%Y Cf. A024493, A130781, A069705 (inv. binom. transf. assuming offset 0).
%Y For many similar sequences, see the Index link.
%K nonn,base,easy
%O 1,2
%A _Eric Angelini_, Jun 21 2016
%E a(18)-a(33) from _Giovanni Resta_, Jun 21 2016