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

A245710 Number of nonzero evil numbers <= n, see A001969.

Original entry on oeis.org

0, 0, 0, 1, 1, 2, 3, 3, 3, 4, 5, 5, 6, 6, 6, 7, 7, 8, 9, 9, 10, 10, 10, 11, 12, 12, 12, 13, 13, 14, 15, 15, 15, 16, 17, 17, 18, 18, 18, 19, 20, 20, 20, 21, 21, 22, 23, 23, 24, 24, 24, 25, 25, 26, 27, 27, 27, 28, 29, 29, 30, 30, 30, 31, 31, 32, 33, 33, 34, 34, 34, 35, 36
Offset: 0

Views

Author

Antti Karttunen, Aug 18 2014

Keywords

Crossrefs

One less than A159481.

Programs

  • Mathematica
    Join[{0},Accumulate[Table[If[EvenQ[DigitCount[n,2,1]],1,0],{n,80}]]] (* Harvey P. Dale, Aug 01 2021 *)
  • Python
    def A245710(n): return (n+1>>1)-((n+1).bit_count()&1&(n+1)^1) # Chai Wah Wu, Mar 01 2023

Formula

a(0) = 0, and for n >= 1, a(n) = A010059(n) + a(n-1). [Partial sums of A010059, after ignoring the first one at zero].
a(n) = n - A115384(n).
a(n) = A159481(n)-1.

A246202 Permutation of natural numbers: a(1) = 1, a(2n) = A091242(a(n)), a(2n+1) = A014580(a(n)), where A091242(n) = binary code for n-th reducible polynomial over GF(2) and A014580(n) = binary code for n-th irreducible polynomial over GF(2).

Original entry on oeis.org

1, 4, 2, 8, 11, 5, 3, 14, 31, 17, 47, 9, 13, 6, 7, 21, 61, 42, 185, 24, 87, 62, 319, 15, 37, 20, 59, 10, 19, 12, 25, 29, 109, 78, 425, 54, 283, 222, 1627, 33, 131, 108, 647, 79, 433, 373, 3053, 22, 67, 49, 229, 28, 103, 76, 415, 16, 41, 27, 97, 18, 55, 34, 137, 39, 167, 134, 859, 98, 563, 494, 4225, 70, 375, 331, 2705, 264, 2011, 1832, 19891, 44
Offset: 1

Views

Author

Antti Karttunen, Aug 19 2014

Keywords

Comments

This sequence can be represented as a binary tree. Each left hand child is produced as A091242(n), and each right hand child as A014580(n), when the parent contains n:
|
...................1...................
4 2
8......../ \.......11 5......../ \........3
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
14 31 17 47 9 13 6 7
21 61 42 185 24 87 62 319 15 37 20 59 10 19 12 25
etc.
Because 2 is the only even term in A014580, it implies that, apart from a(3)=2, all other odd positions contain an odd number. There are also odd numbers in the even bisection, precisely all the terms of A246156 in some order, together with all even numbers larger than 2 that are also there. See also comments in A246201.

Crossrefs

Inverse: A246201.
Similar or related permutations: A245702, A246162, A246164, A246204, A237126, A003188, A054429, A193231, A260422, A260426.

Programs

  • PARI
    allocatemem((2^31)+(2^30));
    uplim = (2^25) + (2^24);
    v014580 = vector(2^24);
    v091242 = vector(uplim);
    isA014580(n)=polisirreducible(Pol(binary(n))*Mod(1, 2)); \\ This function from Charles R Greathouse IV
    i=0; j=0; n=2; while((n < uplim), if(isA014580(n), i++; v014580[i] = n, j++; v091242[j] = n); n++)
    A246202(n) = if(1==n, 1, if(0==(n%2), v091242[A246202(n/2)], v014580[A246202((n-1)/2)]));
    for(n=1, 638, write("b246202.txt", n, " ", A246202(n)));
    \\ Works with PARI Version 2.7.4. - Antti Karttunen, Jul 25 2015
    (Scheme, with memoization-macro definec)
    (definec (A246202 n) (cond ((< n 2) n) ((odd? n) (A014580 (A246202 (/ (- n 1) 2)))) (else (A091242 (A246202 (/ n 2))))))

Formula

a(1) = 1, a(2n) = A091242(a(n)), a(2n+1) = A014580(a(n)).
As a composition of related permutations:
a(n) = A245702(A054429(n)).
a(n) = A246162(A003188(n)).
a(n) = A193231(A246204(n)).
a(n) = A246164(A193231(n)).
a(n) = A260426(A260422(n)).
Other identities:
For all n > 1, A091225(a(n)) = A000035(n). [After 1, maps even numbers to binary representations of reducible GF(2) polynomials and odd numbers to the corresponding representations of irreducible polynomials, in some order. A246204 has the same property].

A246158 Odious reducible polynomials over GF(2), coded in binary. (Polynomials with an odd number of nonzero terms that are reducible over GF(2)).

Original entry on oeis.org

4, 8, 14, 16, 21, 22, 26, 28, 32, 35, 38, 42, 44, 49, 50, 52, 56, 62, 64, 69, 70, 74, 76, 79, 81, 82, 84, 88, 93, 94, 98, 100, 104, 107, 110, 112, 118, 121, 122, 124, 127, 128, 133, 134, 138, 140, 146, 148, 151, 152, 155, 158, 161, 162, 164, 168, 173, 174, 176, 179, 181, 182, 186, 188, 194, 196, 199, 200
Offset: 1

Views

Author

Antti Karttunen, Aug 20 2014

Keywords

Comments

Self-inverse permutation A193231 maps each term of this sequence to some term of A246156 and vice versa.
Each term belongs into a distinct infinite cycle in permutations like A246161/A246162 and A246163/A246164 apart from 4, which is in a finite cycle (3 4) of A246161/A246162 and 4 and 8 which both are in the same (infinite) cycle of A246163/A246164.

Examples

			4, which is 100 in binary, encodes polynomial x^2, which factorizes as (x)(x) over GF(2), (4 = A048720(2,2)), thus it is reducible in that polynomial ring. It also has an odd number of nonzero terms present (equally: odd number of 1-bits in its code), in this case just one, thus 4 is a member of this sequence.
		

Crossrefs

Intersection of A091242 and A000069 (odious numbers).
A238186 and A246157 are subsequences.

A246164 Permutation of natural numbers: a(1) = 1, a(A065621(n)) = A014580(a(n-1)), a(A048724(n)) = A091242(a(n)), where A065621(n) and A048724(n) are the reversing binary representation of n and -n, respectively, and A014580 resp. A091242 are the binary coded irreducible resp. reducible polynomials over GF(2).

Original entry on oeis.org

1, 2, 4, 11, 8, 5, 3, 7, 6, 9, 13, 17, 47, 31, 14, 61, 21, 42, 185, 24, 87, 319, 62, 12, 25, 19, 10, 59, 20, 15, 37, 229, 49, 22, 67, 76, 415, 103, 28, 18, 55, 137, 34, 41, 16, 27, 97, 78, 425, 109, 29, 1627, 222, 54, 283, 433, 79, 373, 3053, 33, 131, 647, 108, 847, 133, 745, 6943, 44, 193, 1053, 160, 504, 4333, 587, 99
Offset: 1

Views

Author

Antti Karttunen, Aug 19 2014

Keywords

Comments

This is an instance of entanglement permutation, where the two complementary pairs to be entangled with each other are A065621/A048724 and A014580/A091242 (binary codes for irreducible and reducible polynomials over GF(2)).
The former are themselves permutations of A000069/A001969 (odious and evil numbers), which means that this permutation shares many properties with A246162.
For the comments about the cycle structure, please see A246163.

Crossrefs

Formula

a(1) = 1, and for n > 1, if A010060(n) = 1 [i.e. when n is an odious number], a(n) = A014580(a(A065620(n)-1)), otherwise a(n) = A091242(a(- (A065620(n)))). [A065620 Converts sum of powers of 2 in binary representation of n to an alternating sum].
As a composition of related permutations:
a(n) = A246202(A193231(n)).
a(n) = A245702(A234025(n)).
a(n) = A246162(A234612(n)).
a(n) = A193231(A246204(A193231(n))).
For all n > 1, A091225(a(n)) = A010060(n). [Maps odious numbers to binary representations of irreducible GF(2) polynomials (A014580) and evil numbers to the corresponding representations of reducible polynomials (A091242), in some order. A246162 has the same property].

A246161 Permutation of positive integers: a(1) = 1, a(A014580(n)) = A000069(1+a(n)), a(A091242(n)) = A001969(1+a(n)), where A000069 and A001969 are the odious and evil numbers, and A014580 resp. A091242 are the binary coded irreducible resp. reducible polynomials over GF(2).

Original entry on oeis.org

1, 2, 4, 3, 5, 9, 8, 6, 10, 18, 7, 17, 11, 12, 20, 36, 15, 34, 19, 23, 24, 40, 72, 30, 16, 68, 39, 46, 48, 80, 13, 144, 60, 33, 136, 78, 21, 92, 96, 160, 37, 27, 288, 120, 66, 272, 14, 156, 43, 184, 192, 320, 75, 54, 35, 576, 240, 132, 22, 544, 25, 29, 312, 86, 368, 384, 41
Offset: 1

Views

Author

Antti Karttunen, Aug 17 2014

Keywords

Comments

This is an instance of entanglement permutation, where the two complementary pairs to be entangled with each other are A014580/A091242 (binary codes for irreducible and reducible polynomials over GF(2)) and A000069/A001969 (odious and evil numbers).
Because 3 is the only evil number in A014580, it implies that, apart from a(3)=4, odious numbers occur in odious positions only (along with many evil numbers that also occur in odious positions).
Note that the two values n=21 and n=35 given in the Example section both encode polynomials reducible over GF(2) and have an odd number of 1-bits in their binary representation (that is, they are both terms of A246158). As this permutation maps all terms of A091242 to the terms of A001969, and apart from a single exception 3 (which here is in a closed cycle: a(3) = 4, a(4) = 3), no term of A001969 is a member of A014580, so they must be members of A091242, thus successive iterations a(21), a(a(21)), a(a(a(21))), etc. always yield some evil number (A001969), so the cycle can never come back to 21 as it is an odious number, so that cycle must be infinite.
On the other hand, when we iterate with the inverse of this permutation, A246162, starting from 21, we see that its successive pre-images 37, 41, 67, 203, 5079 [e.g., 21 = a(a(a(a(a(5079)))))] are all irreducible and thus also odious.
In each such infinite cycle, there can be at most one term which is both reducible (in A091242) and odious (in A000069), i.e. in A246158, thus 21 and 35 must reside in different infinite cycles.
The sequence of fixed points begin as: 1, 2, 5, 19, 54, 71, 73, 865.
Question: apart from them and transposition (3 4) are there any more instances of finite cycles?

Examples

			Consider n=21. In binary it is 10101, encoding for polynomial x^4 + x^2 + 1, which factorizes as (x^2 + x + 1)(x^2 + x + 1) over GF(2), in other words, 21 = A048720(7,7). As such, it occurs as the 14th term in A091242, reducible polynomials over GF(2), coded in binary.
By definition of this permutation, a(21) is thus obtained as A001969(1+a(14)). 14 in turn is 8th term in A091242, thus a(14) = A001969(1+a(8)). In turn, 8 = A091242(4), thus a(8) = A001969(1+a(4)), and 4 = A091242(1).
By working the recursion back towards the toplevel, the result is a(21) = A001969(1+A001969(1+A001969(1+A001969(1+1)))) = 24.
Consider n=35. In binary it is 100011, encoding for polynomial x^5 + x + 1, which factorizes as (x^2 + x + 1)(x^3 + x^2 + 1) over GF(2), in other words, 35 = A048720(7,13). As such, it occurs as the 26th term in A091242, thus a(35) = A001969(1+a(26)), and as 26 = A091242(18) and 18 = A091242(12) and 12 = A091242(7) and 7 = A014580(3) [the polynomial x^2 + x + 1 is irreducible over GF(2)], and 3 = A014580(2) and 2 = A014580(1), we obtain the result as a(35) = A001969(1+A001969(1+A001969(1+A001969(1+A000069(1+A000069(1+A000069(2))))))) = 136.
		

Crossrefs

Formula

a(1) = 1, and for n > 1, if n is in A014580, a(n) = A000069(1+a(A091226(n))), otherwise a(n) = A001969(1+a(A091245(n))).
As a composition of related permutations:
a(n) = A233280(A245701(n)).
a(n) = A003188(A246201(n)).
a(n) = A234612(A246163(n)).
Other identities:
For all n > 1, A010060(a(n)) = A091225(n). [Maps binary representations of irreducible GF(2) polynomials (A014580) to odious numbers and the corresponding representations of reducible polynomials (A091242) to evil numbers, in some order].
Showing 1-5 of 5 results.