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.

A136387 Sequence A136386 written in base 2.

Original entry on oeis.org

100, 1000, 101100000, 111010010000, 110110001010011100100000000100000, 101010010000001101001101111001000100001000011000101100000000, 100100101011010111000001100000001000110011001010001110000001111101101000000000100010010000010000010100010010010100000010011000000
Offset: 3

Views

Author

Antti Karttunen, Dec 29 2007

Keywords

Formula

a(n) = A007088(A136386(n)).

A268389 a(n) = greatest k such that polynomial (X+1)^k divides the polynomial (in polynomial ring GF(2)[X]) that is encoded in the binary expansion of n. (See the comments for details).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Feb 10 2016

Keywords

Comments

a(n) gives the number of iterations of map k -> A006068(k)/2 that are required (when starting from k = n) until k is an odd number.
A001317 gives the record positions and particularly, A001317(n) gives the first occurrence of n in this sequence.
When polynomials over GF(2) are encoded in the binary representation of n in a natural way where each polynomial b(n)*X^n+...+b(0)*X^0 over GF(2) is represented by the binary number b(n)*2^n+...+b(0)*2^0 in N (each coefficient b(k) is either 0 or 1), then a(n) = the number of times polynomial X+1 (encoded by 3, "11" in binary) divides the polynomial encoded by n.

Examples

			For n = 5 ("101" in binary) which encodes polynomial x^2 + 1, we see that it can be factored over GF(2) as (X+1)(X+1), and thus a(5) = 2.
For n = 8 ("1000" in binary) which encodes polynomial x^3, we see that it is not divisible in ring GF(2)[X] by polynomial X+1, thus a(8) = 0.
For n = 9 ("1001" in binary) which encodes polynomial x^3 + 1, we see that it can be factored over GF(2) as (X+1)(X^2 + X + 1), and thus a(9) = 1.
		

Crossrefs

Cf. A268669 (quotient left after (X+1)^a(n) has been divided out).
Cf. A268395 (partial sums).
Cf. A000069 (positions of zeros), A268679 (this sequence without zeros).
Cf. also A037096, A037097, A136386.

Programs

  • Mathematica
    f[n_] := Which[n == 1, 0, OddQ@ #, 0, EvenQ@ #, 1 + f[#/2]] &@ Fold[BitXor, n, Quotient[n, 2^Range[BitLength@ n - 1]]]; Array[f, {120}] (* Michael De Vlieger, Feb 12 2016, after Jan Mangaldan at A006068 *)
  • PARI
    a(n) = {my(b = binary(n), p = Pol(binary(n))*Mod(1,2), k = poldegree(p)); while (type(p/(x+1)^k*Mod(1,2)) != "t_POL", k--); k;} \\ Michel Marcus, Feb 12 2016
    
  • Scheme
    ;; This employs the given recurrence and uses memoization-macro definec:
    (definec (A268389 n) (if (odd? (A006068 n)) 0 (+ 1 (A268389 (/ (A006068 n) 2)))))
    (define (A268389 n) (let loop ((n n) (s 0)) (let ((k (A006068 n))) (if (odd? k) s (loop (/ k 2) (+ 1 s)))))) ;; Computed in a loop, no memoization.

Formula

If A006068(n) is odd, then a(n) = 0, otherwise a(n) = 1 + a(A006068(n)/2).
Other identities. For all n >= 0:
a(A001317(n)) = n. [The sequence works as a left inverse of A001317.]
A048720(A268669(n),A048723(3,a(n))) = A048720(A268669(n),A001317(a(n))) = n.
A048724^a(n) (A268669(n)) = n. [The a(n)-th fold application (power) of A048724 when applied to A268669(n) gives n back.]
a(n) = A007949(A235042(n)).
a(A057889(n)) = a(n).

A268669 a(n) = polynomial quotient (computed over GF(2), result is its binary encoding) that is left after all instances of polynomial (X+1) have been factored out of the polynomial that is encoded by the binary expansion of n. (See comments for details).

Original entry on oeis.org

1, 2, 1, 4, 1, 2, 7, 8, 7, 2, 11, 4, 13, 14, 1, 16, 1, 14, 19, 4, 21, 22, 13, 8, 25, 26, 7, 28, 11, 2, 31, 32, 31, 2, 35, 28, 37, 38, 11, 8, 41, 42, 25, 44, 7, 26, 47, 16, 49, 50, 1, 52, 19, 14, 55, 56, 13, 22, 59, 4, 61, 62, 21, 64, 21, 62, 67, 4, 69, 70, 61, 56, 73, 74, 13, 76, 59, 22, 79, 16, 81, 82, 49, 84, 1
Offset: 1

Views

Author

Antti Karttunen, Feb 10 2016

Keywords

Comments

When polynomials over GF(2) are encoded in the binary representation of n in a natural way where each polynomial b(n)*X^n+...+b(0)*X^0 over GF(2) is represented by the binary number b(n)*2^n+...+b(0)*2^0 in N (each coefficient b(k) is either 0 or 1), then a(n) = representation of the polynomial that is left as a quotient when all X+1 polynomials (encoded by 3, "11" in binary) have been divided out.
Each a(n) is one of the "Garden of Eden" patterns of Rule-60 one-dimensional cellular automaton, a seed pattern which after A268389(n) generations yields the configuration encoded in binary expansion of n.
No terms of A001969 occur so all terms are odious (in A000069). Each odious number occurs an infinitely many times.

Examples

			For n = 5 ("101" in binary) which encodes polynomial x^2 + 1, we observe that it can be factored in ring GF(2)[X] as (X+1)(X+1), and thus a(5) = 1, because after dividing both instances of (X+1) off, we are left with the quotient polynomial 1 which is encoded by 1.
For n = 8 ("1000" in binary) which encodes polynomial x^3, we observe that it is not divisible in ring GF(2)[X] by polynomial X+1, thus a(8) = 8.
For n = 9 ("1001" in binary) which encodes polynomial x^3 + 1, we observe that it can be factored over GF(2) as (X+1)(X^2 + X + 1), and thus a(9) = 7, because the quotient polynomial X^2 + X + 1 is encoded by 7 ("111" in binary).
		

Crossrefs

Cf. A001317 (positions of ones).
Cf. A268389 (the highest exponent for (X+1)).
Cf. also A136386.

Programs

  • Mathematica
    f[n_] := If[OddQ@ #, n, f[#/2]] &@ Fold[BitXor, n, Quotient[n, 2^Range[BitLength@ n - 1]]]; Array[f, {85}] (* Michael De Vlieger, Feb 12 2016, after Jan Mangaldan at A006068 *)
  • PARI
    a(n) = {p = Pol(binary(n))*Mod(1,2); q = (x+1)*Mod(1,2); while (type(r = p/q) == "t_POL", p = r); np = Polrev(vector(poldegree(p)+1, k, k--; lift(polcoeff(p, k)))); subst(np, x, 2);} \\ Michel Marcus, Feb 12 2016
    
  • Scheme
    ;; This employs the given recurrence and uses memoization-macro definec:
    (definec (A268669 n) (if (odd? (A006068 n)) n (A268669 (/ (A006068 n) 2))))
    (define (A268669 n) (let loop ((n n)) (let ((k (A006068 n))) (if (odd? k) n (loop (/ k 2)))))) ;; Computed in a loop, no memoization.

Formula

If A006068(n) is odd, then a(n) = n, otherwise a(n) = a(A006068(n)/2).
Other identities and observations. For all n >= 1:
a(n) = A003188(A268670(n)).
A010060(a(n)) = 1. [All terms are odious.]
a(n) <= n.
More precisely, a(A000069(n)) = A000069(n) and a(A001969(n)) < A001969(n).
The equivalence of the following two formulas stems from the additive nature of Rule-60 cellular automaton. Or more plainly, because carryless binary multiplication A048720 distributes over carryless binary sum, XOR A003987:
A048724^A268389(n) (a(n)) = n. [Starting from k = a(n), and iterating map k -> A048724(k) exactly A268389(n) times yields n back.]
A048720(a(n),A048723(3,A268389(n))) = A048720(a(n),A001317(A268389(n))) = n.

A037096 Periodic vertical binary vectors computed for powers of 3: a(n) = Sum_{k=0 .. (2^n)-1} (floor((3^k)/(2^n)) mod 2) * 2^k.

Original entry on oeis.org

1, 2, 0, 204, 30840, 3743473440, 400814250895866480, 192435610587299441243182587501623263200, 2911899996313975217187797869354128351340558818020188112521784134070351919360
Offset: 0

Views

Author

Antti Karttunen, Jan 29 1999

Keywords

Comments

This sequence can be also computed with a recurrence that does not explicitly refer to 3^n. See the C program.
Conjecture: For n >= 3, each term a(n), when considered as a GF(2)[X] polynomial, is divisible by the GF(2)[X] polynomial (x + 1) ^ A055010(n-1). If this holds, then for n >= 3, a(n) = A048720(A136386(n), A048723(3,A055010(n-1))).

Examples

			When powers of 3 are written in binary (see A004656), under each other as:
  000000000001 (1)
  000000000011 (3)
  000000001001 (9)
  000000011011 (27)
  000001010001 (81)
  000011110011 (243)
  001011011001 (729)
  100010001011 (2187)
it can be seen that the bits in the n-th column from the right can be arranged in periods of 2^n: 1, 2, 4, 8, ... This sequence is formed from those bits: 1, is binary for 1, thus a(0) = 1. 01, reversed is 10, which is binary for 2, thus a(1) = 2, 0000 is binary for 0, thus a(2)=0, 000110011, reversed is 11001100 = A007088(204), thus a(3) = 204.
		

References

  • S. Wolfram, A New Kind of Science, Wolfram Media Inc., (2002), p. 119.

Crossrefs

Cf. A036284, A037095, A037097, A136386 for related sequences.
Cf. also A004642, A265209, A265210 (for 2^n written in base 3).

Programs

  • Maple
    a(n) := sum( 'bit_n(3^i, n)*(2^i)', 'i'=0..(2^(n))-1);
    bit_n := (x, n) -> `mod`(floor(x/(2^n)), 2);

Formula

a(n) = Sum_{k=0 .. A000225(n)} (floor(A000244(k)/(2^n)) mod 2) * 2^k.
Other identities and observations:
For n >= 2, a(n) = A000215(n-1)*A037097(n) = A048720(A037097(n), A048723(3, A000079(n-1))).

Extensions

Entry revised by Antti Karttunen, Dec 29 2007
Name changed and the example corrected by Antti Karttunen, Dec 05 2015

A037097 Periodic vertical binary vectors of powers of 3, starting from bit-column 2 (halved).

Original entry on oeis.org

0, 12, 120, 57120, 93321840, 10431955353116229600, 8557304989566294213168677685339060480, 102743047168201563425402150421568484707810385382513037790885688657488312400960
Offset: 2

Views

Author

Antti Karttunen, Jan 29 1999

Keywords

Comments

Conjecture: For n>=3, each term a(n), when considered as a GF(2)[X]-polynomial, is divisible by GF(2)[X] -polynomial (x + 1) ^ A000225(n-1) (= A051179(n-2)). If this holds, then for n>=3, a(n) = A048720bi(A136386(n),A048723bi(3,A000225(n-1))) = A048720bi(A136386(n),A051179(n-2)).

Examples

			When powers of 3 are written in binary (see A004656), under each other as:
000000000001 (1)
000000000011 (3)
000000001001 (9)
000000011011 (27)
000001010001 (81)
000011110011 (243)
001011011001 (729)
100010001011 (2187)
it can be seen that, starting from the column 2 from the right, the bits in the n-th column can be arranged in periods of 2^(n-1): 4, 8, ... This sequence is formed from those bits: 0011, reversed is 11100, which is binary for 12, thus a(3) = 12, 00011110, reversed is 011110000, which is binary for 120, thus a(4) = 120.
		

References

  • S. Wolfram, A New Kind of Science, Wolfram Media Inc., (2002), p. 119.

Crossrefs

a(n) = floor(A037096(n)/(2^(2^(n-1)))). See also A036284, A136386.

Programs

  • Maple
    a(n) := sum( 'bit_n(3^i, n)*(2^i)', 'i'=0..(2^(n-1))-1);
    bit_n := (x, n) -> `mod`(floor(x/(2^n)), 2);

Formula

a(n) = Sum_{k=0..A000225(n-1)} ([A000244(k)/(2^n)] mod 2) * 2^k, where [] stands for floor function.

Extensions

Entry revised Dec 29 2007
Showing 1-5 of 5 results.