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.

A062337 Primes whose sum of digits is 7.

This page as a plain text file.
%I A062337 #42 Aug 11 2025 10:21:28
%S A062337 7,43,61,151,223,241,313,331,421,601,1033,1051,1123,1213,1231,1303,
%T A062337 1321,2113,2131,2203,2221,2311,3121,3301,4003,4021,4111,4201,5011,
%U A062337 5101,10141,10303,10321,10501,11113,11131,11311,12211,12301,13003,14011,20023,20113
%N A062337 Primes whose sum of digits is 7.
%C A062337 There are O((log n)^6) members of this sequence below n.
%H A062337 Charles R Greathouse IV, <a href="/A062337/b062337.txt">Table of n, a(n) for n = 1..10000</a>
%F A062337 Intersection of A000040 (primes) and A052221 (digit sum 7). - _M. F. Hasler_, Mar 09 2022
%e A062337 601 is a prime with sum of the digits = 7, hence belongs to the sequence.
%p A062337 A062337 := proc(n)
%p A062337     option remember ;
%p A062337     local p ;
%p A062337     if n = 1 then
%p A062337         7;
%p A062337     else
%p A062337         p := nextprime(procname(n-1)) ;
%p A062337         while true do
%p A062337             if digsum(p) = 7 then # digsum in oeis.org/transforms.txt
%p A062337                 return p;
%p A062337             else
%p A062337                 p := nextprime(p) ;
%p A062337             end if;
%p A062337         end do:
%p A062337     end if;
%p A062337 end proc:
%p A062337 seq(A062337(n),n=1..80) ; # _R. J. Mathar_, May 22 2025
%t A062337 Select[Prime[Range[3000]], Plus @@ IntegerDigits[ # ] == 7 &] (* _Zak Seidov_, Feb 17 2005 *)
%o A062337 (PARI) A062337(lim)={my(pow=ceil(log(floor(lim)-.5)/log(10)),n);print("Checking for members of A062337 up to 10^"pow);for(a=0,pow-1,for(b=0,a,for(c=0,b,for(d=0,c,for(e=0,d,for(f=0,e,n=10^a+10^b+10^c+10^d+10^e+10^f+1;if(isprime(n),print1(n","))))))))};
%o A062337 (PARI) select( {is_A062337(p, s=7)=sumdigits(p)==s&&isprime(p)}, primes([1, 14321])) \\ 2nd optional parameter for similar sequences with other digit sums. _M. F. Hasler_, Mar 09 2022
%o A062337 (PARI) {A062337_upto_length(L, s=7, a=List(), u=[10^(L-k)|k<-[1..L]])=forvec(d=[[1, L]|i<-[1..s]], isprime(p=vecsum(vecextract(u, d))) && listput(a, p), 1); Vecrev(a)} \\ _M. F. Hasler_, Mar 09 2022
%o A062337 (Magma) [p: p in PrimesUpTo(250000) | &+Intseq(p) eq 7]; // _Vincenzo Librandi_, Jul 08 2014
%Y A062337 Subsequence of A062336. See also A000579, A118703 (no digit 0)
%Y A062337 Cf. similar sequences listed in A244918.
%K A062337 nonn,base,easy
%O A062337 1,1
%A A062337 _Amarnath Murthy_, Jun 21 2001
%E A062337 More terms from Larry Reeves (larryr(AT)acm.org), Jul 06 2001
%E A062337 Comments and program from _Charles R Greathouse IV_, Sep 11 2009