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.

A356874 Write n as Sum_{i in S} 2^(i-1), where S is a set of positive integers, then a(n) = Sum_{i in S} F_i, where F_i is the i-th Fibonacci number, A000045(i).

This page as a plain text file.
%I A356874 #20 Aug 08 2023 12:10:24
%S A356874 0,1,1,2,2,3,3,4,3,4,4,5,5,6,6,7,5,6,6,7,7,8,8,9,8,9,9,10,10,11,11,12,
%T A356874 8,9,9,10,10,11,11,12,11,12,12,13,13,14,14,15,13,14,14,15,15,16,16,17,
%U A356874 16,17,17,18,18,19,19,20,13,14,14,15,15,16,16,17,16,17,17,18,18,19,19,20
%N A356874 Write n as Sum_{i in S} 2^(i-1), where S is a set of positive integers, then a(n) = Sum_{i in S} F_i, where F_i is the i-th Fibonacci number, A000045(i).
%C A356874 This sequence looks on the Fibonacci sequence terms (from F_1 onwards) as an ordered set, considering F_1 and F_2 as distinct members mapped to the same integer value, namely 1. We run through all finite subsets, adding up the integer values from each subset (see table in the examples). In consequence, a number, k, occurs exactly A000121(k) times.
%C A356874 The definition is effectively an amendment of the definition of A022290 so that a(n) is a sum of Fibonacci terms starting with F_1 rather than F_2. If we took this a further step so that a(n) was a sum of Fibonacci terms starting with F_0, we would get this sequence with each term duplicated, that is 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, ... .
%C A356874 Doubling n increments the indices of the Fibonacci terms that sum to a(n), so a(2n) is in this sense a Fibonacci successor to a(n). When n is even, this sense matches the meaning of successor as used in A022342; however, for odd n, the generated successor of a(n) is A000201(a(n)) -- note, in this respect, that A000201 is a column in the extended Wythoff array (A287870).
%H A356874 Amiram Eldar, <a href="/A356874/b356874.txt">Table of n, a(n) for n = 0..10000</a>
%F A356874 a(2n) = a(n) + a(floor(n/2)); a(2n+1) = a(2n) + 1.
%F A356874 a(2^k) = A000045(k+1).
%F A356874 For k >= 1, 2^k < n < 2^(k+1), a(n) = a(n - 2^k) + a(2^k).
%F A356874 a(2n) = A022290(n).
%F A356874 a(4n) = A022342(a(2n)+1).
%F A356874 a(4n+2) = A000201(a(2n+1)).
%e A356874 n = 13: 13 = 8 + 4 + 1 = 2^(4-1) + 2^(3-1) + 2^(1-1); so a(n) = F_4 + F_3 + F_1 = 3 + 2 + 1 = 6.
%e A356874 Table showing initial terms with Fibonacci subsets:
%e A356874   n   Fibonacci subset                           a(n)
%e A356874   0  { }     (empty set)     ->  0              =  0
%e A356874   1  { F_1 }                 ->  1              =  1
%e A356874   2  {      F_2 }            ->  0 + 1          =  1
%e A356874   3  { F_1, F_2 }            ->  1 + 1          =  2
%e A356874   4  {           F_3 }       ->  0 + 0 + 2      =  2
%e A356874   5  { F_1,      F_3 }       ->  1 + 0 + 2      =  3
%e A356874   6  {      F_2, F_3 }       ->  0 + 1 + 2      =  3
%e A356874   7  { F_1, F_2, F_3 }       ->  1 + 1 + 2      =  4
%e A356874   8  {                F_4 }  ->  0 + 0 + 0 + 3  =  3
%e A356874   9  { F_1,           F_4 }  ->  1 + 0 + 0 + 3  =  4
%t A356874 a[n_] := Module[{d = IntegerDigits[n, 2], nd}, nd = Length[d]; Total[d * Fibonacci[Range[nd, 1, -1]]]]; Array[a, 100, 0] (* _Amiram Eldar_, Aug 08 2023 *)
%o A356874 (PARI) a(n) = if(n==0,0,if(n%2==1,a(n-1)+1,a(n/2)+a(n\4))); \\ _Peter Munn_, Sep 06 2022
%Y A356874 Cf. A000045, A000121, A000201, A022342, A287870.
%Y A356874 Even bisection: A022290.
%K A356874 nonn,base,easy
%O A356874 0,4
%A A356874 _Peter Munn_, Sep 02 2022