login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A104212 Sum of the digits of n when the sum is prime. 1
2, 3, 5, 7, 2, 3, 5, 7, 2, 3, 5, 7, 11, 3, 5, 7, 11, 5, 7, 11, 13, 5, 7, 11, 13, 7, 11, 13, 7, 11, 13, 11, 13, 17, 11, 13, 17, 2, 3, 5, 7, 2, 3, 5, 7, 11, 3, 5, 7, 11, 5, 7, 11, 13, 5, 7, 11, 13, 7, 11, 13, 7, 11, 13, 11, 13, 17, 11, 13, 17, 11, 13, 17, 19, 2, 3, 5, 7, 11, 3, 5, 7, 11, 5, 7, 11 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
MAPLE
sd:= n -> convert(convert(n, base, 10), `+`):
select(isprime, map(sd, [$1..400])); # Robert Israel, Jan 20 2019
MATHEMATICA
Select[Array[Total@ IntegerDigits@ # &, 300], PrimeQ] (* Michael De Vlieger, Jan 20 2019 *)
PROG
(PARI) sdprime(n) = { local(x, y); for(x=1, n, y=sumdigits(x); if(isprime(y), print1(y", ") ) ) } sumdigits(n) = \ The sum of the digits of n { local(x, j, s=0); x=digits(n); for(j=1, length(x), s+=x[j]; ); return(s) } digits(n) = \ The vector of the digits of n { return(eval(Vec(Str(n)))) }
CROSSREFS
Sequence in context: A230199 A275542 A187559 * A139751 A076779 A337008
KEYWORD
easy,nonn,base,look
AUTHOR
Cino Hilliard, Mar 13 2005
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 05:19 EDT 2024. Contains 371782 sequences. (Running on oeis4.)