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.

A067523 The smallest prime with a possible given digit sum.

This page as a plain text file.
%I A067523 #24 Jan 18 2024 11:36:55
%S A067523 2,3,13,5,7,17,19,29,67,59,79,89,199,389,499,599,997,1889,1999,2999,
%T A067523 4999,6899,17989,8999,29989,39989,49999,59999,79999,98999,199999,
%U A067523 389999,598999,599999,799999,989999,2998999,2999999,4999999,6999899,8989999
%N A067523 The smallest prime with a possible given digit sum.
%C A067523 Except for 3 no other prime has a digit sum which is a multiple of 3. Hence the possible digit sums are 2,3,4,5,7,8,10,11,13,14,16,..., etc. Conjecture: For every possible digit sum there exists a prime.
%C A067523 For n > 2, this is (conjecturally) the smallest prime with digit sum A001651(n). - _Lekraj Beedassy_, Mar 04 2009
%H A067523 Robert Israel, <a href="/A067523/b067523.txt">Table of n, a(n) for n = 1..667</a>
%F A067523 a(n) = min(prime(i): A007605(i) = A133223(i)). - _R. J. Mathar_, Nov 06 2018
%p A067523 g:= proc(s, d) # integers of <=d digits with sum s
%p A067523   local j;
%p A067523   if s > 9*d then return [] fi;
%p A067523   if d = 1 then return [s] fi;
%p A067523   [seq(op(map(t -> j*10^(d-1)+ t, procname(s-j, d-1))), j=0..9)];
%p A067523 end proc:
%p A067523 f:= proc(n) local d, j, x, y;
%p A067523   if n mod 3 = 0 then return 0 fi;
%p A067523   for d from ceil(n/9) do
%p A067523     if d = 1 then
%p A067523       if isprime(n) and n < 10 then return n
%p A067523       else next
%p A067523     fi fi;
%p A067523     for j from 1 to 9 do
%p A067523        for y in g(n-j, d-1) do
%p A067523          x:= 10^(d-1)*j + y;
%p A067523          if isprime(x) then return x fi;
%p A067523   od od od;
%p A067523 end proc:
%p A067523 f(3):= 3:
%p A067523 map(f, [2,3,seq(seq(3*i+j,j=1..2),i=1..30)]); # _Robert Israel_, Jan 18 2024
%o A067523 (PARI) A067523(n)=if(n<3,n+1,A067180(n*3\/2-1)) \\ _M. F. Hasler_, Nov 04 2018
%Y A067523 Cf. A001651. Equals A067180 with the 0 terms removed.
%K A067523 base,easy,nonn
%O A067523 1,1
%A A067523 _Amarnath Murthy_, Feb 14 2002
%E A067523 More terms from _Vladeta Jovovic_, Feb 18 2002
%E A067523 Edited by _Ray Chandler_, Apr 24 2007