login
Lesser of twin primes P(k) and P(k+1) such that Sd(P(k)) + Sd(P(k+1)) = Sd(k) + Sd(k+1), where Sd(x) is the sum of digits of x.
1

%I #5 Sep 30 2016 13:04:08

%S 1619,2309,2339,12239,28109,35081,37307,37571,50549,51059,51719,62129,

%T 64919,65729,87539,89519,91079,113759,121439,121631,160649,170351,

%U 174329,182129,191249,205949,215459,223679,231839,254039,270269,285119,301841,317489,319829

%N Lesser of twin primes P(k) and P(k+1) such that Sd(P(k)) + Sd(P(k+1)) = Sd(k) + Sd(k+1), where Sd(x) is the sum of digits of x.

%H Paolo P. Lava, <a href="/A277111/a277111.txt">First 60 couples [k, P(k)]</a>

%e P(256) = 1619, P(257) = 1621; Sd(256) + Sd(257) = 13 + 14 = 27 and Sd(1619) + Sd(1621) = 17 + 10 = 27.

%p T:=proc(w) local x, y, z; x:=w; y:=0; for z from 1 to ilog10(x)+1 do y:=y+(x mod 10); x:=trunc(x/10); od; y; end:

%p P:= proc(q) local a,b,k,n;

%p for n from 1 to q do if ithprime(n+1)-ithprime(n)=2 then if T(ithprime(n))+T(ithprime(n+1))=T(n)+T(n+1) then print(ithprime(n)); fi; fi; od; end: P(10^5);

%Y Cf. A001359, A033548.

%K nonn,base,easy

%O 1,1

%A _Paolo P. Lava_, Sep 30 2016