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.

This page as a plain text file.
%I A379743 #11 Jan 04 2025 22:29:33
%S A379743 3,5,7,13,11,13,29,17,19,31,23,37,53,29,31,97,103,37,191,41,43,67,47,
%T A379743 73,101,53,109,113,59,61,311,97,67,103,71,73,149,191,79,241,83,127,
%U A379743 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
%N A379743 a(n) is the smallest prime whose digital sum in base n is n.
%C A379743 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?
%H A379743 Robert Israel, <a href="/A379743/b379743.txt">Table of n, a(n) for n = 2..10000</a>
%e A379743 a(5) = 13 because the prime 13 = 23_5 with 2 + 3 = 5, and no smaller prime works.
%p A379743 f:= proc(n) local k,v,x;
%p A379743   for k from 1 do
%p A379743     v:= convert(convert(k,base,n),`+`);
%p A379743     if v > n then next fi;
%p A379743     x:= n*k+(n-v);
%p A379743     if isprime(x) then return x fi
%p A379743  od
%p A379743 end proc:
%p A379743 map(f, [$2..100]);
%t A379743 a[n_]:=Module[{k=1}, While[DigitSum[Prime[k],n]!=n, k++]; Prime[k]]; Array[a,67,2] (* _Stefano Spezia_, Jan 04 2025 *)
%Y A379743 Cf. A214123.
%K A379743 nonn,base,look
%O A379743 2,1
%A A379743 _Robert Israel_, Dec 31 2024