login
a(n) is the index of the first occurrence of n in A316774.
9

%I #26 Aug 28 2023 08:25:27

%S 0,1,2,5,4,8,11,22,14,32,28,42,48,45,68,71,77,89,108,115,92,140,95,

%T 149,216,268,194,260,310,254,263,340,362,257,295,277,298,476,346,431,

%U 365,560,539,424,486,462,576,479,579,692,657,707,754,794,757,797,928

%N a(n) is the index of the first occurrence of n in A316774.

%H Alois P. Heinz, <a href="/A316905/b316905.txt">Table of n, a(n) for n = 0..20000</a>

%F a(n) = min { j >= 0 : A316774(j) = n }.

%e a(4) = 4 because A316774(j) = 4 for j in {4,7,12,13,36,49,55} with minimal element 4.

%p b:= proc() 0 end:

%p g:= proc(n) option remember; local t;

%p t:= `if`(n<2, n, b(g(n-1))+b(g(n-2)));

%p b(t):= b(t)+1; t

%p end:

%p a:= proc() local t, a; t, a:= -1, proc() -1 end;

%p proc(n) local h;

%p while a(n) = -1 do

%p t:= t+1; h:= g(t);

%p if a(h) = -1 then a(h):= t fi

%p od; a(n)

%p end

%p end():

%p seq(a(n), n=0..100);

%t b[_] = 0;

%t g[n_] := g[n] = Module[{t}, t = If[n < 2, n, b[g[n - 1]] + b[g[n - 2]]]; b[t] = b[t] + 1; t];

%t a[n_] := Module[{t = -1, a}, a[_] = -1; Module[{h}, While[a[n] == -1, t = t + 1; h = g[t]; If[a[h] == -1, a[h] = t]]; a[n]]];

%t Table[a[n], {n, 0, 100}] (* _Jean-François Alcover_, Aug 28 2023, after _Alois P. Heinz_ *)

%Y Cf. A316774, A316973, A316984, A330440 (a sorted version of this), A330447, A330448.

%K nonn,look

%O 0,3

%A _Alois P. Heinz_, Jul 18 2018