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

For each pair of twin primes (p,p+2) take the absolute value of the difference between p and p with digits reversed.
0

%I #5 Oct 01 2013 17:57:44

%S 0,0,0,54,63,27,36,54,0,594,594,792,792,0,594,495,693,693,99,198,396,

%T 495,297,297,396,396,396,99,495,297,99,693,99,99,693,8082,270,8352,

%U 540,810,360,7992,6444,8532,270,7812,5814,90,360,6354,5454,7542,5994

%N For each pair of twin primes (p,p+2) take the absolute value of the difference between p and p with digits reversed.

%C 9 divides each term.

%e (17, 19) is a pair of twin primes. The absolute value of 17 - 71 is in the sequence.

%t a={}; For[n=1, n<268,n++, If[Prime[n+1]-Prime[n]==2, AppendTo[a,Abs[Prime[n] -FromDigits[Reverse[IntegerDigits[Prime[n]]]]]]]]; a

%o (PARI) revdiff(n) = { forprime(x=1,n, if(isprime(x+2), a=vector(x); x1=x; z=0; ln=length(Str(x1)); for(y=1,ln, a[y] = x1%10; x1=floor(x1/10); ); for(y=1,ln, z += a[y]*10^(ln-y); ); print1(abs(z-x)" "); ) ) }

%K base,nonn,less

%O 1,4

%A _Cino Hilliard_, Nov 09 2003

%E Edited by _Stefan Steinerberger_, Jun 12 2007