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.

A358055 a(n) is the least m such that A358052(m,k) = n for some k.

This page as a plain text file.
%I A358055 #13 Mar 12 2024 13:37:09
%S A358055 1,2,5,8,14,20,32,38,59,59,63,116,122,158,158,218,278,278,402,548,642,
%T A358055 642,642,642,642,1062,1062,1668,2474,2690,2690,2690,2690,2690,3170,
%U A358055 3170,3170,3170,3170,3170,3170,9260,9260,9260,9788,9788,11772,11942,11942,11942,11942,11942
%N A358055 a(n) is the least m such that A358052(m,k) = n for some k.
%C A358055 a(n) is the least m such that iteration of the map x -> floor(m/x) + (m mod x), starting at some k in [1,m], produces n distinct values before repeating.
%e A358055 a(4) = 8 because A358052(8,6) = 4 and this is the first appearance of 4 in A358052.
%e A358055 Thus the map x -> floor(8/x) + (8 mod x) starting at 6 produces 4 distinct values before repeating: 6 -> 3 -> 4 -> 2 -> 4.
%p A358055 f:= proc(n, k) local x, S, count;
%p A358055   S:= {k};
%p A358055   x:= k;
%p A358055   for count from 1 do
%p A358055      x:= iquo(n, x) + irem(n, x);
%p A358055      if member(x, S) then return count fi;
%p A358055      S:= S union {x};
%p A358055   od
%p A358055 end proc:
%p A358055 V:= Vector(50): count:= 0:
%p A358055 for n from 1 while count < 50 do
%p A358055   for k from 1 to n do
%p A358055     v:= f(n,k);
%p A358055     if v <= 50 and V[v] = 0 then
%p A358055        V[v]:= n; count:= count+1;
%p A358055     fi
%p A358055 od od:
%p A358055 convert(V,list);
%t A358055 f[n_, k_] := Module[{x, S, count}, S = {k}; x = k; For[count = 1, True, count++, x = Quotient[n, x] + Mod[n, x]; If[MemberQ[S, x], Return@count]; S = S~Union~{x}]];
%t A358055 V = Table[0, {vmax = 40}]; count = 0;
%t A358055 For[n = 1, count < vmax, n++, For[k = 1, k <= n, k++, v = f[n, k]; If[v <= vmax && V[[v]] == 0, Print[n]; V[[v]] = n; count++]]];
%t A358055 V (* _Jean-François Alcover_, Mar 12 2024, after Maple code *)
%Y A358055 Cf. A234575, A358052.
%K A358055 nonn
%O A358055 1,2
%A A358055 _J. M. Bergot_ and _Robert Israel_, Oct 27 2022