login
A242924
Position of first occurrence of n in A242923.
1
1, 2, 4, 8, 12, 66, 24, 34, 233, 251, 284, 173, 104, 299, 329, 431, 596, 625, 528, 1052, 759, 349, 667, 1028, 793, 436, 1242, 1882, 1410, 1374, 4974, 1181, 3626, 3517, 3673, 3148, 4398, 6160, 5537, 4254, 5512, 7039, 4074, 2194, 10206, 11361, 4154, 12710, 7559
OFFSET
1,2
COMMENTS
Not currently known to be finite for all n.
LINKS
MAPLE
b:= proc(n) option remember; local i, t, ok;
if n<2 then n
else for t from 1 +b(n-1) do ok:=true;
for i to n/2 while ok
do ok:= b(n-2*i)+t <> 2*b(n-i) od;
if ok then return t fi
od
fi
end:
a:= proc() local t, a; t, a:= 0, proc() 0 end;
proc(n) local h;
while a(n) = 0 do
t:= t+1; h:= b(t) -b(t-1);
if a(h) = 0 then a(h):= t fi
od; a(n)
end
end():
seq(a(n), n=1..30); # Alois P. Heinz, May 26 2014
MATHEMATICA
nmaxb = 2000; (* max index of b(n) *)
nmaxa = 30; (* max index of a(n) *)
b[n_] := b[n] = Module[{i, t, ok}, If[n < 2, n, For[t = 1 + b[n - 1], True, t++, ok = True; For[i = 1, i <= n/2 && ok, i++, ok = b[n - 2 i] + t != 2 b[n - i]]; If[ok, Return[t]]]]];
B = Array[b, nmaxb] // Differences;
a[n_] := a[n] = Module[{p = FirstPosition[B, n]}, Which[n == 1, 1, p === Missing["NotFound"], -1, True, p[[1]] + 1]];
Array[a, nmaxa] (* Jean-François Alcover, Nov 23 2020, after Alois P. Heinz for b(n) *)
CROSSREFS
Sequence in context: A215825 A177268 A289085 * A133802 A076202 A268713
KEYWORD
nonn
AUTHOR
Jeffrey Shallit, May 26 2014
STATUS
approved