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.

Showing 1-10 of 12 results. Next

A055120 Digital complement of n (replace each nonzero digit d with 10-d).

Original entry on oeis.org

0, 9, 8, 7, 6, 5, 4, 3, 2, 1, 90, 99, 98, 97, 96, 95, 94, 93, 92, 91, 80, 89, 88, 87, 86, 85, 84, 83, 82, 81, 70, 79, 78, 77, 76, 75, 74, 73, 72, 71, 60, 69, 68, 67, 66, 65, 64, 63, 62, 61, 50, 59, 58, 57, 56, 55, 54, 53, 52, 51, 40, 49, 48, 47, 46, 45, 44, 43, 42, 41, 30, 39
Offset: 0

Views

Author

Henry Bottomley, Apr 19 2000

Keywords

Comments

a(n) = -n in carryless arithmetic mod 10 - that is, n + a(n) = 0 (cf. A169894). - N. J. A. Sloane, Aug 03 2010

Examples

			a(11) = 99 because 1 + 9 = 0 mod 10 for each digit.
a(20) = 80 because 2 + 8 = 0 mod 10 and 0 + 0 = 0 mod 10.
		

Crossrefs

Column k=10 of A248813.

Programs

  • Haskell
    a055120 = foldl f 0 . reverse . unfoldr g where
       f v d = if d == 0 then 10 * v else 10 * v + 10 - d
       g x = if x == 0 then Nothing else Just $ swap $ divMod x 10
    -- Reinhard Zumkeller, Oct 04 2011
    
  • Maple
    f:=proc(n) local t0,t1,i;
    t0:=0; t1:=convert(n,base,10);
    for i from 1 to nops(t1) do
    if t1[i]>0 then t0:=t0+(10-t1[i])*10^(i-1); fi;
    od:
    RETURN(t0);
    end;
    # N. J. A. Sloane, Jan 21 2011
  • Mathematica
    a[n_] := FromDigits[ IntegerDigits[n] /. d_?Positive -> 10-d]; Table[a[n], {n, 0, 100}](* Jean-François Alcover, Nov 28 2011 *)
  • PARI
    a(n)=fromdigits(apply(d->if(d,10-d,0),digits(n))) \\ Charles R Greathouse IV, Feb 08 2017
    
  • Python
    def A055120(n): return int(''.join(str(10-int(d)) if d != '0' else d for d in str(n))) # Chai Wah Wu, Apr 03 2021

Formula

From Robert Israel, Sep 04 2017: (Start)
a(10*n) = 10*a(n).
a(10*n+j) = 10*a(n) + 10 - j for 1 <= j <= 9.
G.f. g(x) satisfies g(x) = 10*(1+x+x^2+...+x^9)*g(x^10) + (9*x+8*x^2+7*x^3+6*x^4+5*x^5+4*x^6+3*x^7+2*x^8+x^9)/(1-x^10).
(End)

A248813 A(n,k) is the base-k complement of n; square array A(n,k), n>=0, k>=2, read by antidiagonals.

Original entry on oeis.org

0, 0, 1, 0, 2, 2, 0, 3, 1, 3, 0, 4, 2, 6, 4, 0, 5, 3, 1, 8, 5, 0, 6, 4, 2, 12, 7, 6, 0, 7, 5, 3, 1, 15, 3, 7, 0, 8, 6, 4, 2, 20, 14, 5, 8, 0, 9, 7, 5, 3, 1, 24, 13, 4, 9, 0, 10, 8, 6, 4, 2, 30, 23, 8, 18, 10, 0, 11, 9, 7, 5, 3, 1, 35, 22, 11, 20, 11, 0, 12, 10, 8, 6, 4, 2, 42, 34, 21, 10, 19, 12
Offset: 0

Views

Author

Alois P. Heinz, Mar 03 2015

Keywords

Comments

Every column is a permutation of the nonnegative integers.

Examples

			Square array A(n,k) begins:
   0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, ...
   1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, ...
   2,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, ...
   3,  6,  1,  2,  3,  4,  5,  6,  7,  8,  9, ...
   4,  8, 12,  1,  2,  3,  4,  5,  6,  7,  8, ...
   5,  7, 15, 20,  1,  2,  3,  4,  5,  6,  7, ...
   6,  3, 14, 24, 30,  1,  2,  3,  4,  5,  6, ...
   7,  5, 13, 23, 35, 42,  1,  2,  3,  4,  5, ...
   8,  4,  8, 22, 34, 48, 56,  1,  2,  3,  4, ...
   9, 18, 11, 21, 33, 47, 63, 72,  1,  2,  3, ...
  10, 20, 10, 15, 32, 46, 62, 80, 90,  1,  2, ...
		

Crossrefs

Programs

  • Maple
    A:= proc(n, k) local t, r, i; t, r:= n, 0;
          for i from 0 while t>0 do
            r:= r+k^i *irem(k-irem(t, k, 't'), k)
          od; r
        end:
    seq(seq(A(n, 2+d-n), n=0..d), d=0..14);
  • PARI
    A(n,k)=fromdigits(apply(d->(k-d)%k, digits(n, k)), k); \\ Gheorghe Coserea, Apr 23 2018

A055115 Base-5 complement of n (write n in base 5, then replace each digit with its base-5 negative).

Original entry on oeis.org

0, 4, 3, 2, 1, 20, 24, 23, 22, 21, 15, 19, 18, 17, 16, 10, 14, 13, 12, 11, 5, 9, 8, 7, 6, 100, 104, 103, 102, 101, 120, 124, 123, 122, 121, 115, 119, 118, 117, 116, 110, 114, 113, 112, 111, 105, 109, 108, 107, 106, 75, 79, 78, 77, 76, 95, 99, 98, 97, 96, 90, 94, 93, 92
Offset: 0

Views

Author

Henry Bottomley, Apr 19 2000

Keywords

Crossrefs

Column k=5 of A248813.

A055116 Base-6 complement of n (write n in base 6, then replace each digit with its base-6 negative).

Original entry on oeis.org

0, 5, 4, 3, 2, 1, 30, 35, 34, 33, 32, 31, 24, 29, 28, 27, 26, 25, 18, 23, 22, 21, 20, 19, 12, 17, 16, 15, 14, 13, 6, 11, 10, 9, 8, 7, 180, 185, 184, 183, 182, 181, 210, 215, 214, 213, 212, 211, 204, 209, 208, 207, 206, 205, 198, 203, 202, 201, 200, 199, 192, 197, 196
Offset: 0

Views

Author

Henry Bottomley, Apr 19 2000

Keywords

Crossrefs

Column k=6 of A248813.

A055117 Base-7 complement of n (write n in base 7, then replace each digit with its base-7 negative).

Original entry on oeis.org

0, 6, 5, 4, 3, 2, 1, 42, 48, 47, 46, 45, 44, 43, 35, 41, 40, 39, 38, 37, 36, 28, 34, 33, 32, 31, 30, 29, 21, 27, 26, 25, 24, 23, 22, 14, 20, 19, 18, 17, 16, 15, 7, 13, 12, 11, 10, 9, 8, 294, 300, 299, 298, 297, 296, 295, 336, 342, 341, 340, 339, 338, 337, 329, 335, 334
Offset: 0

Views

Author

Henry Bottomley, Apr 19 2000

Keywords

Crossrefs

Column k=7 of A248813.

A055118 Base-8 complement of n (write n in base 8, then replace each digit with its base-8 negative).

Original entry on oeis.org

0, 7, 6, 5, 4, 3, 2, 1, 56, 63, 62, 61, 60, 59, 58, 57, 48, 55, 54, 53, 52, 51, 50, 49, 40, 47, 46, 45, 44, 43, 42, 41, 32, 39, 38, 37, 36, 35, 34, 33, 24, 31, 30, 29, 28, 27, 26, 25, 16, 23, 22, 21, 20, 19, 18, 17, 8, 15, 14, 13, 12, 11, 10, 9, 448, 455, 454, 453, 452, 451
Offset: 0

Views

Author

Henry Bottomley, Apr 19 2000

Keywords

Crossrefs

Column k=8 of A248813.

Programs

  • Haskell
    a055118 0 = 0
    a055118 n = if d == 0 then 8 * a055118 n' else 8 * a055118 n' + 8 - d
                where (n', d) = divMod n 8
    -- Reinhard Zumkeller, Mar 12 2014

A055119 Base-9 complement of n (write n in base 9, then replace each digit with its base-9 negative).

Original entry on oeis.org

0, 8, 7, 6, 5, 4, 3, 2, 1, 72, 80, 79, 78, 77, 76, 75, 74, 73, 63, 71, 70, 69, 68, 67, 66, 65, 64, 54, 62, 61, 60, 59, 58, 57, 56, 55, 45, 53, 52, 51, 50, 49, 48, 47, 46, 36, 44, 43, 42, 41, 40, 39, 38, 37, 27, 35, 34, 33, 32, 31, 30, 29, 28, 18, 26, 25, 24, 23, 22, 21, 20, 19
Offset: 0

Views

Author

Henry Bottomley, Apr 19 2000

Keywords

Crossrefs

Column k=9 of A248813.

A055121 Base-11 complement of n (write n in base 11, then replace each digit with its base-11 negative).

Original entry on oeis.org

0, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 110, 120, 119, 118, 117, 116, 115, 114, 113, 112, 111, 99, 109, 108, 107, 106, 105, 104, 103, 102, 101, 100, 88, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 77, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 66, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67
Offset: 0

Views

Author

Henry Bottomley, Apr 19 2000

Keywords

Crossrefs

Column k=11 of A248813.

A055122 Base-12 complement of n (write n in base 12, then replace each digit with its base-12 negative).

Original entry on oeis.org

0, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 132, 143, 142, 141, 140, 139, 138, 137, 136, 135, 134, 133, 120, 131, 130, 129, 128, 127, 126, 125, 124, 123, 122, 121, 108, 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, 109, 96, 107, 106, 105, 104, 103, 102, 101, 100, 99
Offset: 0

Views

Author

Henry Bottomley, Apr 19 2000

Keywords

Crossrefs

Column k=12 of A248813.

Programs

  • Haskell
    a055122 0 = 0
    a055122 n = if d == 0 then 12 * a055122 n' else 12 * a055122 n' + 12 - d
                where (n', d) = divMod n 12
    -- Reinhard Zumkeller, Mar 12 2014

A055123 Base-13 complement of n (write n in base 13, then replace each digit with its base-13 negative).

Original entry on oeis.org

0, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 156, 168, 167, 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, 143, 155, 154, 153, 152, 151, 150, 149, 148, 147, 146, 145, 144, 130, 142, 141, 140, 139, 138, 137, 136, 135, 134, 133, 132, 131, 117, 129, 128, 127, 126
Offset: 0

Views

Author

Henry Bottomley, Apr 19 2000

Keywords

Crossrefs

Column k=13 of A248813.
Showing 1-10 of 12 results. Next