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.

A379743 a(n) is the smallest prime whose digital sum in base n is n.

Original entry on oeis.org

3, 5, 7, 13, 11, 13, 29, 17, 19, 31, 23, 37, 53, 29, 31, 97, 103, 37, 191, 41, 43, 67, 47, 73, 101, 53, 109, 113, 59, 61, 311, 97, 67, 103, 71, 73, 149, 191, 79, 241, 83, 127, 173, 89, 181, 139, 283, 97, 197, 101, 103, 157, 107, 109, 331, 113, 229, 233, 709, 181, 367, 311, 127, 193, 131, 199, 269
Offset: 2

Views

Author

Robert Israel, Dec 31 2024

Keywords

Comments

For n <= 10^5, a(n) < n^2, thus a(n) = k*n + (n-k) for some k, 1 <= k < n. Is this true for all n?

Examples

			a(5) = 13 because the prime 13 = 23_5 with 2 + 3 = 5, and no smaller prime works.
		

Crossrefs

Cf. A214123.

Programs

  • Maple
    f:= proc(n) local k,v,x;
      for k from 1 do
        v:= convert(convert(k,base,n),`+`);
        if v > n then next fi;
        x:= n*k+(n-v);
        if isprime(x) then return x fi
     od
    end proc:
    map(f, [$2..100]);
  • Mathematica
    a[n_]:=Module[{k=1}, While[DigitSum[Prime[k],n]!=n, k++]; Prime[k]]; Array[a,67,2] (* Stefano Spezia, Jan 04 2025 *)