login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A093805
Numbers n with property that sum of digits is prime and number of prime digits is prime.
2
23, 25, 32, 52, 122, 133, 137, 155, 157, 173, 175, 203, 205, 212, 221, 223, 227, 229, 230, 232, 236, 238, 245, 247, 250, 254, 256, 263, 265, 272, 274, 278, 283, 287, 292, 302, 313, 317, 320, 322, 326, 328, 331, 335, 337, 353, 355, 359, 362, 371, 373, 377
OFFSET
1,1
LINKS
EXAMPLE
a(1)=23, sum of digits 5 is prime, number of prime digits {2,3} 2 is prime,
a(5)=122, sum of digits 5 is prime, number of prime digits {2,2} 2 is prime,
a(10)=173, sum of digits 11 is prime, number of prime digits {3,7} is prime, ...
MAPLE
# Return list of digits stev_sez:=proc(n) local i, tren, st, ans, anstren; ans:=[ ]: anstren:=[ ]: tren:=n: for i while (tren>0) do st:=round( 10*frac(tren/10) ): ans:=[ op(ans), st ]: tren:=trunc(tren/10): end do; for i from nops(ans) to 1 by -1 do anstren:=[ op(anstren), op(i, ans) ]; od; RETURN(anstren); end: # Return number of prime digits ts_stpf:=proc(n) local i, stpf, ans, ans1; ans:=stev_sez(n): ans1:=[ ]: stpf:=0: for i from 1 to nops(ans) do if (isprime(op(i, ans))='true') then stpf:=stpf+1; # stevilo prastevilskih stevk ans1:=[ op(ans1), op(i, ans) ]: # prastevilske stevke fi od; RETURN(stpf) end: # Return sum of digits ts_vsota_stevk:=proc(n) local i, stpf, ans, ans1; ans:=stev_sez(n): ans1:=[ ]: stpf:=0: for i from 1 to nops(ans) do stpf:=stpf+op(i, ans); od; RETURN(stpf) end: ts_pras_vsota_pra_stevk:=proc(n) local i, ans; ans:=[ ]: for i from 1 to n do if ( isprime(ts_vsota_stevk(i)) = 'true' and isprime(ts_stpf(i))='true') then ans:=[ op(ans), i ]: fi od; RETURN(ans) end: ts_pras_vsota_pra_stevk(2000);
MATHEMATICA
sdpQ[n_]:=Module[{idn=IntegerDigits[n]}, And@@PrimeQ[{Total[idn], Count[ idn, _?PrimeQ]}]]; Select[Range[400], sdpQ] (* Harvey P. Dale, Oct 20 2013 *)
CROSSREFS
Sequence in context: A054865 A054795 A305469 * A033629 A090311 A172015
KEYWORD
nonn,base
AUTHOR
Jani Melik, May 19 2004
STATUS
approved