A228628 9's complement of prime(n).
7, 6, 4, 2, 88, 86, 82, 80, 76, 70, 68, 62, 58, 56, 52, 46, 40, 38, 32, 28, 26, 20, 16, 10, 2, 898, 896, 892, 890, 886, 872, 868, 862, 860, 850, 848, 842, 836, 832, 826, 820, 818, 808, 806, 802, 800, 788, 776, 772, 770, 766, 760, 758, 748, 742, 736, 730, 728
Offset: 1
Examples
a(6) = 86 because prime(6) = 13 and 9 - 1 = 8, 9 - 6 = 3.
Links
- Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
Programs
-
Maple
a:= n-> (p-> 10^length(p)-p-1)(ithprime(n)): seq(a(n), n=1..100); # Alois P. Heinz, Dec 08 2017
-
Mathematica
nineComplement[n_] := FromDigits[Table[9, {Length[IntegerDigits[Prime[n]]]}] - IntegerDigits[Prime[n]]]; Table[nineComplement[n], {n, 1, 71}]
-
PARI
a(n)=my(p=prime(n));10^#Str(p)-p-1 \\ Charles R Greathouse IV, Aug 29 2013
-
Python
from sympy import primerange def nc(n): return 10**len(str(n)) - 1 - n def auptop(limit): return [nc(p) for p in primerange(1, limit+1)] print(auptop(271)) # Michael S. Branicky, Jul 06 2021
Formula
a(n) = A160668(n) - 1. Alois P. Heinz, Dec 08 2017
Comments