login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A045695 Number of ternary words of length n (beginning 0) with autocorrelation function 2^(n-1)+1. 1

%I #9 Mar 15 2024 05:38:43

%S 0,1,2,8,22,70,202,622,1844,5576,16658,50114,150140,450824,1351850,

%T 4056794,12168538,36509302,109522330,328578142,985717768,2957186620,

%U 8871509746,26614629466,79843738258,239531515054,718594094338

%N Number of ternary words of length n (beginning 0) with autocorrelation function 2^(n-1)+1.

%F a(2n) = 3*a(2n-1) + 2*a(n) for n >= 2; a(2n-1) = 3*a(2n-2) - a(n) for n >= 2

%p A045695 := proc(n)

%p if n <=2 then

%p n-1 ;

%p elif type(n,'even') then

%p 3*procname(n-1)+2*procname(n/2) ;

%p else

%p 3*procname(n-1)-procname((n+1)/2) ;

%p end if;

%p end proc: # _R. J. Mathar_, Oct 04 2014

%t a[n_] := If[n <= 2, n-1,

%t If[EvenQ[n], 3*a[n-1] + 2*a[n/2],

%t 3*a[n-1] - a[(n+1)/2]]];

%t Table[a[n], {n, 1, 27}] (* _Jean-François Alcover_, Mar 15 2024, after Maple code *)

%K nonn,changed

%O 1,3

%A TORSTEN.SILLKE(AT)LHSYSTEMS.COM

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 09:04 EDT 2024. Contains 371240 sequences. (Running on oeis4.)