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

A261338
Primes p such that digitsum(p) > digitsum(q) where q is the next prime after p.
1
7, 19, 29, 37, 47, 59, 67, 79, 89, 97, 109, 127, 149, 157, 167, 179, 199, 229, 239, 257, 269, 277, 293, 307, 317, 349, 359, 367, 379, 389, 397, 419, 439, 449, 457, 479, 487, 499, 509, 557, 569, 587, 599, 607, 619, 647, 659, 677, 683, 691, 719, 727, 739, 743, 757
OFFSET
1,1
COMMENTS
A000040(n) for n such that A007605(n) > A007605(n+1). - Robert Israel, Aug 17 2015
LINKS
EXAMPLE
19 is in the sequence because it is prime; [digitsum(19) = 1 + 9 = 10] > [digitsum(23) = 2 + 3 = 5] where 19 and 23 are consecutive primes.
47 is in the sequence because it is prime; [digitsum(47) = 4 + 7 = 11] > [digitsum(53) = 5 + 3 = 8] where 47 and 53 are consecutive primes.
MAPLE
with(numtheory): A261338:= proc() local k, k1, p; p:=ithprime(n); k:=(add(d, d=convert(p, base, 10))); k1:=(add(d, d=convert(nextprime(p), base, 10))); if k > k1 then RETURN (p); fi; end: seq(A261338 (), n=1..300);
MATHEMATICA
A261338 = {}; Do[p = Prime[n]; k = Plus @@ IntegerDigits[p]; k1 = Plus @@ IntegerDigits[NextPrime[p]]; If[k > k1, AppendTo[A261338, p]], {n, 1, 300}]; A261338 (* Bajpai *)
Prime[Select[Range[100], (Plus@@IntegerDigits[Prime[#]]) >
(Plus@@IntegerDigits[Prime[# + 1]]) &] (* Alonso del Arte, Aug 16 2015 *)
Prime[#]&/@SequencePosition[Table[Total[IntegerDigits[p]], {p, Prime[Range[ 150]]}], _?(#[[1]]>#[[2]]&)][[All, 1]]//Quiet (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Oct 10 2020 *)
PROG
(PARI) forprime(p = 1, 300, q=nextprime(p+1); if(sumdigits(p) > sumdigits(q), print1(p, ", ")));
(Magma) [NthPrime(n) : n in [1..200] | &+Intseq(NthPrime(n)) ge &+Intseq(NthPrime(n+1))];
CROSSREFS
Sequence in context: A175366 A117609 A122072 * A352338 A109355 A272404
KEYWORD
nonn,base
AUTHOR
K. D. Bajpai, Aug 15 2015
STATUS
approved