cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A228628 9's complement of prime(n).

This page as a plain text file.
%I A228628 #26 Jul 06 2021 18:58:48
%S A228628 7,6,4,2,88,86,82,80,76,70,68,62,58,56,52,46,40,38,32,28,26,20,16,10,
%T A228628 2,898,896,892,890,886,872,868,862,860,850,848,842,836,832,826,820,
%U A228628 818,808,806,802,800,788,776,772,770,766,760,758,748,742,736,730,728
%N A228628 9's complement of prime(n).
%C A228628 a(n) = 10^k - 1 - prime(n) where k is the number of digits in prime(n). If d is d digit in prime(n) replace it with 9 - d.
%H A228628 Charles R Greathouse IV, <a href="/A228628/b228628.txt">Table of n, a(n) for n = 1..10000</a>
%F A228628 a(n) = A061601(A000040(n)). - _Charles R Greathouse IV_, Aug 29 2013
%F A228628 a(n) = A160668(n) - 1. _Alois P. Heinz_, Dec 08 2017
%e A228628 a(6) = 86 because prime(6) = 13 and 9 - 1 = 8, 9 - 6 = 3.
%p A228628 a:= n-> (p-> 10^length(p)-p-1)(ithprime(n)):
%p A228628 seq(a(n), n=1..100);  # _Alois P. Heinz_, Dec 08 2017
%t A228628 nineComplement[n_] := FromDigits[Table[9, {Length[IntegerDigits[Prime[n]]]}] - IntegerDigits[Prime[n]]]; Table[nineComplement[n], {n, 1, 71}]
%o A228628 (PARI) a(n)=my(p=prime(n));10^#Str(p)-p-1 \\ _Charles R Greathouse IV_, Aug 29 2013
%o A228628 (Python)
%o A228628 from sympy import primerange
%o A228628 def nc(n): return 10**len(str(n)) - 1 - n
%o A228628 def auptop(limit): return [nc(p) for p in primerange(1, limit+1)]
%o A228628 print(auptop(271)) # _Michael S. Branicky_, Jul 06 2021
%Y A228628 Cf. A000040, A061601, A160668.
%K A228628 nonn,base,easy
%O A228628 1,1
%A A228628 _Michel Lagneau_, Aug 28 2013