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.
%I A381897 #14 Mar 22 2025 18:50:42 %S A381897 3,2,3,2,2,3,3,2,2,4,2,4,2,4,2,2,3,3,2,2,2,2,5,2,2,2,3,3,2,2,2,2,2,3, %T A381897 2,3,3,3,3,2,3,2,2,2,2,4,3,3,3,2,3,2,4,3,3,2,3,2,2,2,3,2,4,2,3,3,3,2, %U A381897 4,2,2,2,2,3,3,2,2,2,2,3,3,2,2,4,2,4 %N A381897 a(n) = least integer m >= 2 such that prime(n) is a sum of the form Sum_{k>=0} floor(h/m^k) for some integer h >= 1. %F A381897 a(n) = A382278(prime(n)). - _Pontus von Brömssen_, Mar 22 2025 %e A381897 a(10) = 4 because 4 is the least m such that prime(10) is a sum of the form Sum_{k>=0} [h/m^k] for some h >= 1; that sum is 29 = [23/1] + [23/4] + [23/16], where [ ] = floor. %t A381897 f[h_, m_] := Sum[Floor[h/m^k], {k, 0, Floor[Log[m, h]]}] %t A381897 {rng, n} = {1000, 6}; %t A381897 Table[u[m] = Select[Range[rng], PrimeQ[f[#, m]] &], {m, 2, n}]; %t A381897 tmp = SortBy[Map[#[[1]] &, GatherBy[Flatten[Table[ %t A381897 Transpose[{ConstantArray[m, Length[u[m]]], %t A381897 Map[PrimePi[f[#, m]] &, u[m]]}], {m, 2, n}],1], #[[2]] &]], #[[2]] &]; %t A381897 tmp = Map[#[[1]] &, Take[tmp, Position[Differences[Map[#[[2]] &, tmp]], x_ /; x != 1, 1, 1][[1]][[1]]]] %t A381897 (* _Peter J. C. Moses_, Feb 19 2025 *) %Y A381897 Cf. A000040, A381239, A382278. %K A381897 nonn %O A381897 1,1 %A A381897 _Clark Kimberling_, Mar 09 2025