login
a(n) = the number k such that A030067(2k-1) = n, or 0 if n does not occur in the semi-Fibonacci sequence A030067.
2

%I #18 Mar 27 2018 08:45:10

%S 0,1,2,3,0,4,5,0,0,6,0,7,0,0,0,0,8,9,0,0,0,0,0,10,0,0,11,0,0,0,0,0,0,

%T 0,0,12,0,13,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,15,0,0,0,0,0,0,0,0,0,0,0,

%U 0,0,0,0,16,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18

%N a(n) = the number k such that A030067(2k-1) = n, or 0 if n does not occur in the semi-Fibonacci sequence A030067.

%C Otherwise said, a(n) = round(m/2) = (m+1)/2, where m is the smallest index such that A030067(m) = n.

%C Any integer n which occurs in A030067 first occurs as an odd-indexed term A030067(2k-1) = A030068(k-1), and thereafter at indices (2k-1)*2^j, j=1,2,3,... (Both of these statements follow immediately from the definition of even-indexed terms of A030067.)

%C It is easy to see that no n can occur a second time as an odd-indexed term in A030067. This follows from the definition of these terms A030067(2k+1) = A030067(2k-1) + A030067(k), which shows that the subsequence of odd-indexed terms (A030068) is strictly increasing, and therefore equal to the range (or: set) of all semi-Fibonacci numbers.

%C Setting all nonzero terms to 1, this sequence is the characteristic function of A030068 (up to the offset).

%t a[n_] := a[n] = Which[n == 1, 1, EvenQ@ n, a[n/2], True, a[n - 1] + a[n - 2]]; With[{nn = 87}, Function[s, Function[t, {0}~Join~ReplacePart[t, Map[# -> First@ Lookup[s, #] &, TakeWhile[Keys@ s, # <= nn &]]]]@ ConstantArray[0, nn]]@ PositionIndex@ Array[a[2 # - 1] &, 10^3]] (* _Michael De Vlieger_, Mar 25 2017, Version 10, after _Jean-François Alcover_ at A030067 *)

%o (PARI) A284282(n)=setsearch(A030068_vec,n) \\ Use, e.g., A030068(100) to compute the global variable A030068_vec far enough for n <= 22880. - _M. F. Hasler_, Mar 25 2017

%Y Cf. A030067 (semi-Fibonacci sequence), A030068 (bisection of odd-indexed terms, also equal to the range = set of all possible values or semi-Fibonacci numbers).

%K nonn

%O 0,3

%A _M. F. Hasler_, Mar 24 2017