A084686 Take n-th prime p(n), rewrite it with digits in decreasing order to get b(n), then a(n)=(b(n)-p(n))/9.
0, 0, 0, 0, 0, 2, 6, 8, 1, 7, 0, 4, 0, 0, 3, 0, 4, 0, 1, 0, 0, 2, 0, 1, 0, 1, 23, 67, 89, 22, 66, 20, 66, 88, 88, 40, 66, 52, 66, 62, 88, 70, 80, 82, 86, 88, 0, 11, 55, 77, 11, 77, 20, 30, 55, 41, 77, 50, 55, 60, 61, 71, 47, 0, 2, 46, 0, 44, 44, 66, 20, 66, 44, 40, 66, 50, 66, 64, 1, 59, 58
Offset: 1
Examples
a(7)=6 because p(7)=17, b(n)=71 and (71-17)/9=6.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
f:= proc(n) local p,L,i; p:= ithprime(n); L:= sort(convert(p,base,10)); (add(10^(i-1)*L[i],i=1..nops(L))-p)/9 end proc: map(f, [$1..100]); # Robert Israel, Nov 26 2019
-
Mathematica
Table[ -Prime[n]-FromDigits[Sort[ -IntegerDigits[Prime[n]]]], {n, 1, 100}]