[go: up one dir, main page]

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”).

A337845
Primes with a digital sum that is less than the digital sum of the previous prime.
1
11, 23, 31, 41, 53, 61, 71, 83, 97, 101, 113, 131, 151, 163, 173, 181, 211, 233, 241, 263, 271, 281, 307, 311, 331, 353, 367, 373, 383, 397, 401, 421, 443, 457, 461, 487, 491, 503, 521, 563, 571, 593, 601, 613, 631, 653, 661, 683, 691, 701, 727, 733, 743, 751
OFFSET
1,1
LINKS
EXAMPLE
11 has digital sum 2 which is less than the digital sum of the previous prime (7).
MATHEMATICA
s[n_] := Plus @@ IntegerDigits[n]; p = Select[Range[1000], PrimeQ]; p[[1 + Position[Differences[s /@ p], _?(# < 0 &)] // Flatten]] (* Amiram Eldar, Sep 26 2020 *)
Prime[#]&/@(Flatten[Position[Partition[Table[Total[IntegerDigits[Prime[n]]], {n, 200}], 2, 1], _?(#[[2]]<#[[1]]&), 1, Heads->False]]+1) (* Harvey P. Dale, Aug 05 2022 *)
PROG
(PARI) isok(p) = isprime(p) && (sumdigits(p) < sumdigits(precprime(p-1))); \\ Michel Marcus, Sep 26 2020
CROSSREFS
Cf. A007605.
Sequence in context: A060399 A030665 A077501 * A030675 A110786 A059642
KEYWORD
nonn,base
AUTHOR
STATUS
approved