login
Larger of two consecutive Sophie Germain primes with the same digital sum.
1

%I #13 Feb 20 2023 16:52:24

%S 131,509,719,761,2693,3593,3821,4019,4073,4391,4409,4481,4733,5171,

%T 6131,6263,6581,6761,7121,7541,7841,9473,9629,10163,10253,10271,10331,

%U 10709,11831,12653,12671,13229,13553,14081,14153,14249,14321,15773,15791,16253,17291

%N Larger of two consecutive Sophie Germain primes with the same digital sum.

%H Harvey P. Dale, <a href="/A118507/b118507.txt">Table of n, a(n) for n = 1..1000</a>

%e 113 and 131 are consecutive Sophie Germain primes that have the same digital sum, hence 131 is in the sequence. - _Michel Marcus_, Dec 01 2013

%t Select[Partition[{#,Total[IntegerDigits[#]]}&/@Select[Prime[Range[2000]],PrimeQ[ 2#+1]&],2,1], #[[1,2]] == #[[2,2]]&][[;;,2,1]] (* _Harvey P. Dale_, Feb 20 2023 *)

%o (PARI) lista(nn) = {lastsd = 0; forprime(p=2, nn, if (isprime(2*p+1), digs = digits(p); sd = sum(i=1, #digs, digs[i]); if (sd == lastsd, print1(p, ", ")); lastsd = sd;););} \\ _Michel Marcus_, Dec 01 2013

%Y Cf. A005384.

%K base,nonn

%O 1,1

%A Luc Stevens (lms022(AT)yahoo.com), May 06 2006

%E Missing term 6761 and more terms added by _Michel Marcus_, Dec 01 2013