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.

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.

Original entry on oeis.org

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, 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, 4, 2, 2, 2, 2, 3, 3, 2, 2, 2, 2, 3, 3, 2, 2, 4, 2, 4
Offset: 1

Views

Author

Clark Kimberling, Mar 09 2025

Keywords

Examples

			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.
		

Crossrefs

Programs

  • Mathematica
    f[h_, m_] := Sum[Floor[h/m^k], {k, 0, Floor[Log[m, h]]}]
    {rng, n} = {1000, 6};
    Table[u[m] = Select[Range[rng], PrimeQ[f[#, m]] &], {m, 2, n}];
    tmp = SortBy[Map[#[[1]] &, GatherBy[Flatten[Table[
           Transpose[{ConstantArray[m, Length[u[m]]],
             Map[PrimePi[f[#, m]] &, u[m]]}], {m, 2, n}],1], #[[2]] &]], #[[2]] &];
    tmp = Map[#[[1]] &, Take[tmp, Position[Differences[Map[#[[2]] &, tmp]], x_ /; x != 1, 1, 1][[1]][[1]]]]
    (* Peter J. C. Moses, Feb 19 2025 *)

Formula

a(n) = A382278(prime(n)). - Pontus von Brömssen, Mar 22 2025