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.

A242924 Position of first occurrence of n in A242923.

This page as a plain text file.
%I A242924 #16 Nov 23 2020 14:21:28
%S A242924 1,2,4,8,12,66,24,34,233,251,284,173,104,299,329,431,596,625,528,1052,
%T A242924 759,349,667,1028,793,436,1242,1882,1410,1374,4974,1181,3626,3517,
%U A242924 3673,3148,4398,6160,5537,4254,5512,7039,4074,2194,10206,11361,4154,12710,7559
%N A242924 Position of first occurrence of n in A242923.
%C A242924 Not currently known to be finite for all n.
%H A242924 Alois P. Heinz, <a href="/A242924/b242924.txt">Table of n, a(n) for n = 1..200</a>
%p A242924 b:= proc(n) option remember; local i, t, ok;
%p A242924       if n<2 then n
%p A242924     else for t from 1 +b(n-1) do ok:=true;
%p A242924            for i to n/2 while ok
%p A242924              do ok:= b(n-2*i)+t <> 2*b(n-i) od;
%p A242924            if ok then return t fi
%p A242924          od
%p A242924       fi
%p A242924     end:
%p A242924 a:= proc() local t, a; t, a:= 0, proc() 0 end;
%p A242924       proc(n) local h;
%p A242924         while a(n) = 0 do
%p A242924           t:= t+1; h:= b(t) -b(t-1);
%p A242924           if a(h) = 0 then a(h):= t fi
%p A242924         od; a(n)
%p A242924       end
%p A242924     end():
%p A242924 seq(a(n), n=1..30);  # _Alois P. Heinz_, May 26 2014
%t A242924 nmaxb = 2000; (* max index of b(n) *)
%t A242924 nmaxa = 30; (* max index of a(n) *)
%t A242924 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]]]]];
%t A242924 B = Array[b, nmaxb] // Differences;
%t A242924 a[n_] := a[n] = Module[{p = FirstPosition[B, n]}, Which[n == 1, 1, p === Missing["NotFound"], -1, True, p[[1]] + 1]];
%t A242924 Array[a, nmaxa] (* _Jean-François Alcover_, Nov 23 2020, after _Alois P. Heinz_ for b(n) *)
%Y A242924 Cf. A242921, A242923.
%K A242924 nonn
%O A242924 1,2
%A A242924 _Jeffrey Shallit_, May 26 2014