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

Original entry on oeis.org

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

Views

Author

Michel Lagneau, Aug 28 2013

Keywords

Comments

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.

Examples

			a(6) = 86 because prime(6) = 13 and 9 - 1 = 8, 9 - 6 = 3.
		

Crossrefs

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) = A061601(A000040(n)). - Charles R Greathouse IV, Aug 29 2013
a(n) = A160668(n) - 1. Alois P. Heinz, Dec 08 2017