login
A154311
Numbers n such that sum of digits of n > sum of digits of prime(n).
1
5, 6, 9, 18, 26, 27, 28, 29, 36, 38, 47, 48, 49, 53, 54, 58, 64, 65, 66, 67, 68, 69, 79, 82, 83, 84, 86, 89, 96, 97, 98, 99, 126, 156, 169, 170, 172, 173, 174, 177, 178, 179, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 196, 197, 198, 199, 216, 252, 255, 257
OFFSET
1,1
LINKS
EXAMPLE
If prime(n=5)=11 and 5>1+1=2, then 5=a(1). If prime(n=9)=23 and 9>2+3=5, then 9=a(2). If prime(n=18)=61 and 1+8=9>6+1=7, then 18=a(3). If prime(n=26)=101 and 2+6=8>1+0+1=2, then 26=a(4), etc.
MAPLE
sd := proc (n) options operator, arrow: add(convert(n, base, 10)[j], j = 1 .. nops(convert(n, base, 10))) end proc: a := proc (n) if sd(ithprime(n)) < sd(n) then n else end if end proc: seq(a(n), n = 1 .. 300); # Emeric Deutsch, Jan 26 2009
MATHEMATICA
Select[Range[300], Total[IntegerDigits[#]]>Total[IntegerDigits[ Prime[#]]]&] (* Harvey P. Dale, Jun 18 2011 *)
PROG
(PARI) isok(n) = sumdigits(n) > sumdigits(prime(n)); \\ Michel Marcus, Sep 10 2016
CROSSREFS
KEYWORD
nonn,base
AUTHOR
EXTENSIONS
Missing terms added by Emeric Deutsch, Jan 26 2009
STATUS
approved