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 41-50 of 68 results. Next

A280506 Nonpalindromic part of n in base 2 (with carryless GF(2)[X] factorization): a(n) = A280500(n,A280505(n)).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 11, 1, 13, 1, 1, 1, 1, 1, 19, 1, 1, 11, 13, 1, 25, 13, 1, 1, 11, 1, 1, 1, 1, 1, 13, 1, 37, 19, 11, 1, 41, 1, 25, 11, 1, 13, 47, 1, 11, 25, 1, 13, 19, 1, 55, 1, 13, 11, 59, 1, 61, 1, 1, 1, 1, 1, 67, 1, 69, 13, 61, 1, 1, 37, 13, 19, 59, 11, 25, 1, 81, 41, 11, 1, 1, 25, 87, 11, 55, 1, 91, 13, 1, 47, 19, 1, 97, 11, 1, 25, 13, 1, 103
Offset: 1

Views

Author

Antti Karttunen, Jan 09 2017

Keywords

Comments

a(n) = number obtained when the maximal base-2 palindromic divisor of n, A280505(n), is divided out of n with carryless GF(2)[X] factorization (see examples of A280500 for the explanation).
Apart from 1, all terms are present in A164861 (form their proper subset).

Crossrefs

Programs

Formula

a(n) = A280500(n,A280505(n)).
Other identities. For all n >= 1:
a(2n) = a(A000265(n)) = a(n).
A048720(a(n), A280505(n)) = n.

Extensions

Erroneous claim removed from comments by Antti Karttunen, May 13 2018

A122155 Simple involution of natural numbers: List each block of (2^k)-1 numbers (from (2^k)+1 to 2^(k+1) - 1) in reverse order and fix the powers of 2.

Original entry on oeis.org

0, 1, 2, 3, 4, 7, 6, 5, 8, 15, 14, 13, 12, 11, 10, 9, 16, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 32, 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, 64, 127, 126, 125, 124, 123
Offset: 0

Views

Author

Antti Karttunen, Aug 25 2006

Keywords

Comments

From Kevin Ryde, Dec 29 2020: (Start)
a(n) is n with an 0<->1 complement applied to each bit between, but not including, the most significant and least significant 1-bits. Dijkstra uses this form and calls the complemented bits the "internal" digits.
The fixed points a(n)=n are n=0 and n=A029744. These are n=2^k by construction, and the middle of each reversed block is n=3*2^k. In terms of bit complement, these n have nothing between their highest and lowest 1-bits.
(End)

Examples

			From _Kevin Ryde_, Dec 29 2020: (Start)
  n    = 4, 5, 6, 7, 8
  a(n) = 4, 7, 6, 5, 8  between powers of 2
             <----      block reverse
Or a single term by bits,
  n    = 236 = binary 11101100
  a(n) = 148 = binary 10010100  complement between
                       ^^^^     high and low 1's
(End)
		

Crossrefs

Cf. A029744 (fixed points), A334045 (complement high/low 1's too), A057889 (bit reversal).

Programs

  • Mathematica
    Array[(1 + Boole[#1 - #2 != 0]) #2 - #1 + #2 & @@ {#, 2^(IntegerLength[#, 2] - 1)} &, 69] (* Michael De Vlieger, Jan 01 2023 *)
  • PARI
    a(n) = bitxor(n,if(n,max(0, 1<Kevin Ryde, Dec 29 2020
    
  • Python
    def A122155(n): return int(('1'if (m:=len(s:=bin(n)[2:])-(n&-n).bit_length())>0 else '')+''.join(str(int(d)^1) for d in s[1:m])+s[m:],2) if n else 0 # Chai Wah Wu, May 19 2023
    
  • Python
    def A122155(n): return n^((1<Chai Wah Wu, Mar 10 2025
  • R
    maxblock <- 5 # by choice
    a <- 1
    for(m in 1:maxblock){
                          a[2^m    ] <- 2^m
      for(k in 1:(2^m-1)) a[2^m + k] <- 2^(m+1) - k
    }
    (a <- c(0,a))
    # Yosu Yurramendi, Mar 18 2021
    
  • Scheme
    (define (A122155 n) (cond ((< n 1) n) ((pow2? n) n) (else (- (* 2 (A053644 n)) (A053645 n)))))
    (define (pow2? n) (and (> n 0) (zero? (A004198bi n (- n 1)))))
    

Formula

a(0) = 0; if n=2^k, a(n) = n; if n=2^k + i (with i > 0 and i < 2^k) a(n) = 2^(k+1) - i = 2*A053644(n) - A053645(n).
A002487(a(n)) = A002487(n), n >= 0 [Dijkstra]. - Yosu Yurramendi, Mar 18 2021

A264979 Bijective base-9 reverse: a(0) = 0; for n >= 1, a(n) = A030108(n/A264981(n)) * A264981(n).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 07 2015

Keywords

Comments

Self-inverse permutation of nonnegative integers.
It appears that a(m x) == 0 (mod m) for m = 2^k and m = 5*2^k, k >= 0, but not for other m. Is there a simple explanation? - M. F. Hasler, May 21 2021

Crossrefs

Cf. A265338 (a(8n)/8).
Cf. A057889 (base-2), A263273 (base-3), A264994 (base-4), A264995 (base-5).

Programs

Formula

a(0) = 0; for n >= 1, a(n) = A030108(n/A264981(n)) * A264981(n).

A264994 Bijective base-4 reverse: a(0) = 0; for n >= 1, a(n) = A030103(A065883(n)) * A234957(n).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 9, 13, 8, 6, 10, 14, 12, 7, 11, 15, 16, 17, 33, 49, 20, 21, 37, 53, 36, 25, 41, 57, 52, 29, 45, 61, 32, 18, 34, 50, 24, 22, 38, 54, 40, 26, 42, 58, 56, 30, 46, 62, 48, 19, 35, 51, 28, 23, 39, 55, 44, 27, 43, 59, 60, 31, 47, 63, 64, 65, 129, 193, 68, 81, 145, 209, 132, 97, 161, 225, 196, 113, 177, 241, 80, 69
Offset: 0

Views

Author

Antti Karttunen, Dec 07 2015

Keywords

Comments

Self-inverse permutation of nonnegative integers.

Crossrefs

Cf. A264993 (a(3n)/3), A265335 (a(5n)/5).
Cf. also A057889 (base-2), A263273 (base-3), A264995 (base-5), A264979 (base-9).

Programs

Formula

a(0) = 0; for n >= 1, a(n) = A030103(A065883(n)) * A234957(n).
Other identities. For all n >= 0:
a(4*n) = 4*a(n).

A266641 Permutation of nonnegative integers: a(n) = A264965(2*n) / 2.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 11, 8, 9, 10, 13, 12, 7, 14, 15, 32, 23, 18, 35, 20, 33, 26, 19, 24, 29, 38, 27, 28, 17, 30, 37, 16, 21, 34, 113, 36, 41, 50, 87, 40, 31, 42, 77, 104, 45, 110, 101, 96, 25, 22, 69, 68, 95, 54, 47, 56, 39, 86, 83, 60, 59, 74, 99, 92, 65, 114, 97, 44, 81, 70, 49, 72, 89, 82, 75, 88, 73, 66, 121, 80, 51
Offset: 0

Views

Author

Antti Karttunen, Jan 04 2016

Keywords

Crossrefs

Formula

a(n) = A264965(2*n) / 2.
As a composition of related permutations:
a(n) = A263272(A057889(n)).

A266642 Permutation of nonnegative integers: a(n) = A264966(2*n) / 2.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 13, 8, 9, 10, 7, 12, 11, 14, 15, 32, 29, 18, 23, 20, 33, 50, 17, 24, 49, 22, 27, 28, 25, 30, 41, 16, 21, 34, 19, 36, 31, 26, 57, 40, 37, 42, 125, 68, 45, 106, 55, 96, 71, 38, 81, 88, 89, 54, 101, 56, 117, 118, 61, 60, 83, 82, 99, 116, 65, 78, 119, 52, 51, 70, 113, 72, 77, 62, 75, 92, 43, 114, 107, 80, 69
Offset: 0

Views

Author

Antti Karttunen, Jan 04 2016

Keywords

Crossrefs

Programs

Formula

a(n) = A264966(2*n) / 2.
As a composition of related permutations:
a(n) = A057889(A263272(n)).

A293448 Self-inverse permutation of natural numbers: replace (with multiplicity) each prime factor A000040(k) with A000040(min+(max-k)) in the prime factorization of n, where min = A055396(n) and max = A061395(n).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 18, 13, 14, 15, 16, 17, 12, 19, 50, 21, 22, 23, 54, 25, 26, 27, 98, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 250, 41, 70, 43, 242, 75, 46, 47, 162, 49, 20, 51, 338, 53, 24, 55, 686, 57, 58, 59, 150, 61, 62, 147, 64, 65, 154, 67, 578, 69, 42, 71, 108, 73, 74, 45, 722, 77, 286, 79, 1250, 81, 82, 83
Offset: 1

Views

Author

Antti Karttunen, Nov 09 2017

Keywords

Comments

Reverse the prime-indices in such a way that the smallest and the greatest prime dividing n (A020639 and A006530) are preserved.
a(n) = n iff n belongs to A236510. - Rémy Sigrist, Nov 22 2017

Examples

			For n = 25 = 5^2 = prime(3)^2, thus min = max = 3, and we form a product prime(3+(3-3))^2, thus a(25) = prime(3)^2 = 25.
For n = 42 = 2*3*7 = prime(1)*prime(2)*prime(4), thus min = 1 and max = 4, so we form a product prime(1+(4-1))*prime(1+(4-2))*prime(1+(4-4)), thus a(42) = prime(4)*prime(3)*prime(1) = 7*5*2 = 70.
For n = 126 = 2 * 3^2 * 7 = prime(1) * prime(2)^2 * prime(4), thus min = 1 and max = 4, so we form a product prime(1+(4-1)) * prime(1+(4-2))^2 * prime(1+(4-4)), thus a(126) = prime(4) * prime(3)^2 * prime(1) = 7 * 5^2 * 2 = 350.
		

Crossrefs

Cf. A000720, A055396, A057889, A061395, A236510 (fixed points), A273258.
Differs from A069799 (and some other related permutations) for the first time at n=42.

Programs

  • PARI
    A293448(n) = { if(1==n,return(n)); my(f=factor(n), mini = primepi(f[1, 1]), maxi = primepi(f[#f~, 1])); for(i=1,#f~,f[i,1] = prime((maxi-primepi(f[i,1]))+mini)); factorback(f); }

Formula

For all even squarefree numbers coincides with A273258, that is, for all n, a(A039956(n)) = A273258(A039956(n)).

A332450 Self-inverse permutation of natural numbers, "Blue code" conjugated by A156552 and its inverse: a(n) = A005940(1+A193231(A156552(n))).

Original entry on oeis.org

1, 2, 4, 3, 6, 5, 16, 8, 9, 27, 14, 18, 100, 11, 25, 7, 210, 12, 256, 20, 21, 147, 38, 45, 15, 385, 10, 98, 1156, 30, 1938, 50, 121, 2187, 35, 125, 234256, 23, 315, 245, 6902, 72, 3496900, 120, 24, 1083, 9699690, 108, 81, 32, 15625, 1458, 65536, 75, 225, 231, 57, 2185, 106, 243, 8836, 771147, 150, 105, 143, 154, 14946, 68, 529, 162
Offset: 1

Views

Author

Antti Karttunen, Feb 15 2020

Keywords

Crossrefs

Cf. A293448 (A057889 similarly conjugated).

Programs

  • PARI
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t }; \\ From A005940
    A156552(n) = {my(f = factor(n), p2 = 1, res = 0); for(i = 1, #f~, p = 1 << (primepi(f[i, 1]) - 1); res += (p * p2 * (2^(f[i, 2]) - 1)); p2 <<= f[i, 2]); res}; \\ From A156552
    A193231(n) = { my(x='x); subst(lift(Mod(1, 2)*subst(Pol(binary(n), x), x, 1+x)), x, 2) }; \\ From A193231
    A332450(n) = A005940(1+A193231(A156552(n)));

Formula

a(n) = A005940(1+A193231(A156552(n))).
a(A003961(n)) = A332451(a(n)); a(A332451(n)) = A003961(a(n)).
a(n) = A366263(A156552(n)). - Antti Karttunen, Oct 06 2023

A366282 a(n) = A366275(n) - n, where A366275 is the Cat's tongue permutation.

Original entry on oeis.org

1, 1, 2, 0, 4, 4, 0, -2, 8, 18, 8, 4, 0, 12, -4, -8, 16, 64, 36, 26, 16, 54, 8, -2, 0, 100, 24, 8, -8, 20, -16, -20, 32, 210, 128, 100, 72, 188, 52, 24, 32, 334, 108, 62, 16, 102, -4, -14, 0, 576, 200, 124, 48, 192, 16, 0, -16, 286, 40, 18, -32, 60, -40, -50, 64, 664, 420, 338, 256, 606, 200, 118, 144, 1052, 376
Offset: 0

Views

Author

Antti Karttunen, Oct 07 2023

Keywords

Crossrefs

Cf. A057889, A163511, A366275, A366277 (positions of 0's), A366283.
Cf. also A364258.

Programs

A161903 Convert n into a sequence of binary digits, apply one step of the rule 110 cellular automaton, and interpret the results as a binary integer.

Original entry on oeis.org

0, 3, 6, 7, 12, 15, 14, 13, 24, 27, 30, 31, 28, 31, 26, 25, 48, 51, 54, 55, 60, 63, 62, 61, 56, 59, 62, 63, 52, 55, 50, 49, 96, 99, 102, 103, 108, 111, 110, 109, 120, 123, 126, 127, 124, 127, 122, 121, 112, 115, 118, 119, 124, 127, 126, 125, 104, 107, 110, 111, 100, 103, 98, 97, 192, 195, 198, 199, 204, 207, 206, 205, 216, 219, 222, 223, 220, 223, 218, 217, 240, 243, 246, 247, 252, 255, 254, 253, 248, 251, 254, 255, 244, 247, 242, 241, 224, 227, 230, 231, 236
Offset: 0

Views

Author

Ben Branman, Jan 30 2011

Keywords

Comments

a(a(a(...1))) (n times) gives A006978(n)

Examples

			For n=19, the evolution after one step is
0, 1, 0, 0, 1, 1  (n=19)
1, 1, 0, 1, 1, 1  (a(n)=55)
So a(n)=55.
		

Crossrefs

Programs

  • Mathematica
    a[n_] :=
    FromDigits[
      Drop[Part[CellularAutomaton[110, {IntegerDigits[n, 2], 0}], 1], -1],
       2];Table[a[n],{n,0,100}]

Formula

a(n) = A057889(A269174(A057889(n))). - Antti Karttunen, Jun 02 2018
Previous Showing 41-50 of 68 results. Next