A030067 The "Semi-Fibonacci sequence": a(1) = 1; a(n) = a(n/2) (n even); a(n) = a(n-1) + a(n-2) (n odd).
1, 1, 2, 1, 3, 2, 5, 1, 6, 3, 9, 2, 11, 5, 16, 1, 17, 6, 23, 3, 26, 9, 35, 2, 37, 11, 48, 5, 53, 16, 69, 1, 70, 17, 87, 6, 93, 23, 116, 3, 119, 26, 145, 9, 154, 35, 189, 2, 191, 37, 228, 11, 239, 48, 287, 5, 292, 53, 345, 16, 361, 69, 430, 1, 431, 70, 501, 17, 518, 87, 605, 6, 611, 93
Offset: 1
Examples
a(1) = 1 by definition. a(2) = a(1) = 1. a(3) = 1 + 1 = 2. a(4) = a(2) = 1. a(5) = 2 + 1 = 3. a(6) = a(3) = 2. a(7) = 3 + 2 = 5. a(8) = a(4) = 1. a(9) = 5 + 1 = 6. a(10) = a(5) = 3.
Links
- T. D. Noe, Table of n, a(n) for n = 1..10000
- Abdulaziz M. Alanazi, Augustine O. Munagi and Darlison Nyirenda, Power Partitions and Semi-m-Fibonacci Partitions, arXiv:1910.09482 [math.CO], 2019.
- George E. Andrews, Binary and Semi-Fibonacci Partitions, Journal of Ramanujan Society of Mathematics and Mathematics Sciences, honoring A.K. Agarwal's 70th birthday, 7:1(2019), 01-06.
- Cristina Ballantine and George Beck, Partitions enumerated by self-similar sequences, arXiv:2303.11493 [math.CO], 2023.
- George Beck, Semi-Fibonacci Partitions
- Rémy Sigrist, Colored logarithmic scatterplot of the first 10000 terms (where the color is function of the 2-adic valuation of n)
Programs
-
Haskell
import Data.List (transpose) a030067 n = a030067_list !! (n-1) a030067_list = concat $ transpose [scanl (+) 1 a030067_list, a030067_list] -- Reinhard Zumkeller, Jul 21 2013, Jul 07 2013
-
Maple
f:=proc(n) option remember; if n=1 then RETURN(1) elif n mod 2 = 0 then RETURN(f(n/2)) else RETURN(f(n-1)+f(n-2)); fi; end;
-
Mathematica
semiFibo[1] = 1; semiFibo[n_?EvenQ] := semiFibo[n] = semiFibo[n/2]; semiFibo[n_?OddQ] := semiFibo[n] = semiFibo[n - 1] + semiFibo[n - 2]; Table[semiFibo[n], {n, 80}] (* Jean-François Alcover, Aug 19 2013 *)
-
PARI
a(n) = if(n==1, 1, if(n%2 == 0, a(n/2), a(n-1) + a(n-2))); vector(100, n, a(n)) \\ Altug Alkan, Oct 12 2015
-
Python
a=[1]; [a.append(a[-2]+a[-1] if n%2 else a[n//2-1]) for n in range(2, 75)] print(a) # Michael S. Branicky, Jul 07 2022
Formula
Theorem: a(2n+1) - a(2n-1) = a(n). Proof: a(2n+1) - a(2n-1) = a(2n) + a(2n-1) - a(2n-2) - a(2n-3) = a(n) - a(n-1) + a(n-1) (induction) = a(n). - N. J. A. Sloane, May 02 2010
a(2^n - 1) = A129092(n) for n >= 1, where A129092 forms the row sums and column 0 of triangle A129100, which is defined by the nice property that column 0 of matrix power A129100^(2^k) = column k of A129100 for k > 0. - Paul D. Hanna, Dec 03 2008
G.f. g(x) satisfies (1-x^2) g(x) = (1+x-x^2) g(x^2) + x. - Robert Israel, Mar 23 2017
Comments