A086893 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.
1, 3, 5, 13, 21, 53, 85, 213, 341, 853, 1365, 3413, 5461, 13653, 21845, 54613, 87381, 218453, 349525, 873813, 1398101, 3495253, 5592405, 13981013, 22369621, 55924053, 89478485, 223696213, 357913941, 894784853, 1431655765, 3579139413
Offset: 1
Examples
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.
Links
- A. J. Macfarlane, Generating functions for integer sequences defined by the evolution of cellular automata..., Fig. 12.
Crossrefs
Programs
-
Magma
[2^(n-1)*(3-(-1)^n/3)-1/3: n in [0..35]]; // Vincenzo Librandi, May 09 2015
-
Mathematica
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 *)
-
PARI
a(n)=if(n%2,2^(n+1),2^(n+1)+2^(n-1))\3 \\ Charles R Greathouse IV, May 08 2015
-
Python
def A086893(n): return (1<
Chai Wah Wu, Apr 29 2024
Formula
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.
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
a(n+2) = 4*a(n) + 1, a(1) = 1, a(2) = 3, n > 0. - Yosu Yurramendi, Mar 07 2017
a(n+1) = a(n) + A158302(n), a(1) = 1, n > 0. - Yosu Yurramendi, Mar 07 2017
Extensions
More terms from Paul Barry, May 21 2004
Comments