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-7 of 7 results.

A242400 Differences between A008586 (multiples of 4) and A242399.

Original entry on oeis.org

0, 0, 0, 0, 0, 9, 0, 9, 9, 0, 0, 0, 0, 0, 9, 27, 36, 36, 0, 0, 0, 27, 27, 36, 27, 36, 36, 0, 0, 0, 0, 0, 9, 0, 9, 9, 0, 0, 0, 0, 0, 9, 27, 36, 36, 81, 81, 81, 108, 108, 117, 108, 117, 117, 0, 0, 0, 0, 0, 9, 0, 9, 9, 81, 81, 81, 81, 81, 90, 108, 117, 117, 81
Offset: 0

Views

Author

Reinhard Zumkeller, May 13 2014

Keywords

Comments

a(n) = A008586(n) - A242399(n);
a(m) = 0 iff m is a term of A242407;
a(A242407(n)) = 0; a(A242408(n)) > 0.

Crossrefs

Cf. A048728.

Programs

  • Haskell
    a242400 n = a008586 n - a242399 n

A048724 Write n and 2n in binary and add them mod 2.

Original entry on oeis.org

0, 3, 6, 5, 12, 15, 10, 9, 24, 27, 30, 29, 20, 23, 18, 17, 48, 51, 54, 53, 60, 63, 58, 57, 40, 43, 46, 45, 36, 39, 34, 33, 96, 99, 102, 101, 108, 111, 106, 105, 120, 123, 126, 125, 116, 119, 114, 113, 80, 83, 86, 85, 92, 95, 90, 89, 72, 75, 78, 77, 68, 71, 66, 65, 192
Offset: 0

Views

Author

Antti Karttunen, Apr 26 1999

Keywords

Comments

Reversing binary representation of -n. Converting sum of powers of 2 in binary representation of a(n) to alternating sum gives -n. Note that the alternation is applied only to the nonzero bits and does not depend on the exponent of two. All integers have a unique reversing binary representation (see cited exercise for proof). Complement of A065621. - Marc LeBrun, Nov 07 2001
A permutation of the "evil" numbers A001969. - Marc LeBrun, Nov 07 2001
A048725(n) = a(a(n)). - Reinhard Zumkeller, Nov 12 2004

Examples

			12 = 1100 in binary, 24=11000 and their sum is 10100=20, so a(12)=20.
a(4) = 12 = + 8 + 4 -> - 8 + 4 = -4.
		

References

  • D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, 1969, Vol. 2, p. 178, (exercise 4.1. Nr. 27)

Crossrefs

Bisection of A003188 (even part).
See also A065620, A065621.
Cf. A242399.

Programs

Formula

a(n) = Xmult(n, 3) (or n XOR (n<<1)).
a(n) = A065621(-n).
a(2n) = 2a(n), a(2n+1) = 2a(n) + 2(-1)^n + 1.
G.f. 1/(1-x) * sum(k>=0, 2^k*(3t-t^3)/(1+t)/(1+t^2), t=x^2^k). - Ralf Stephan, Sep 08 2003
a(n) = sum(k=0, n, (1-(-1)^round(+n/2^k))/2*2^k). - Benoit Cloitre, Apr 27 2005
a(n) = A001969(A003188(n)). - Philippe Deléham, Apr 29 2005
a(n) = A106409(2*n) for n>0. - Reinhard Zumkeller, May 02 2005
a(n) = A142149(2*n). - Reinhard Zumkeller, Jul 15 2008

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

A325820 Multiplication table for carryless product i X j in base 3 for i >= 0 and j >= 0, read by antidiagonals.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 2, 2, 0, 0, 3, 1, 3, 0, 0, 4, 6, 6, 4, 0, 0, 5, 8, 9, 8, 5, 0, 0, 6, 7, 12, 12, 7, 6, 0, 0, 7, 3, 15, 16, 15, 3, 7, 0, 0, 8, 5, 18, 11, 11, 18, 5, 8, 0, 0, 9, 4, 21, 24, 13, 24, 21, 4, 9, 0, 0, 10, 18, 24, 19, 21, 21, 19, 24, 18, 10, 0, 0, 11, 20, 27, 23, 26, 9, 26, 23, 27, 20, 11, 0, 0, 12, 19, 30, 36, 19, 15, 15, 19, 36, 30, 19, 12, 0
Offset: 0

Views

Author

Antti Karttunen, May 22 2019

Keywords

Examples

			The array begins as:
  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, ...
  0,  2,  1,  6,  8,  7,  3,  5,  4,  18,  20,  19,  24, ...
  0,  3,  6,  9, 12, 15, 18, 21, 24,  27,  30,  33,  36, ...
  0,  4,  8, 12, 16, 11, 24, 19, 23,  36,  40,  44,  48, ...
  0,  5,  7, 15, 11, 13, 21, 26, 19,  45,  50,  52,  33, ...
  0,  6,  3, 18, 24, 21,  9, 15, 12,  54,  60,  57,  72, ...
  0,  7,  5, 21, 19, 26, 15, 13, 11,  63,  70,  68,  57, ...
  0,  8,  4, 24, 23, 19, 12, 11, 16,  72,  80,  76,  69, ...
  0,  9, 18, 27, 36, 45, 54, 63, 72,  81,  90,  99, 108, ...
  0, 10, 20, 30, 40, 50, 60, 70, 80,  90, 100,  83, 120, ...
  0, 11, 19, 33, 44, 52, 57, 68, 76,  99,  83,  91, 132, ...
  0, 12, 24, 36, 48, 33, 72, 57, 69, 108, 120, 132, 144, ...
  etc.
A(2,2) = 2*2 mod 3 = 1.
		

Crossrefs

Cf. A169999 (the main diagonal).
Row/Column 0: A000004, Row/Column 1: A001477, Row/Column 2: A004488, Row/Column 3: A008585, Row/Column 4: A242399, Row/Column 9: A008591.
Cf. A325821 (same table without the zero row and column).
Cf. A048720 (binary), A059692 (decimal), A004247 (full multiply).

Programs

  • PARI
    up_to = 105;
    A325820sq(b, c) = fromdigits(Vec(Pol(digits(b,3))*Pol(digits(c,3)))%3, 3);
    A325820list(up_to) = { my(v = vector(up_to), i=0); for(a=0,oo, for(col=0,a, if(i++ > up_to, return(v)); v[i] = A325820sq(a-col,col))); (v); };
    v325820 = A325820list(up_to);
    A325820(n) = v325820[1+n];

A242407 Numbers such that in ternary representation all pairs of adjacent digits have sums not greater than 2.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 9, 10, 11, 12, 13, 18, 19, 20, 27, 28, 29, 30, 31, 33, 36, 37, 38, 39, 40, 54, 55, 56, 57, 58, 60, 81, 82, 83, 84, 85, 87, 90, 91, 92, 93, 94, 99, 100, 101, 108, 109, 110, 111, 112, 114, 117, 118, 119, 120, 121, 162, 163, 164, 165, 166, 168
Offset: 1

Views

Author

Reinhard Zumkeller, May 13 2014

Keywords

Comments

A242400(a(n)) = 0;
A242399(a(n)) = 4*a(n);
numbers m, such that in ternary arithmetic no carry occurs, when 3*m is added to m.

Examples

			Initial terms and their ternary representations, cf. A007089:
.  0 1 2  3  4  6   9  10  11  12  13  18  19  20   27   28   29   30 ..
.  0 1 2 10 11 20 100 101 102 110 111 200 201 202 1000 1001 1002 1010 ..
		

Crossrefs

Cf. A242408 (complement), A003714, A039691, A007089.

Programs

  • Haskell
    a242407 n = a242407_list !! (n-1)
    a242407_list = filter ((== 0) . a242400) [0..]
  • Mathematica
    Select[Range[0,200],Max[Total/@Partition[IntegerDigits[#, 3],2,1]]<3&] (* Harvey P. Dale, Jan 08 2023 *)

A242408 Numbers such that in ternary representation at least one pair of adjacent digits has a sum greater than 2.

Original entry on oeis.org

5, 7, 8, 14, 15, 16, 17, 21, 22, 23, 24, 25, 26, 32, 34, 35, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 59, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 86, 88, 89, 95, 96, 97, 98, 102, 103, 104, 105, 106, 107, 113
Offset: 1

Views

Author

Reinhard Zumkeller, May 13 2014

Keywords

Comments

A242400(a(n)) > 0;
A242399(a(n)) < 4*a(n).

Examples

			Initial terms and their ternary representations, cf. A007089:
.  5  7  8  14  15  16  17  21  22  23  24  25  26   32   34   35   41 ..
. 12 21 22 112 120 121 122 210 211 212 220 221 222 1012 1021 1022 1112 ..
		

Crossrefs

Cf. A242407 (complement), A004780.

Programs

  • Haskell
    a242408 n = a242408_list !! (n-1)
    a242408_list = filter ((> 0) . a242400) [0..]
  • Mathematica
    Select[Range[200],Max[Total/@Partition[IntegerDigits[#,3],2,1]]>2&] (* Harvey P. Dale, Feb 12 2016 *)

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
Showing 1-7 of 7 results.