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 16 results. Next

A089740 Primes which are digital complements (A055120) of primes.

Original entry on oeis.org

3, 5, 7, 13, 31, 37, 43, 67, 73, 79, 97, 103, 113, 127, 139, 157, 163, 173, 181, 191, 199, 223, 227, 229, 233, 251, 257, 271, 281, 283, 313, 337, 349, 353, 359, 367, 383, 409, 419, 433, 449, 457, 463, 467, 479, 491, 523, 541, 547, 563, 569, 587, 601, 619, 631
Offset: 1

Views

Author

Roger L. Bagula, Jan 08 2004

Keywords

Crossrefs

Cf. A055120.

Programs

  • Maple
    A055120:= proc(n) local L;
      L:= map(t -> -t mod 10, convert(n,base,10));
      add(L[i]*10^(i-1),i=1..nops(L))
    end proc:
    filter:= t -> isprime(t) and isprime(A055120(t)):
    select(filter, [seq(i,i=3..1000,2)]); # Robert Israel, Jun 29 2018
  • Mathematica
    b=Delete[Union[ Table[If[PrimeQ[a[[n]]]==True,a[[n]],0],{n,1,Dimensions[a][[1]]}]],1]

Extensions

Edited by Charles R Greathouse IV, Oct 28 2009
Name clarified by Robert Israel, Jun 29 2018

A004488 Tersum n + n.

Original entry on oeis.org

0, 2, 1, 6, 8, 7, 3, 5, 4, 18, 20, 19, 24, 26, 25, 21, 23, 22, 9, 11, 10, 15, 17, 16, 12, 14, 13, 54, 56, 55, 60, 62, 61, 57, 59, 58, 72, 74, 73, 78, 80, 79, 75, 77, 76, 63, 65, 64, 69, 71, 70, 66, 68, 67, 27, 29, 28, 33, 35, 34, 30, 32, 31, 45, 47, 46, 51
Offset: 0

Views

Author

Keywords

Comments

Could also be described as "Write n in base 3, then replace each digit with its base-3 negative" as with A048647 for base 4. - Henry Bottomley, Apr 19 2000
a(a(n)) = n, a self-inverse permutation of the nonnegative integers. - Reinhard Zumkeller, Dec 19 2003
First 3^n terms of the sequence form a permutation s(n) of 0..3^n-1, n>=1; the number of inversions of s(n) is A016142(n-1). - Gheorghe Coserea, Apr 23 2018

Crossrefs

Programs

  • Haskell
    a004488 0 = 0
    a004488 n = if d == 0 then 3 * a004488 n' else 3 * a004488 n' + 3 - d
                where (n', d) = divMod n 3
    -- Reinhard Zumkeller, Mar 12 2014
    
  • Maple
    a:= proc(n) local t, r, i;
          t, r:= n, 0;
          for i from 0 while t>0 do
            r:= r+3^i *irem(2*irem(t, 3, 't'), 3)
          od; r
        end:
    seq(a(n), n=0..80);  # Alois P. Heinz, Sep 07 2011
  • Mathematica
    a[n_] := FromDigits[Mod[3-IntegerDigits[n, 3], 3], 3]; Table[a[n], {n, 0, 66}] (* Jean-François Alcover, Mar 03 2014 *)
  • PARI
    a(n) = my(b=3); fromdigits(apply(d->(b-d)%b, digits(n, b)), b);
    vector(67, i, a(i-1))  \\ Gheorghe Coserea, Apr 23 2018
    
  • Python
    from sympy.ntheory.factor_ import digits
    def a(n): return int("".join([str((3 - i)%3) for i in digits(n, 3)[1:]]), 3) # Indranil Ghosh, Jun 06 2017

Formula

Tersum m + n: write m and n in base 3 and add mod 3 with no carries, e.g., 5 + 8 = "21" + "22" = "10" = 1.
a(n) = Sum(3-d(i)-3*0^d(i): n=Sum(d(i)*3^d(i): 0<=d(i)<3)). - Reinhard Zumkeller, Dec 19 2003
a(3*n) = 3*a(n), a(3*n+1) = 3*a(n)+2, a(3*n+2) = 3*a(n)+1. - Robert Israel, May 09 2014

A061601 9's complement of n: a(n) = 10^d - 1 - n where d is the number of digits in n. If a is a digit in n replace it with 9 - a.

Original entry on oeis.org

9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28
Offset: 0

Views

Author

Amarnath Murthy, May 19 2001

Keywords

Comments

A109002 and A178500 give record values and where they occur: A109002(n+1)=a(A178500(n)) and a(m)<A109002(n+1) for m<A178500(n). - Reinhard Zumkeller, May 28 2010
If n is divisible by 3, so is a(n). The same goes for 9. - Alonso del Arte, Dec 01 2011
For n > 0, a(n-1) consists of the A055642(n) least significant digits of the 10-adic integer -n. - Stefano Spezia, Jan 21 2021

Examples

			a(7) = 2 = 10 - 1 -7. a(123) = 1000 -1 -123 = 876.
		

References

  • Kjartan Poskitt, Murderous Maths: Numbers, The Key to the Universe, Scholastic Ltd, 2002. See p 159.

Crossrefs

Cf. A055120.
See A267193 for complement obverse of n.

Programs

  • Haskell
    a061601 n = if n <= 9 then 9 - n else 10 * ad n' + 9 - d
                where (n',d) = divMod n 10
    -- Reinhard Zumkeller, Feb 21 2014, Oct 04 2011
    
  • Maple
    A061601 := proc(n)
            10^A055642(n)-1-n ;
    end proc: # R. J. Mathar, Nov 30 2011
  • Mathematica
    nineComplement[n_] := FromDigits[Table[9, {Length[IntegerDigits[n]]}] - IntegerDigits[n]]; Table[nineComplement[n], {n, 0, 71}] (* Alonso del Arte, Nov 30 2011 *)
  • PARI
    A061601(n)=my(e=length(Str(n)));10^e-1 - n; \\ Joerg Arndt, Aug 28 2013
    
  • Python
    def A061601(n):
        return 10**len(str(n))-1-n # Indranil Ghosh, Jan 30 2017

Formula

a(n) = if n<10 then 9 - n else 10*a([n/10]) + 9 - n mod 10. - Reinhard Zumkeller, Jan 20 2010
a(n) <= 9n - 1. - Charles R Greathouse IV, Nov 15 2022

Extensions

Corrected and extended by Matthew Conroy, Jan 19 2002

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

A059692 Table of carryless products i * j, i>=0, j>=0, read by antidiagonals.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 2, 2, 0, 0, 3, 4, 3, 0, 0, 4, 6, 6, 4, 0, 0, 5, 8, 9, 8, 5, 0, 0, 6, 0, 2, 2, 0, 6, 0, 0, 7, 2, 5, 6, 5, 2, 7, 0, 0, 8, 4, 8, 0, 0, 8, 4, 8, 0, 0, 9, 6, 1, 4, 5, 4, 1, 6, 9, 0, 0, 10, 8, 4, 8, 0, 0, 8, 4, 8, 10, 0, 0, 11, 20, 7, 2, 5, 6, 5, 2, 7, 20, 11, 0
Offset: 0

Views

Author

Henry Bottomley, Feb 19 2001

Keywords

Examples

			Table begins:
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0,  0,  0,  0 ...
  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ...
  0, 2, 4, 6, 8, 0, 2, 4, 6, 8, 20, 22, 24, 26, 28, 20 ...
  0, 3, 6, 9, 2, 5, 8, 1, 4, 7, 30, 33, 36, 39, 32, 35 ...
  0, 4, 8, 2, 6, 0, 4, 8, 2, 6, 40, 44, 48, 42, 46, 40 ...
  ...
T(12, 97) = 954 since we have 12 X 97 = carryless sum of 900, (180 mod 100=)80, 70 and (14 mod 10=)4 = 954.
		

Crossrefs

Cf. A001477 for carryless 1 X n, A004520 for carryless 2 X 10 base 10, A055120 for carryless 9 X n, A008592 for carryless 10 X n.
Cf. A048720 (binary), A325820 (ternary).

Programs

  • Mathematica
    len[num_]:=Length[IntegerDigits[num]]; digit[num_,d_]:=Part[IntegerDigits[num],d]; T[i_, j_] := FromDigits[Reverse[CoefficientList[PolynomialMod[Sum[digit[i,c]*x^(len[i]-c), {c, len[i]}]*Sum[digit[j,r]*x^(len[j]-r), {r, len[j]}], 10], x]]]; Flatten[Table[T[i - j, j], {i, 0, 12}, {j, 0, i}]] (* Stefano Spezia, Sep 26 2022 *)
  • PARI
    T(n,k) = fromdigits(lift(Vec( Mod(Pol(digits(n)),10) * Pol(digits(k))))); \\ Kevin Ryde, Sep 27 2022

Extensions

Minor edits by N. J. A. Sloane, Aug 24 2010

A059632 Carryless product 11 X n base 10.

Original entry on oeis.org

0, 11, 22, 33, 44, 55, 66, 77, 88, 99, 110, 121, 132, 143, 154, 165, 176, 187, 198, 109, 220, 231, 242, 253, 264, 275, 286, 297, 208, 219, 330, 341, 352, 363, 374, 385, 396, 307, 318, 329, 440, 451, 462, 473, 484, 495, 406, 417, 428, 439, 550, 561, 572, 583
Offset: 0

Views

Author

Henry Bottomley, Feb 19 2001

Keywords

Comments

a(n) <= 11*n; a(m) = 11*m iff m is a term of A039691. - Reinhard Zumkeller, Jul 05 2014

Examples

			a(19)=109 since we have 11 X 19 = carryless sum of 100, 90, 10 and 9 =109
		

Crossrefs

Cf. A001477 for carryless 1 X n, A004520 for carryless 2 X 10 base 10, A055120 for carryless 9 X n, A008592 for carryless 10 X n.
Cf. A048724 carryless 3Xn in base 2, A242399 carryless 4Xn in base 3.
Cf. A008593.

Programs

  • Haskell
    a059632 n = foldl (\v d -> 10 * v + d) 0 $
                      map (flip mod 10) $ zipWith (+) ([0] ++ ds) (ds ++ [0])
                where ds = map (read . return) $ show n
    -- Reinhard Zumkeller, Jul 05 2014

A059691 Carryless product 12 X n base 10.

Original entry on oeis.org

0, 12, 24, 36, 48, 50, 62, 74, 86, 98, 120, 132, 144, 156, 168, 170, 182, 194, 106, 118, 240, 252, 264, 276, 288, 290, 202, 214, 226, 238, 360, 372, 384, 396, 308, 310, 322, 334, 346, 358, 480, 492, 404, 416, 428, 430, 442, 454, 466, 478, 500, 512, 524, 536
Offset: 0

Views

Author

Henry Bottomley, Feb 19 2001

Keywords

Examples

			a(97)=954 since we have 12 X 97 = carryless sum of 900, 80, 70 and 4 = 954
		

Crossrefs

Cf. A001477 for carryless 1 X n, A004520 for carryless 2 X n base 10, A055120 for carryless 9 X n, A008592 for carryless 10 X n.

A083991 Members of A083989 whose 10's complement is also a member of A083989.

Original entry on oeis.org

3, 7, 17, 29, 71, 83, 281, 719, 983, 997, 1637, 2309, 3701, 4493, 5507, 6299, 7691, 8363, 9161, 9803, 11003, 13163, 17117, 18371, 20807, 31181, 31793, 32693, 32843, 33617, 33893, 34211, 34673, 37277, 38453, 49409, 50591, 61547, 62723, 65327
Offset: 1

Views

Author

Amarnath Murthy, May 23 2003

Keywords

Examples

			Leading zeros are removed before concatenation: 997 is in here because 997 is in A083989 (9973 is prime) and its 10-complement 3 is also in A083989 (37 is prime). Unlike the example of 17 and 83, the 10-complement is not a 1-to-1 relation in cases where 9 shows up as a most significant digit.
17 and 83 both are members and are each other's 10's complement.
		

Crossrefs

Programs

  • Maple
    A055120 := proc(n) local digs ; digs := ilog10(n)+1 ; 10^digs-n ; end: isA083989 := proc(n) local comp,ccat ; if isprime(n) then comp := A055120(n) ; ccat := n*10^(ilog10(comp)+1)+comp ; RETURN( isprime(ccat)) ; else false ; fi ; end: isA083991 := proc(n) local comp; if isA083989(n) then comp := A055120(n) ; RETURN( isA083989(comp) ) ; else false ; fi ; end: for n from 1 to 80000 do if isA083991(n) then printf("%d,",n) ; fi ; od ; # R. J. Mathar, Jul 18 2007

Extensions

More terms from Diana L. Mecum and R. J. Mathar, Jul 18 2007

A300447 Numbers x such that sigma(x) = sigma(y), with x<>y, where y is the 10's complement mod 10 of the digits of x.

Original entry on oeis.org

54, 56, 513, 520, 546, 564, 580, 597, 4845, 5130, 5223, 5454, 5656, 5887, 5970, 6265, 44226, 46365, 48450, 50260, 50840, 51300, 52230, 52520, 53768, 57342, 58580, 58870, 59700, 62650, 64745, 66884, 463650, 477972, 484500, 489132, 489632, 493752, 501536, 503274
Offset: 1

Views

Author

Paolo P. Lava, Mar 06 2018

Keywords

Examples

			sigma(54) = sigma(56) = 120;
sigma(513) = sigma(597) = 800;
sigma(477972) = sigma(633138) = 1415232.
		

Crossrefs

Programs

  • Maple
    with(numtheory): P:=proc(q) local a,b,k,n;
    for n from 1 to q do a:=convert(n,base,10);
    for k from 1 to nops(a) do a[k]:=(10-a[k]) mod 10; od; b:=0;
    for k from 1 to nops(a) do b:=b*10+a[nops(a)-k+1]; od;
    if b<>n and sigma(b)=sigma(n) then print(n); fi; od; end: P(10^6);
  • Mathematica
    Select[Range[10^6], Apply[And[#1 != #2, DivisorSigma[1, #1] == DivisorSigma[1, #2]] &, {#, FromDigits[IntegerDigits[#] /. d_?Positive :> 10 - d]}] &] (* Michael De Vlieger, Mar 09 2018 *)
  • PARI
    isok(x) = {my(dx = digits(x), dy = vector(#dx, k, (10-dx[k]) % 10), y = fromdigits(dy)); (x != y) && (sigma(x) == sigma(y));} \\ Michel Marcus, Mar 07 2018

A359697 Triangle T(n,k), n >= 1, 1 <= k <= n, read by rows, where T(n,k) is carryless product n X k base 10.

Original entry on oeis.org

1, 2, 4, 3, 6, 9, 4, 8, 2, 6, 5, 0, 5, 0, 5, 6, 2, 8, 4, 0, 6, 7, 4, 1, 8, 5, 2, 9, 8, 6, 4, 2, 0, 8, 6, 4, 9, 8, 7, 6, 5, 4, 3, 2, 1, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 11, 22, 33, 44, 55, 66, 77, 88, 99, 110, 121, 12, 24, 36, 48, 50, 62, 74, 86, 98, 120, 132, 144
Offset: 1

Views

Author

Seiichi Manyama, Mar 08 2023

Keywords

Examples

			Triangle begins:
   1;
   2,  4;
   3,  6,  9;
   4,  8,  2,  6;
   5,  0,  5,  0,  5;
   6,  2,  8,  4,  0,  6;
   7,  4,  1,  8,  5,  2,  9;
   8,  6,  4,  2,  0,  8,  6,  4;
   9,  8,  7,  6,  5,  4,  3,  2,  1;
  10, 20, 30, 40, 50, 60, 70, 80, 90, 100;
  11, 22, 33, 44, 55, 66, 77, 88, 99, 110, 121;
  12, 24, 36, 48, 50, 62, 74, 86, 98, 120, 132, 144;
		

Crossrefs

T(n,n) gives A059729.
Cf. A001477 for carryless 1 X n, A004520 for carryless 2 X n base 10, A055120 for carryless 9 X n, A008592 for carryless 10 X n, A059691 for carryless 12 X n.

Programs

  • PARI
    T(n, k) = fromdigits(Vec(Pol(digits(n))*Pol(digits(k)))%10);
Showing 1-10 of 16 results. Next