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 11-20 of 155 results. Next

A324386 a(n) = A324383(A006068(n)).

Original entry on oeis.org

1, 1, 2, 1, 2, 2, 2, 1, 4, 4, 4, 2, 2, 6, 6, 1, 2, 4, 8, 4, 4, 6, 12, 2, 8, 6, 10, 6, 22, 10, 8, 1, 4, 4, 6, 2, 8, 6, 8, 4, 6, 12, 14, 2, 16, 10, 16, 2, 8, 16, 4, 6, 14, 8, 24, 6, 30, 18, 20, 6, 26, 18, 26, 1, 6, 8, 8, 4, 12, 12, 6, 8, 12, 14, 18, 4, 20, 20, 20, 4, 16, 16, 8, 12, 28, 16, 10, 12, 22, 26, 14, 12, 34, 20, 22, 2, 12
Offset: 0

Views

Author

Antti Karttunen, Feb 27 2019

Keywords

Comments

This is most likely equal to A276150(A086141(n)), apart from the different offset used in A086141.
The same comments about the parity of terms as in A324383 and A324387 apply also here, except here 1's occur at positions given by 2^k - 1.

Crossrefs

Cf. also A324383, A324387 (permutations of this sequence) and A324380, A324390.

Programs

  • PARI
    A006068(n)= { my(s=1, ns); while(1, ns = n >> s; if(0==ns, break()); n = bitxor(n, ns); s <<= 1; ); return (n); } \\ From A006068
    A276150(n) = { my(s=0,m); forprime(p=2, , if(!n, return(s)); m = n%p; s += m; n = (n-m)/p); };
    A322827(n) = if(!n,1,my(bits = Vecrev(binary(n)), rl=1, o = List([])); for(i=2,#bits,if(bits[i]==bits[i-1], rl++, listput(o,rl))); listput(o,rl); my(es=Vecrev(Vec(o)), m=1); for(i=1,#es,m *= prime(i)^es[i]); (m));
    A324383(n) = A276150(A322827(n));
    A324386(n) = A324383(A006068(n));

Formula

a(A000225(n)) = 1 for all n.

A268725 Square array A(i,j) = A003188(A006068(i) * A006068(j)), read by antidiagonals as A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), ...

Original entry on oeis.org

1, 2, 2, 3, 13, 3, 4, 5, 5, 4, 5, 31, 6, 31, 5, 6, 27, 9, 9, 27, 6, 7, 10, 10, 41, 10, 10, 7, 8, 8, 12, 63, 63, 12, 8, 8, 9, 59, 15, 18, 54, 18, 15, 59, 9, 10, 63, 17, 50, 20, 20, 50, 17, 63, 10, 11, 54, 18, 93, 17, 24, 17, 93, 18, 54, 11, 12, 52, 20, 83, 119, 30, 30, 119, 83, 20, 52, 12, 13, 20, 23, 126, 126, 34, 21, 34, 126, 126, 23, 20, 13
Offset: 1

Views

Author

Antti Karttunen, Feb 13 2016

Keywords

Examples

			The top left [1 .. 15] x [1 .. 15] section of the array:
   1,  2,  3,   4,   5,  6,   7,   8,   9,  10,  11,  12,  13,  14,  15
   2, 13,  5,  31,  27, 10,   8,  59,  63,  54,  52,  20,  22,  49,  17
   3,  5,  6,   9,  10, 12,  15,  17,  18,  20,  23,  24,  27,  29,  30
   4, 31,  9,  41,  63, 18,  50,  93,  83, 126, 118,  36,  32, 107, 101
   5, 27, 10,  63,  54, 20,  17, 119, 126, 108, 105,  40,  45,  99,  34
   6, 10, 12,  18,  20, 24,  30,  34,  36,  40,  46,  48,  54,  58,  60
   7,  8, 15,  50,  17, 30,  21, 110, 101,  34,  97,  60,  59,  44,  43
   8, 59, 17,  93, 119, 34, 110, 145, 187, 238, 162,  68, 196, 247, 221
   9, 63, 18,  83, 126, 36, 101, 187, 166, 252, 237,  72,  65, 215, 202
  10, 54, 20, 126, 108, 40,  34, 238, 252, 216, 210,  80,  90, 198,  68
  11, 52, 23, 118, 105, 46,  97, 162, 237, 210, 253,  92,  79, 200, 195
  12, 20, 24,  36,  40, 48,  60,  68,  72,  80,  92,  96, 108, 116, 120
  13, 22, 27,  32,  45, 54,  59, 196,  65,  90,  79, 108, 121,  82, 119
  14, 49, 29, 107,  99, 58,  44, 247, 215, 198, 200, 116,  82,  69,  89
  15, 17, 30, 101,  34, 60,  43, 221, 202,  68, 195, 120, 119,  89,  86
		

Crossrefs

Cf. A268723 (main diagonal).
Cf. A268722 (row 2 and column 2).
Cf. A001969 (row 3 and column 3).
Cf. also A268715.

Programs

Formula

A(i,j) = A003188(A006068(i) * A006068(j)).
A(i,j) = A003188(A268724(i,j)).

A369042 LCM-transform of the inverse of binary Gray code (A006068).

Original entry on oeis.org

1, 3, 2, 7, 1, 2, 5, 1, 1, 1, 13, 2, 3, 11, 1, 31, 1, 1, 29, 1, 5, 3, 1, 2, 17, 19, 1, 23, 1, 1, 1, 1, 1, 1, 61, 1, 1, 59, 1, 1, 7, 1, 1, 1, 1, 1, 53, 2, 1, 1, 1, 1, 1, 1, 37, 47, 1, 1, 1, 1, 41, 43, 1, 127, 1, 1, 5, 1, 11, 1, 1, 1, 113, 1, 1, 1, 1, 1, 1, 1, 97, 1, 1, 103, 1, 1, 101, 1, 1, 1, 109, 1, 1, 107, 1, 2, 1
Offset: 1

Views

Author

Antti Karttunen, Jan 12 2024

Keywords

Comments

Inverse of Binary Gray code, A006068, is a permutation related to the binary expansion of n that keeps all the numbers of range [2^k, 2^(1+k)[ in the same range, i.e., for all n >= 1, A000523(A006068(n)) = A000523(n), from which it immediately follows that A006068 has the property S mentioned in the comments of A368900, and therefore this sequence is equal to A014963(A006068(n)), for n >= 1.

Crossrefs

Programs

  • PARI
    up_to = 65537; \\ Checked up to 2^17;
    LCMtransform(v) = { my(len = length(v), b = vector(len), g = vector(len)); b[1] = g[1] = 1; for(n=2,len, g[n] = lcm(g[n-1],v[n]); b[n] = g[n]/g[n-1]); (b); };
    A006068(n)= { my(s=1, ns); while(1, ns = n >> s; if(0==ns, break()); n = bitxor(n, ns); s <<= 1; ); return (n); } \\ From A006068
    v369042 = LCMtransform(vector(up_to,i,A006068(i)));
    A369042(n) = v369042[n];
    A014963(n) = { ispower(n, , &n); if(isprime(n), n, 1); };

Formula

a(n) = lcm {1..A006068(n)} / lcm {1..A006068(n-1)}.
a(n) = A014963(A006068(n)). [See comments.]

A153154 Permutation of natural numbers: A059893-conjugate of A006068.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 20 2008

Keywords

Comments

A002487(1+a(n)) = A020651(n) and A002487(a(n)) = A020650(n). So, it generates the enumeration system of positive rationals based on Stern's sequence A002487. - Yosu Yurramendi, Feb 26 2020

Crossrefs

Inverse: A153153. a(n) = A059893(A006068(A059893(n))).

Programs

  • R
    maxn <- 63 # by choice
    a <- c(1,3,2)
    #
    for(n in 2:maxn){
      a[2*n] <- 2*a[n] + 1
      if(n%%2==0) a[2*n+1] <- 2*a[n+1]
      else        a[2*n+1] <- 2*a[n-1]
    }
    (a <- c(0,a))
    # Yosu Yurramendi, Feb 26 2020
    
  • R
    # Given n, compute a(n) by taking into account the binary representation of n
    maxblock <- 8 # by choice
    a <- c(1, 3, 2)
    for(n in 4:2^maxblock){
      ones <- which(as.integer(intToBits(n)) == 1)
      nbit <- as.integer(intToBits(n))[1:tail(ones, n = 1)]
      anbit <- nbit
      for(i in 2:(length(anbit) - 1))
        anbit[i] <- bitwXor(anbit[i], anbit[i - 1])  # ?bitwXor
      anbit[0:(length(anbit) - 1)] <- 1 - anbit[0:(length(anbit) - 1)]
      a <- c(a, sum(anbit*2^(0:(length(anbit) - 1))))
    }
    (a <- c(0, a))
    # Yosu Yurramendi, Oct 04 2021

Formula

From Yosu Yurramendi, Feb 26 2020: (Start)
a(1) = 1, for all n > 0 a(2*n) = 2*a(n) + 1, a(2*n+1) = 2*a(A065190(n)).
a(1) = 1, a(2) = 3, a(3) = 2, for all n > 1 a(2*n) = 2*a(n) + 1, and if n even a(2*n+1) = 2*a(n+1), else a(2*n+1) = 2*a(n-1).
a(n) = A054429(A231551(n)) = A231551(A065190(n)) = A284459(A054429(n)) =
A332769(A284459(n)) = A258996(A154437(n)). (End)

A268714 Square array A(i,j) = A006068(i) + A006068(j), read by antidiagonals.

Original entry on oeis.org

0, 1, 1, 3, 2, 3, 2, 4, 4, 2, 7, 3, 6, 3, 7, 6, 8, 5, 5, 8, 6, 4, 7, 10, 4, 10, 7, 4, 5, 5, 9, 9, 9, 9, 5, 5, 15, 6, 7, 8, 14, 8, 7, 6, 15, 14, 16, 8, 6, 13, 13, 6, 8, 16, 14, 12, 15, 18, 7, 11, 12, 11, 7, 18, 15, 12, 13, 13, 17, 17, 12, 10, 10, 12, 17, 17, 13, 13, 8, 14, 15, 16, 22, 11, 8, 11, 22, 16, 15, 14, 8, 9, 9, 16, 14, 21, 21, 9, 9, 21, 21, 14, 16, 9, 9
Offset: 0

Views

Author

Antti Karttunen, Feb 12 2016

Keywords

Examples

			The top left [0 .. 15] x [0 .. 15] section of the array:
   0,  1,  3,  2,  7,  6,  4,  5, 15, 14, 12, 13,  8,  9, 11, 10
   1,  2,  4,  3,  8,  7,  5,  6, 16, 15, 13, 14,  9, 10, 12, 11
   3,  4,  6,  5, 10,  9,  7,  8, 18, 17, 15, 16, 11, 12, 14, 13
   2,  3,  5,  4,  9,  8,  6,  7, 17, 16, 14, 15, 10, 11, 13, 12
   7,  8, 10,  9, 14, 13, 11, 12, 22, 21, 19, 20, 15, 16, 18, 17
   6,  7,  9,  8, 13, 12, 10, 11, 21, 20, 18, 19, 14, 15, 17, 16
   4,  5,  7,  6, 11, 10,  8,  9, 19, 18, 16, 17, 12, 13, 15, 14
   5,  6,  8,  7, 12, 11,  9, 10, 20, 19, 17, 18, 13, 14, 16, 15
  15, 16, 18, 17, 22, 21, 19, 20, 30, 29, 27, 28, 23, 24, 26, 25
  14, 15, 17, 16, 21, 20, 18, 19, 29, 28, 26, 27, 22, 23, 25, 24
  12, 13, 15, 14, 19, 18, 16, 17, 27, 26, 24, 25, 20, 21, 23, 22
  13, 14, 16, 15, 20, 19, 17, 18, 28, 27, 25, 26, 21, 22, 24, 23
   8,  9, 11, 10, 15, 14, 12, 13, 23, 22, 20, 21, 16, 17, 19, 18
   9, 10, 12, 11, 16, 15, 13, 14, 24, 23, 21, 22, 17, 18, 20, 19
  11, 12, 14, 13, 18, 17, 15, 16, 26, 25, 23, 24, 19, 20, 22, 21
  10, 11, 13, 12, 17, 16, 14, 15, 25, 24, 22, 23, 18, 19, 21, 20
		

Crossrefs

Cf. A006068 (row 0, column 0).
Cf. A066194 (row 1, column 1).
Cf. A268716 (main diagonal).
Cf. also A268724.

Programs

  • Mathematica
    A006068[n_] := BitXor @@ Table[Floor[n/2^m], {m, 0, Log[2, n]}]; A006068[0] = 0; A[i_, j_] := A006068[i] + A006068[j]; Table[A[i-j, j], {i, 0, 13}, {j, 0, i}] // Flatten (* Jean-François Alcover, Feb 17 2016 *)
  • PARI
    \\ Produces the triangle when the array is read by antidiagonals
    a(n) = if(n<2, n, 2*a(floor(n/2)) + (n%2 + a(floor(n/2))%2)%2); /* A006068 */
    T(i,j) = a(i) + a(j);
    for(i=0, 13, for(j=0, i, print1(T(i - j, j),", "););print();); \\ Indranil Ghosh, Mar 23 2017
    
  • Python
    # Produces the triangle when the array is read by antidiagonals
    def A006068(n):
        return n if n<2 else 2*A006068(n//2) + (n%2 + A006068(n//2)%2)%2
    def T(i,j): return A006068(i) + A006068(j)
    for i in range(14):
        print([T(i - j, j) for j in range(i + 1)]) # Indranil Ghosh, Mar 23 2017
  • Scheme
    (define (A268714 n) (A268714bi (A002262 n) (A025581 n)))
    (define (A268714bi row col) (+ (A006068 row) (A006068 col)))
    

Formula

A(i,j) = A006068(i) + A006068(j).
A(i,j) = A006068(A268715(i,j)). - Corrected Mar 23 2017

A268724 Square array A(i,j) = A006068(i) * A006068(j), read by antidiagonals as A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), ...

Original entry on oeis.org

1, 3, 3, 2, 9, 2, 7, 6, 6, 7, 6, 21, 4, 21, 6, 4, 18, 14, 14, 18, 4, 5, 12, 12, 49, 12, 12, 5, 15, 15, 8, 42, 42, 8, 15, 15, 14, 45, 10, 28, 36, 28, 10, 45, 14, 12, 42, 30, 35, 24, 24, 35, 30, 42, 12, 13, 36, 28, 105, 30, 16, 30, 105, 28, 36, 13, 8, 39, 24, 98, 90, 20, 20, 90, 98, 24, 39, 8, 9, 24, 26, 84, 84, 60, 25, 60, 84, 84, 26, 24, 9
Offset: 1

Views

Author

Antti Karttunen, Feb 13 2016

Keywords

Examples

			The top left [1 .. 15] x [1 .. 15] section of the array:
   1,  3,  2,  7,   6,  4,  5,  15,  14,  12,  13,   8,   9,  11,  10
   3,  9,  6,  21, 18, 12, 15,  45,  42,  36,  39,  24,  27,  33,  30
   2,  6,  4,  14, 12,  8, 10,  30,  28,  24,  26,  16,  18,  22,  20
   7, 21, 14,  49, 42, 28, 35, 105,  98,  84,  91,  56,  63,  77,  70
   6, 18, 12,  42, 36, 24, 30,  90,  84,  72,  78,  48,  54,  66,  60
   4, 12,  8,  28, 24, 16, 20,  60,  56,  48,  52,  32,  36,  44,  40
   5, 15, 10,  35, 30, 20, 25,  75,  70,  60,  65,  40,  45,  55,  50
  15, 45, 30, 105, 90, 60, 75, 225, 210, 180, 195, 120, 135, 165, 150
  14, 42, 28,  98, 84, 56, 70, 210, 196, 168, 182, 112, 126, 154, 140
  12, 36, 24,  84, 72, 48, 60, 180, 168, 144, 156,  96, 108, 132, 120
  13, 39, 26,  91, 78, 52, 65, 195, 182, 156, 169, 104, 117, 143, 130
   8, 24, 16,  56, 48, 32, 40, 120, 112,  96, 104,  64,  72,  88,  80
   9, 27, 18,  63, 54, 36, 45, 135, 126, 108, 117,  72,  81,  99,  90
  11, 33, 22,  77, 66, 44, 55, 165, 154, 132, 143,  88,  99, 121, 110
  10, 30, 20,  70, 60, 40, 50, 150, 140, 120, 130,  80,  90, 110, 100
		

Crossrefs

Cf. A268725.
Cf. A006068 (row 1, column 1).
Cf. A268716 (row 3, column 3).
Cf. A268721 (the antidiagonal sums).
Cf. also A268714.

Programs

Formula

A(i,j) = A006068(i) * A006068(j)
A(i,j) = A006068(A268725(i,j)).

A277808 a(n) = number of iterations of map k -> A003188(A006068(k)/2) that are required (when starting from k = n) until k is an odious number.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Nov 03 2016

Keywords

Crossrefs

One less than A277822.
A left inverse of A003945.
Cf. A277812 (gives the odious number where such an iteration is finished at when starting from k=n).

Formula

a(n) = A010059(n) * A001511(n).
If A010060(n) = 1 [when n is one of the odious numbers, A000069], then a(n) = 0, otherwise a(n) = 1 + a(A003188(A006068(n)/2)).
Other identities:
For all n >= 0, a(A003945(n)) = n.

A302029 Inverse permutation of A207901: a(n) = A006068(A052331(n)).

Original entry on oeis.org

0, 1, 3, 7, 15, 2, 31, 6, 63, 14, 127, 4, 255, 30, 12, 511, 1023, 62, 2047, 8, 28, 126, 4095, 5, 8191, 254, 60, 24, 16383, 13, 32767, 510, 124, 1022, 16, 56, 65535, 2046, 252, 9, 131071, 29, 262143, 120, 48, 4094, 524287, 508, 1048575, 8190, 1020, 248, 2097151, 61, 112, 25, 2044, 16382, 4194303, 11, 8388607, 32766, 32
Offset: 1

Views

Author

Antti Karttunen, Apr 13 2018

Keywords

Crossrefs

Inverse of A207901.
One less than A302030.

Programs

  • PARI
    up_to = 4096;
    v050376 = vector(up_to);
    ispow2(n) = (n && !bitand(n,n-1));
    i = 0; for(n=1,oo,if(ispow2(isprimepower(n)), i++; v050376[i] = n); if(i == up_to,break));
    A052331(n) = { my(s=0,e); while(n > 1, fordiv(n, d, if(((n/d)>1)&&ispow2(isprimepower(n/d)), e = vecsearch(v050376, n/d); if(!e, print("v050376 too short!"); return(1/0)); s += 2^(e-1); n = d; break))); (s); };
    A006068(n)= { my(s=1, ns); while(1, ns = n >> s; if(0==ns, break()); n = bitxor(n, ns); s <<= 1; ); return (n); } \\ From A006068
    A302029(n) = A006068(A052331(n));

Formula

a(n) = A006068(A052331(n)).

A302843 Permutation of nonnegative integers: a(n) = A163355(A006068(n)).

Original entry on oeis.org

0, 1, 2, 3, 12, 13, 14, 15, 10, 9, 8, 11, 4, 7, 6, 5, 26, 27, 24, 25, 30, 29, 28, 31, 16, 19, 18, 17, 22, 23, 20, 21, 42, 43, 40, 41, 46, 45, 44, 47, 32, 35, 34, 33, 38, 39, 36, 37, 58, 57, 56, 59, 52, 55, 54, 53, 48, 49, 50, 51, 60, 61, 62, 63, 192, 193, 194, 195, 204, 205, 206, 207, 202, 201, 200, 203, 196, 199, 198, 197, 218, 219, 216, 217, 222
Offset: 0

Views

Author

Antti Karttunen, Apr 14 2018

Keywords

Crossrefs

Cf. A302844 (inverse).

Programs

  • PARI
    A006068(n)= { my(s=1, ns); while(1, ns = n >> s; if(0==ns, break()); n = bitxor(n, ns); s <<= 1; ); return (n); } \\ From A006068
    A057300(n) = { my(t=1, s=0); while(n>0,  if(1==(n%4),n++,if(2==(n%4),n--)); s += (n%4)*t; n >>= 2; t <<= 2); (s); };
    A163355(n) = if(!n,n,my(i = (#binary(n)-1)\2, f = 4^i, d = (n\f)%4, r = (n%f)); if(((1==d)&&!(i%2))||((2==d)&&(i%2)), f+A163355(A057300(r)), if(3==d,f+f+A163355(A057300(r)), (3*f)+A163355(f-1-r))));
    A302843(n) = A163355(A006068(n));

Formula

a(n) = A163355(A006068(n)).
a(n) = A302845(A003188(n)).

A245452 Self-inverse permutation of nonnegative integers, A075158-conjugate of the inverse of gray code: a(n) = 1 + A075157(A006068(A075158(n-1))).

Original entry on oeis.org

1, 2, 4, 3, 9, 8, 18, 5, 6, 25, 75, 16, 150, 36, 27, 7, 735, 12, 1470, 49, 50, 245, 12705, 32, 15, 300, 10, 72, 25410, 125, 195195, 11, 225, 4235, 54, 24, 390390, 2940, 490, 121, 4339335, 100, 8678670, 847, 81, 65065, 92147055, 64, 30, 35, 2205, 600, 184294110, 20, 147, 144, 8470, 50820, 2565568005, 343, 5131136010, 1446445, 98, 13
Offset: 1

Views

Author

Antti Karttunen, Jul 22 2014

Keywords

Crossrefs

Inverse: A245451.
Similar permutations: A245454, A122111, A241909, A241916.

Programs

Formula

a(n) = 1 + A075157(A006068(A075158(n-1))).
Previous Showing 11-20 of 155 results. Next