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.

User: Frederik P.J. Vandecasteele

Frederik P.J. Vandecasteele's wiki page.

Frederik P.J. Vandecasteele has authored 4 sequences.

A380544 Numbers of the form A073138(k) XOR A038573(k).

Original entry on oeis.org

0, 3, 5, 9, 15, 17, 27, 33, 51, 63, 65, 99, 119, 129, 195, 231, 255, 257, 387, 455, 495, 513, 771, 903, 975, 1023, 1025, 1539, 1799, 1935, 2015, 2049, 3075, 3591, 3855, 3999, 4095, 4097, 6147, 7175, 7695, 7967, 8127, 8193, 12291, 14343, 15375, 15903, 16191, 16383, 16385
Offset: 1

Author

Keywords

Comments

The plot of the sequence has a blancmange appearance. The discontinuities in the curve are at a(n) = k^2 + 1.
The bit length of a(n+1) appears to be A000267(n)+1.
The number of 0-bits in the binary expansion of a(n+1) appears to be A082375(n).

Examples

			k = 17. A073138(17) = 24 = 11000_2. A038573(17) = 3 = 00011_2. 11000_2 XOR 00011_2 = 11011_2 = 27. 27 is a term.
		

Crossrefs

Subsequence of A006995.

Programs

  • Mathematica
    s[n_, k_] := (2^n-1)*(2^(k-n)+1); Join[{0}, Table[s[n, k], {k, 2, 15}, {n, 1, Floor[k/2]}] // Flatten] (* Amiram Eldar, Jun 23 2025 *)
  • PARI
    a8(n) = fromdigits(vecsort(binary(n), , 4), 2);
    a3(n) = 2^hammingweight(n)-1;
    lista(nn) = Set(vector(nn, n, bitxor(a3(n), a8(n)))); \\ Michel Marcus, Jun 23 2025

Extensions

More terms from Michel Marcus, Jun 23 2025

A384314 Numbers k such that the nonzero digits in the ternary expansion k = d(1),...,d(m) satisfy d(2*i+1) = d(1) and d(2*i) = 3-d(1).

Original entry on oeis.org

0, 1, 2, 3, 5, 6, 7, 9, 10, 15, 16, 18, 20, 21, 23, 27, 29, 30, 32, 45, 47, 48, 50, 54, 55, 60, 61, 63, 64, 69, 70, 81, 82, 87, 88, 90, 91, 96, 97, 135, 136, 141, 142, 144, 145, 150, 151, 162, 164, 165, 167, 180, 182, 183, 185, 189, 191, 192, 194, 207, 209
Offset: 1

Author

Keywords

Comments

The ternary expansion of the numbers in this sequence correspond to a valid linear gear train configurations with pairwise intermeshing of neighboring gears: 0 for an idler gear, 1 for a gear driven in rotational direction A, 2 for a gear driven in rotational direction B.
A gear train is valid if it has no contradictions, where a contradiction occurs if two meshed gears rotate in the same direction.
The rotation directions for the whole train are determined by the most significant ternary digit 1 or 2.
Any later driven gears must be in the same direction as the most significant when at an even distance away from there and the opposite direction when an odd distance away.

Examples

			32 is a term since its ternary expansion is
   ternary     1 0 1 2
   direction   A B A B
The direction for the 0 gear is determined by its preceding A, and the whole train has valid alternating A,B adjacent pairs.
11 is not a term because its ternary expansion 102 does not follow the pattern ABA.
		

A384956 Binary XOR of number of 1-bits in the binary representation of n and number of 0-bits in the binary representation of n, a(0) = 1.

Original entry on oeis.org

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

Author

Keywords

Comments

n=0 is taken to be a single 0 bit, and all other n are taken without leading 0 bits.
When the length of the binary representation of n is 2^k-1, then a(n) is 2^k-1.

Examples

			179 (10110011_2) has 5 (101_2) 1-bits and 3 (011_2) 0-bits. 101_2 XOR 011_2 = 110_2 = 6. a(179) = 6.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := BitXor @@ DigitCount[n, 2]; Array[a, 100, 0] (* Amiram Eldar, Jun 13 2025 *)
  • Python
    def A384956(n):
        if n == 0 : return 1
        return (n.bit_length() - (Ham:=n.bit_count())) ^ Ham # Karl-Heinz Hofmann, Jun 14 2025

Formula

a(n) = A000120(n) XOR A023416(n).

A383593 In the binary expansion of n, change the most significant 0 bit to 1, if there is any 0 bit.

Original entry on oeis.org

1, 1, 3, 3, 6, 7, 7, 7, 12, 13, 14, 15, 14, 15, 15, 15, 24, 25, 26, 27, 28, 29, 30, 31, 28, 29, 30, 31, 30, 31, 31, 31, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 56, 57, 58, 59, 60, 61, 62, 63, 60, 61, 62, 63, 62, 63, 63, 63, 96, 97, 98, 99, 100
Offset: 0

Author

Keywords

Comments

n = 0 is taken to be a single 0 bit, but for all other n no leading 0 bits are used.
The plot of the sequence is fractal.

Examples

			a(25) = 29 since 25 = 11001_2 becomes 11101_2 = 29.
		

Crossrefs

Cf. A000225 (fixed points), A004760 (range of values), A063250.

Programs

  • Python
    def a(n): return int(bin(n)[2:].replace('0', '1', 1), 2)
    print([a(n) for n in range(70)]) # Michael S. Branicky, Jun 11 2025
    
  • Python
    def A383593(n): return (n if (t:=bin(n)[2:].find('0'))==-1 else n+(1<Chai Wah Wu, Jun 17 2025

Formula

a(n) = n + floor(2^(A063250(n)-1)) for n > 0. - David Radcliffe, Jun 12 2025