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

A165199 a(n) is obtained by flipping every second bit in the binary representation of n starting at the second-most significant bit and on downwards.

Original entry on oeis.org

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

Views

Author

Leroy Quet, Sep 07 2009

Keywords

Comments

This is a self-inverse permutation of the positive integers.
Old name was: a(0) = 0, and for n>=1, let b(n,m) be the m-th digit, reading left to right, of binary n. (b(n, 1) is the most significant binary digit, which is 1.) Then a(n) is such that b(a(n),1)=1; and if b(n,m)=b(n,m-1) then b(a(n),m) does not = b(a(n),m-1); and if b(n,m) does not = b(n,m-1) then b(a(n), m) = b(a(n),m-1), for all m where 2 <= m <= number binary digits in n.
From Emeric Deutsch, Oct 06 2020: (Start)
a(n) is the index of the composition that is the conjugate of the composition with index n.
The index of a composition is defined to be the positive integer whose binary form has run-lengths (i.e., runs of 1's, runs of 0's, etc. from left to right) equal to the parts of the composition. Example: the composition 1,1,3,1 has index 46 since the binary form of 46 is 101110.
a(18) = 24. Indeed, since the binary form of 18 is 10010, the composition with index 18 is 1,2,1,1 (the run-lengths of 10010); the conjugate of 1,2,1,1 is 2,3 and so the binary form of a(18) is 11000; consequently, a(18) = 24. (End)

Examples

			a(12) = 9 because 12 = 1100_2 and 1100_2 XOR 0101_2 = 1001_2 = 9.
		

Crossrefs

Programs

  • Maple
    a:= n-> Bits[Xor](n, iquo(2^(1+ilog2(n)), 3)):
    seq(a(n), n=0..100);  # Alois P. Heinz, Oct 07 2020
  • PARI
    for(k=0,67,my(b(n)=vector(#digits(n,2),i,!(i%2)));print1(bitxor(k,fromdigits(b(k),2)),", ")) \\ Hugo Pfoertner, Oct 07 2020
    
  • PARI
    a(n) = if(n, bitxor(n,2<Kevin Ryde, Oct 07 2020
  • R
    maxrow <- 8 # by choice
    a <- 1
    for(m in 0: maxrow) for(k in 0:(2^m-1)){
    a[2^(m+1) +       k] = a[2^(m+1) - 1 - k] + 2^(m+1)
    a[2^(m+1) + 2^m + k] = a[2^(m+1) - 1 - k] + 2^m
    }
    (a <- c(0, a))
    # Yosu Yurramendi, Apr 04 2017
    

Formula

From Antti Karttunen, Jul 22 2014: (Start)
a(0) = 0, and for n >= 1, a(n) = 2*a(floor(n/2)) + A000035(n+A000523(n)).
As a composition of related permutations:
a(n) = A056539(A129594(n)) = A129594(A056539(n)).
a(n) = A245443(A193231(n)) = A193231(A245444(n)).
a(n) = A075158(A243353(n)-1) = A075158((A241909(1+A075157(n))) - 1).
(End)
a(n) = A258746(A054429(n)) = A054429(A258746(n)), n > 0. - Yosu Yurramendi, Mar 29 2017

Extensions

Extended by Ray Chandler, Sep 10 2009
a(0) = 0 prepended by Antti Karttunen, Jul 22 2014
New name from Kevin Ryde, Oct 07 2020

A278220 Filtering sequence (related to prime factorization): a(n) = A046523(A241909(n)).

Original entry on oeis.org

1, 2, 4, 2, 8, 4, 16, 2, 6, 8, 32, 4, 64, 16, 12, 2, 128, 6, 256, 8, 24, 32, 512, 4, 12, 64, 6, 16, 1024, 12, 2048, 2, 48, 128, 36, 6, 4096, 256, 96, 8, 8192, 24, 16384, 32, 12, 512, 32768, 4, 24, 12, 192, 64, 65536, 6, 72, 16, 384, 1024, 131072, 12, 262144, 2048, 24, 2, 144, 48, 524288, 128, 768, 36, 1048576, 6, 2097152, 4096, 30, 256, 72, 96, 4194304, 8, 6, 8192
Offset: 1

Views

Author

Antti Karttunen, Nov 16 2016

Keywords

Crossrefs

Programs

Formula

a(n) = A046523(A241909(n)).
a(n) = A278219(A075158(n-1)).

A243504 Product of parts of integer partitions as ordered by the table A241918: a(n) = Product_{i=A203623(n-1)+2..A203623(n)+1} A241918(i).

Original entry on oeis.org

1, 1, 1, 2, 1, 4, 1, 3, 2, 8, 1, 9, 1, 16, 4, 4, 1, 6, 1, 27, 8, 32, 1, 16, 2, 64, 3, 81, 1, 18, 1, 5, 16, 128, 4, 12, 1, 256, 32, 64, 1, 54, 1, 243, 9, 512, 1, 25, 2, 12, 64, 729, 1, 8, 8, 256, 128, 1024, 1, 48, 1, 2048, 27, 6, 16, 162, 1, 2187, 256, 36, 1, 20, 1, 4096
Offset: 1

Views

Author

Antti Karttunen, Jun 05 2014

Keywords

Crossrefs

The positions of ones after a(1)=1 is given by A000040 (primes).
Cf. A243503 (the sum of parts), A241918, A227184, A075158, A003963, A241909.

Formula

a(n) = Product_{i=A203623(n-1)+2..A203623(n)+1} A241918(i).
a(n) = A003963(A241909(n)).
a(n) = A227184(A075158(n-1)).
a(A000040(n)) = 1 for all n.
a(A000079(n)) = n for all n.

A120249 Numerator of cfenc[n] (see definition in comments).

Original entry on oeis.org

1, 2, 3, 3, 5, 5, 8, 4, 4, 8, 13, 7, 21, 13, 7, 5, 34, 7, 55, 11, 11, 21, 89, 9, 7, 34, 5, 18, 144, 12, 233, 6, 18, 55, 12, 10, 377, 89, 29, 14, 610, 19, 987, 29, 9, 144, 1597, 11, 11, 11, 47, 47, 2584, 9, 19, 23, 76, 233, 4181, 17, 6765, 377, 14, 7, 31, 31, 10946, 76, 123, 19
Offset: 1

Views

Author

Joseph Biberstine (jrbibers(AT)indiana.edu), Jun 12 2006, Jun 25 2006

Keywords

Comments

a[n] := numerator of cfenc[n]. cfenc[n] := number given by interpreting as a continued fraction expansion (indexed from 1) the sequence whose i-th entry is one plus the exponent on the i-th prime factor of n (fix cfenc[1]=1). a[2^k] = cfenc[2^k] = k+1.

Examples

			a(2646) = numerator[cfenc[2646]]= numerator[cfenc[2^1 * 3^3 * 7^2]] = numerator[FromContinuedFraction[{2; 4, 1, 3}]] = numerator[2 + 1/(4 + 1/(1 + 1/3))] = numerator[42/19] = 42.
From _Antti Karttunen_, Oct 29 2019: (Start)
a(6) = 3 because 6 = 2^1 * 3^1, and the numerator of the continued fraction 1+1 + 1/(1+1) = 5/2 is 5.
a(12) = 7 because 12 = 2^2 * 3^1, and the numerator of the continued fraction 2+1 + 1/(1+1) = 7/2 is 7.
a(15) = 7 because 15 = 2^0 * 3^1 * 5^1, and the numerator of the continued fraction 0+1 + 1/(1+1 + 1/(1+1)) = 1 + 1/(2 + 1/2) = 1 + 2/5 = 7/5 is 7.
(End)
		

Crossrefs

Corresponding denominators in A120250. Numerators modulo respective denominators in A120251.

Programs

  • Mathematica
    Table[If[n == 1, 1, (fl = FactorInteger[n]; pq = Table[1, {i, 1, PrimePi[Last[fl][[1]]]}]; While[Length[fl] > 0, pp = First[fl]; fl = Drop[fl, 1]; pq[[PrimePi[pp[[1]]]]] = pp[[2]] + 1;]; Numerator[FromContinuedFraction[pq]])],{n,1,80}]
  • PARI
    A120249(n) = if(1==n,n, my(pi=primepi(vecmax(factor(n)[, 1])), cf=1+valuation(n,prime(pi))); pi--; while(pi, cf = (1+valuation(n,prime(pi)))+(1/cf); pi--); numerator(cf)); \\ Antti Karttunen, Oct 26 2019

Formula

a(2^k) = k+1.
a(A000040(n)) = A000045(n+2).
From Antti Karttunen, Oct 29 2019: (Start)
The following formula employs Gauss's notation for continued fractions (see the section "Notations" in the Wikipedia-article), for example, K_{i=1..3} u(i) stands for 1/(u(1) + 1/(u(2) + 1/u(3))):
Let c(n) = A001511(n) + K_{i=2..A061395(n)} 1/(1+A286561(n,A000040(i))). Then a(n) is the numerator of c(n), and A120250(n) is the denominator of c(n).
For all n >= 2, a(2n) = a(A003961(n)), thus a(n) = f(A323080(n)) for some function f.
(End)

A129600 Array A(i,j) of binary run-length encoded product of i and j, read by ascending antidiagonals.

Original entry on oeis.org

0, 1, 1, 2, 3, 2, 3, 4, 4, 3, 4, 7, 6, 7, 4, 5, 8, 8, 8, 8, 5, 6, 11, 12, 15, 12, 11, 6, 7, 12, 9, 16, 16, 9, 12, 7, 8, 15, 14, 23, 24, 23, 14, 15, 8, 9, 16, 16, 24, 19, 19, 24, 16, 16, 9, 10, 19, 24, 31, 28, 13, 28, 31, 24, 19, 10, 11, 20, 17, 32, 32, 17, 17, 32, 32, 17, 20, 11, 12
Offset: 0

Views

Author

Antti Karttunen, May 01 2007

Keywords

Crossrefs

Cf. A129602 (center diagonal), A014601 (row 1 apart from the first term).

Formula

A(i,j) = A075158(((A075157(i)+1)*(A075157(j)+1)) - 1).

Extensions

Name edited by Michel Marcus, Dec 01 2021

A075160 Prime factorization of n encoded with the run lengths of binary expansion + 1.

Original entry on oeis.org

1, 2, 3, 4, 6, 5, 11, 8, 7, 12, 22, 9, 43, 21, 10, 16, 86, 13, 171, 24, 23, 44, 342, 17, 14, 85, 15, 41, 683, 20, 1366, 32, 42, 172, 19, 25, 2731, 341, 87, 48, 5462, 45, 10923, 88, 18, 684, 21846, 33, 27, 28, 170, 169, 43691, 29, 46, 81, 343, 1365, 87382, 40, 174763
Offset: 1

Views

Author

Antti Karttunen, Sep 13 2002

Keywords

Comments

See the comment at A075158.

Examples

			a(9) = 7 = 1+6 (1 + 110) as 9 = 3^2 * 2^(1-1). (The run lengths of 6, 110 in binary are 2 and 1).
		

Crossrefs

Inverse of A075159. a(n) = A075158(n-1)+1.
Previous Showing 11-16 of 16 results.