OFFSET
1,1
COMMENTS
There are O((log n)^6) members of this sequence below n.
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
601 is a prime with sum of the digits = 7, hence belongs to the sequence.
MATHEMATICA
Select[Prime[Range[3000]], Plus @@ IntegerDigits[ # ] == 7 &] (Zak Seidov, Feb 17 2005)
PROG
(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", "))))))))};
(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
(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
(Magma) [p: p in PrimesUpTo(250000) | &+Intseq(p) eq 7]; // Vincenzo Librandi, Jul 08 2014
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Amarnath Murthy, Jun 21 2001
EXTENSIONS
More terms from Larry Reeves (larryr(AT)acm.org), Jul 06 2001
Comments and program from Charles R Greathouse IV, Sep 11 2009
STATUS
approved