login
a(n) is the index of F(n+1) at the unique occurrence of the ordered pair of reversed consecutive terms (F(n+1),F(n)) in Stern's diatomic sequence A002487, where F(k) denotes the k-th term of the Fibonacci sequence A000045.
33

%I #61 May 01 2024 01:55:09

%S 1,3,5,13,21,53,85,213,341,853,1365,3413,5461,13653,21845,54613,87381,

%T 218453,349525,873813,1398101,3495253,5592405,13981013,22369621,

%U 55924053,89478485,223696213,357913941,894784853,1431655765,3579139413

%N a(n) is the index of F(n+1) at the unique occurrence of the ordered pair of reversed consecutive terms (F(n+1),F(n)) in Stern's diatomic sequence A002487, where F(k) denotes the k-th term of the Fibonacci sequence A000045.

%C If the Fibonacci pairs are kept in the natural order (F(n),F(n+1)), it appears that the first term of the pair occurs in A002487 at the index given by A061547(n).

%C Equals row sums of triangle A177954. - _Gary W. Adamson_, May 15 2010

%C Starting at n=3, begin subtracting from (2^(n-1)-1)/2^(n-1): 3/4 - 1/2 = 1/4 with 1+4=5=a(3); 7/8 - 1/4 = 5/8 with 5+8=13=a(4); 15/16 - 5/8 = 5/16 with 5+16=21= a(5); 31/32 - 5/16 = 21/32 with 21+32=53=a(6); 63/64 - 21/32 = 21/64 with 21+64=85=a(7) and so on. For n odd in the first fraction (2^(n-1)-1)/2^(n-1), the result approaches 1/3, and for n even in the first fraction, the result approaches 2/3. - _J. M. Bergot_, May 08 2015

%C Also, the decimal representation of the x-axis, from the left edge to the origin, of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 678", based on the 5-celled von Neumann neighborhood, initialized with a single black (ON) cell at stage zero. See A283641. - _Robert Price_, Mar 12 2017

%H A. J. Macfarlane, <a href="https://www.damtp.cam.ac.uk/user/ajm/Papers2016/GFsForCAsOfEvenRuleNo.ps">Generating functions for integer sequences defined by the evolution of cellular automata...</a>, Fig. 12.

%F It appears that a(n)=(4^((n+1)/2)-1)/3 if n is odd and a(n)=(a(n-1)+a(n+1))/2 if n is even.

%F G.f.: (1+2*x-2*x^2)/((1-x)*(1-4*x^2)); a(n) = 2^(n-1)(3-(-1)^n/3)-1/3 (offset 0); a(n) = Sum{k=0..n+1, 4^floor(k/2)/2} (offset 0); a(2n) = A002450(n+1) (offset 0); a(2n+1) = A072197(n) (offset 0). - _Paul Barry_, May 21 2004

%F a(n+2) = 4*a(n) + 1, a(1) = 1, a(2) = 3, n > 0. - _Yosu Yurramendi_, Mar 07 2017

%F a(n+1) = a(n) + A158302(n), a(1) = 1, n > 0. - _Yosu Yurramendi_, Mar 07 2017

%e A002487 begins 0,1,1,2,1,3,2,... with offset 0. Thus a(1)=1 since (F(2),F(1)) = (1,1) occurs at term 1 of A002487. Similarly, a(2)=3 and a(3)=5, since (F(3),F(2))=(2,1) occurs at term 3 and (F(4),F(3))=(3,2) at term 5 of A002487.

%t f[n_] := Module[{a = 1, b = 0, m = n}, While[m > 0, If[OddQ@ m, b = a + b, a = a + b]; m = Floor[m/2]]; b]; a = Table[f[n], {n, 0, 10^6}]; b = Reverse /@ Partition[Map[Fibonacci, Range[Ceiling@ Log[GoldenRatio, Max@ a] + 1]], 2, 1]; Map[If[Length@ # > 0, #[[1, 1]] - 1, 0] &@ SequencePosition[a, #] &, b] (* _Michael De Vlieger_, Mar 15 2017, Version 10.1, after _Jean-François Alcover_ at A002487 *)

%o (PARI) a(n)=if(n%2,2^(n+1),2^(n+1)+2^(n-1))\3 \\ _Charles R Greathouse IV_, May 08 2015

%o (Magma) [2^(n-1)*(3-(-1)^n/3)-1/3: n in [0..35]]; // _Vincenzo Librandi_, May 09 2015

%o (Python)

%o def A086893(n): return (1<<n+1 if n&1 else 5<<n-1)//3 # _Chai Wah Wu_, Apr 29 2024

%Y Cf. A000045, A002487, A061547, A077954, A283641, A372286, A372352.

%Y Interleaving of A002450\{0} and A072197.

%Y Positive terms of A096773 in ascending order.

%Y Partial sums of A158302.

%K nonn,easy

%O 1,2

%A _John W. Layman_, Sep 18 2003

%E More terms from _Paul Barry_, May 21 2004