A062343 Primes whose sum of digits is 8.
17, 53, 71, 107, 233, 251, 431, 503, 521, 701, 1061, 1151, 1223, 1511, 1601, 2141, 2213, 2411, 3023, 3041, 3203, 3221, 4013, 4211, 5003, 5021, 6011, 6101, 7001, 10007, 10061, 10133, 10151, 10223, 10313, 10331, 10601, 11213, 11321, 11411
Offset: 1
Examples
1151 belongs to the sequence since it is a prime with sum of digits = 8.
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..42745 (first 500 terms from Vincenzo Librandi)
Crossrefs
Programs
-
Magma
[p: p in PrimesUpTo(20000) | &+Intseq(p) eq 8]; // Vincenzo Librandi, Jul 08 2014
-
Maple
A062343 := proc(n) option remember ; local p ; if n = 1 then 17; else p := nextprime(procname(n-1)) ; while true do if digsum(p) = 8 then # digsum in oeis.org/transforms.txt return p; else p := nextprime(p) ; end if; end do: end if; end proc: seq(A062343(n),n=1..80) ; # R. J. Mathar, May 22 2025
-
Mathematica
Select[Prime[Range[500000]], Total[IntegerDigits[#]]==8 &] (* Vincenzo Librandi, Jul 08 2014 *)
-
PARI
select( {is_A062343(p, s=8)=sumdigits(p)==s&&isprime(p)}, primes([1, 12345])) \\ 2nd optional parameter for similar sequences with other digit sums. M. F. Hasler, Mar 09 2022
-
PARI
{A062343_upto_length(L, s=8, 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
Formula
Extensions
More terms from Larry Reeves (larryr(AT)acm.org), Jul 06 2001
Comments