cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A287809 Number of septenary sequences of length n such that no two consecutive terms have distance 2.

This page as a plain text file.
%I A287809 #10 May 22 2025 10:21:46
%S A287809 1,7,39,219,1231,6921,38913,218789,1230147,6916539,38888455,218651553,
%T A287809 1229375193,6912200477,38864063403,218514412227,1228604118319,
%U A287809 6907865088537,38839687552689,218377358251349,1227833528067027,6903532420748427,38815326992539159
%N A287809 Number of septenary sequences of length n such that no two consecutive terms have distance 2.
%H A287809 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (6, 0, -13, 6).
%F A287809 For n>4, a(n) =  6*a(n-1) - 13*a(n-3) + 6*a(n-4), a(1)=7, a(2)=39, a(3)=219, a(4)=1231.
%F A287809 G.f.: (1 + x - 3*x^2 - 2*x^3 + 2*x^4)/(1 - 6*x + 13*x^3 - 6*x^4).
%e A287809 For n=2 the a(2)=49-10=39 sequences contain every combination except these ten: 02,20,13,31,24,42,35,53,46,64.
%t A287809 LinearRecurrence[{6, 0, -13, 6}, {1, 7, 39, 219, 1231}, 40]
%o A287809 (Python)
%o A287809 def a(n):
%o A287809  if n in [0, 1, 2, 3, 4]:
%o A287809   return [1, 7, 39, 219, 1231][n]
%o A287809  return 6*a(n-1)-13*a(n-3)+6*a(n-4)
%Y A287809 Cf. A040000, A003945, A083318, A078057, A003946, A126358, A003946, A055099, A003947, A015448, A126473. A287804-A287819.
%K A287809 nonn,easy
%O A287809 0,2
%A A287809 _David Nacin_, Jun 01 2017