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.

Previous Showing 31-40 of 61 results. Next

A242399 Write n and 3n in ternary representation and add all trits modulo 3.

Original entry on oeis.org

0, 4, 8, 12, 16, 11, 24, 19, 23, 36, 40, 44, 48, 52, 47, 33, 28, 32, 72, 76, 80, 57, 61, 56, 69, 64, 68, 108, 112, 116, 120, 124, 119, 132, 127, 131, 144, 148, 152, 156, 160, 155, 141, 136, 140, 99, 103, 107, 84, 88, 83, 96, 91, 95, 216, 220, 224, 228, 232
Offset: 0

Views

Author

Reinhard Zumkeller, May 13 2014

Keywords

Examples

			n = 25, 3*n = 75:
.  A007089(25) =  221
.  A007089(75) = 2210
.   add trits    ----
.    modulo 3    2101 = A007089(64), hence a(25) = 64.
		

Crossrefs

Programs

  • Haskell
    a242399 n = foldr (\t v -> 3 * v + t) 0 $
                      map (flip mod 3) $ zipWith (+) ([0] ++ ts) (ts ++ [0])
                where ts = a030341_row n

Formula

a(n) <= 4*n; a(m) = 4*m iff m is a term of A242407.
a(n) = A008586(n) - A242400(n).

A178731 a(n) = n XOR 5n, where XOR is bitwise XOR.

Original entry on oeis.org

0, 4, 8, 12, 16, 28, 24, 36, 32, 36, 56, 60, 48, 76, 72, 68, 64, 68, 72, 76, 112, 124, 120, 100, 96, 100, 152, 156, 144, 140, 136, 132, 128, 132, 136, 140, 144, 156, 152, 228, 224, 228, 248, 252, 240, 204, 200, 196, 192, 196, 200, 204, 304, 316, 312, 292, 288, 292
Offset: 0

Views

Author

Dmitry Kamenetsky, Jun 08 2010

Keywords

Crossrefs

Programs

Extensions

a(30) onwards from Robert G. Wilson v, Jun 09 2010

A178734 a(n) = n XOR 8n, where XOR is bitwise XOR.

Original entry on oeis.org

0, 9, 18, 27, 36, 45, 54, 63, 72, 65, 90, 83, 108, 101, 126, 119, 144, 153, 130, 139, 180, 189, 166, 175, 216, 209, 202, 195, 252, 245, 238, 231, 288, 297, 306, 315, 260, 269, 278, 287, 360, 353, 378, 371, 332, 325, 350, 343, 432, 441, 418, 427, 404, 413, 390
Offset: 0

Views

Author

Dmitry Kamenetsky, Jun 08 2010

Keywords

Crossrefs

Programs

Extensions

a(30) onwards from Robert G. Wilson v, Jun 09 2010

A234022 a(n) = A000120(A193231(n)); number of 1-bits in blue code for n.

Original entry on oeis.org

0, 1, 2, 1, 2, 1, 2, 3, 4, 3, 2, 3, 2, 3, 2, 1, 2, 1, 2, 3, 2, 3, 4, 3, 4, 5, 4, 3, 4, 3, 2, 3, 4, 3, 2, 3, 4, 5, 4, 3, 4, 5, 6, 5, 4, 3, 4, 5, 2, 3, 2, 1, 4, 3, 2, 3, 4, 3, 4, 5, 2, 3, 4, 3, 4, 3, 4, 5, 2, 3, 4, 3, 4, 5, 4, 3, 6, 5, 4, 5, 2, 3, 4, 3, 2, 1, 2
Offset: 0

Views

Author

Antti Karttunen, Dec 28 2013

Keywords

Crossrefs

A234023 gives the positions where abs(a(n)-a(n+1)) > 1.

Programs

  • Python
    def a065621(n): return n^(2*(n - (n&-n)))
    def a048724(n): return n^(2*n)
    l=[0, 1]
    z=[0, 1]
    for n in range(2, 101):
        if n%2==0: l.append(a048724(l[n//2]))
        else: l.append(a065621(1 + l[(n - 1)//2]))
        z.append(bin(l[-1])[2:].count("1"))
    print(z) # Indranil Ghosh, Jun 05 2017
  • Scheme
    (define (A234022 n) (A000120 (A193231 n)))
    

Formula

a(n) = A000120(A193231(n)).
A000035(a(n)) = A000035(n) = (n mod 2) for all n. [Even terms occur only on even indices and odd terms only on odd indices, respectively]

A234025 Permutation of nonnegative integers: a(n) = A054429(A193231(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 28 2013

Keywords

Crossrefs

Inverse permutation: A234026.

Programs

  • Python
    def a065621(n): return n^(2*(n - (n&-n)))
    def a048724(n): return n^(2*n)
    def a054429(n): return 1 if n==1 else 2*a054429(int(n/2)) + 1 - n%2
    def a193231(n):
        if n<2: return n
        if n%2==0: return a048724(a193231(n/2))
        else: return a065621(1 + a193231((n - 1)/2))
    def a(n): return n if n<2 else a054429(a193231(n)) # Indranil Ghosh, Jun 05 2017
  • Scheme
    (define (A234025 n) (A054429 (A193231 n)))
    

Formula

a(n) = A054429(A193231(n)).
a(n) = A234027(A054429(n)).

A234612 Self-inverse permutation of nonnegative integers, "blue-gray" code: a(n) = A003188(A193231(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 28 2013

Keywords

Crossrefs

Programs

  • Python
    def a065621(n): return n^(2*(n - (n&-n)))
    def a048724(n): return n^(2*n)
    def a003188(n): return n^(n>>1)
    def a193231(n):
        if n<2: return n
        if n%2==0: return a048724(a193231(n/2))
        else: return a065621(1 + a193231((n - 1)/2))
    def a(n): return n if n<2 else a003188(a193231(n)) # Indranil Ghosh, Jun 05 2017
  • Scheme
    (define (A234612 n) (A003188 (A193231 n)))
    (define (A234612v2 n) (A193231 (A006068 n))) ;; Alternative 2.
    

Formula

a(n) = A003188(A193231(n)).
a(n) = A193231(A006068(n)).
a(n) = A193231(A234613(A193231(n))).

A136380 Quotient obtained when A036284(n) is considered as a GF(2)[X]-polynomial and it is divided by (x^3 + 1) ^ A000225(n-1).

Original entry on oeis.org

24, 160, 11968, 49657088, 837028380268032, 237269922100748727235760269312, 18811253173629696438994877569412700111469395859003555753984, 118178826602781220665226658680265194908312590801831513776333330179329649495708436476846379030238467286212637486694400
Offset: 1

Views

Author

Antti Karttunen, Dec 29 2007

Keywords

Crossrefs

a(n) = 4*A136382(n) = 2*A048724(A136384(n)). A136381 shows the same sequence in octal base. Cf. A036284.

A136382 a(n) = A136380(n)/4.

Original entry on oeis.org

6, 40, 2992, 12414272, 209257095067008, 59317480525187181808940067328, 4702813293407424109748719392353175027867348964750888938496, 29544706650695305166306664670066298727078147700457878444083332544832412373927109119211594757559616821553159371673600
Offset: 1

Views

Author

Antti Karttunen, Dec 29 2007

Keywords

Comments

Note that each term a(n) fits into A007283(n-1) bits.

Crossrefs

a(n) = A048724(A136384(n))/2. A136383 shows the same sequence in octal base. Cf. A036284.

A142149 a(n) = XOR{k OR (n-k): 0<=k<=n}.

Original entry on oeis.org

0, 1, 3, 3, 6, 5, 5, 7, 12, 9, 15, 11, 10, 13, 9, 15, 24, 17, 27, 19, 30, 21, 29, 23, 20, 25, 23, 27, 18, 29, 17, 31, 48, 33, 51, 35, 54, 37, 53, 39, 60, 41, 63, 43, 58, 45, 57, 47, 40, 49, 43, 51, 46, 53, 45, 55, 36, 57, 39, 59, 34, 61, 33, 63, 96, 65, 99, 67, 102, 69, 101, 71
Offset: 0

Views

Author

Reinhard Zumkeller, Jul 15 2008

Keywords

Comments

a(n) = XOR{k AND (n-k): 0<=k<=n}.

Crossrefs

Programs

  • Haskell
    import Data.Bits (xor, (.|.))
    a142149 :: Integer -> Integer
    a142149 = foldl xor 0 . zipWith (.|.) [0..] . reverse . enumFromTo 1
    -- Reinhard Zumkeller, Mar 31 2015
    
  • PARI
    a(n)=if(n%2, n, bitxor(n, n/2)) \\ Charles R Greathouse IV, Jul 01 2022
  • Python
    def A142149(n): return n if n&1 else (n^ n>>1) # Chai Wah Wu, Jun 29 2022
    

Formula

a(2*n) = A048724(n) and a(2*n+1) = A005408(n).

A178732 a(n) = n XOR 6n, where XOR is bitwise XOR.

Original entry on oeis.org

0, 7, 14, 17, 28, 27, 34, 45, 56, 63, 54, 73, 68, 67, 90, 85, 112, 119, 126, 97, 108, 107, 146, 157, 136, 143, 134, 185, 180, 179, 170, 165, 224, 231, 238, 241, 252, 251, 194, 205, 216, 223, 214, 297, 292, 291, 314, 309, 272, 279, 286, 257, 268, 267, 370, 381
Offset: 0

Views

Author

Dmitry Kamenetsky, Jun 08 2010

Keywords

Crossrefs

Programs

  • Mathematica
    f[n_] := BitXor[n, 6 n]; Array[f, 60, 0] (* Robert G. Wilson v, Jun 09 2010 *)

Extensions

a(30) onwards from Robert G. Wilson v, Jun 09 2010
Previous Showing 31-40 of 61 results. Next