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

A292592 a(n) = A292590(A245612(n)).

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 2, 2, 0, 1, 0, 0, 4, 5, 4, 5, 0, 0, 2, 2, 0, 1, 0, 0, 8, 8, 10, 11, 8, 8, 10, 10, 0, 1, 0, 0, 4, 5, 4, 5, 0, 0, 2, 2, 0, 1, 0, 0, 16, 17, 16, 17, 20, 20, 22, 23, 16, 17, 16, 16, 20, 21, 20, 21, 0, 0, 2, 2, 0, 1, 0, 0, 8, 8, 10, 11, 8, 8, 10, 10, 0, 1, 0, 0, 4, 5, 4, 5, 0, 0, 2, 2, 0, 1, 0, 0, 32, 32, 34, 35, 32, 32, 34, 34, 40, 41, 40, 41
Offset: 0

Views

Author

Antti Karttunen, Sep 20 2017

Keywords

Comments

Because A292590(n) = a(A245611(n)), the sequence works as a "masking function" where the 1-bits in a(n) (always a subset of the 1-bits in binary expansion of n) indicate which numbers are multiples of 3 in binary tree A245612 on that trajectory which leads from the root of the tree to the node containing A245612(n). See the examples.

Examples

			A245612(18) = 188, that is, at "node address" 18 in binary tree A245612 sits number 188. 18 in binary is "10010", which when read from left to right (after the most significant bit which is always 1) gives the directions to follow in the tree when starting from the root, to land in node containing number 188. Here, after 1 and 2, turn left from 2, turn left from 5, turn right from 14 and then turn left from 63 and then indeed one lands in 188. These turns correspond with the four lowermost bits of the code, "0010". When one selects multiples of 3 from this path 1 -> 2 -> 5 -> 14 -> 63 -> 188, the only one is 63, which corresponds with the second rightmost bit (which also is the only 1-bit) in the code, which can be masked with 2 (binary "10"), thus a(18) = 2.
A245612(15) = 6, that is, at "node address" 15 in binary tree A245612 sits number 6. 15 in binary is "1111", which tells that 6 can be located in tree A245612 by going (after the initial root 1 and 2) three steps towards right from 2: 1 -> 2 -> 3 -> 4 -> 6. Of these numbers, only 3 and 6 are multiples of 3, thus the mask to obtain the corresponding bits from "1111" is "00101" (5 in binary), thus a(15) = 5.
A245612(31) = 7, that is, at "node address" 31 in binary tree A245612 sits number 7. 31 in binary is "11111", which tells that 7 can be located in tree A245612 by going (after the initial root 1 and 2) four steps towards right from 2: 1 -> 2 -> 3 -> 4 -> 6 -> 7. Of these numbers, only 3 and 6 are multiples of 3, thus the mask to obtain the corresponding bits from "11111" is "001010" (ten in binary), thus a(31) = 10.
		

Crossrefs

Cf. also A292377.
Differs from related A292274 for the first time at n=31, where a(31) = 10, while A292274(31) = 11. Compare also the scatter plots.

Programs

  • Mathematica
    f[n_] := f[n] = Which[n == 1, 0, Mod[n, 3] == 2, Ceiling[n/3], True, (Times @@ Power[If[# == 1, 1, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger[2 n - 1] + 1)/2]; g[n_] := g[n] = If[n == 1, 0, 2 g[f@ n] + Boole[Divisible[n, 3]]]; h[n_] := (Times @@ Power[If[# == 1, 1, NextPrime@ #] & /@ First@ #, Last@ #] + 1)/2 &@ Transpose@ FactorInteger@If[n == 0, 1, Prime[#] Product[ Prime[m]^(Map[ Ceiling[(Length@ # - 1)/2] &, DeleteCases[ Split@ Join[ Riffle[ IntegerDigits[n, 2], 0], {0}], {k__} /;k == 1]][[-m]]), {m, #}] &[DigitCount[n, 2, 1]]]; Array[g@ h@ # &, 108, 0] (* Michael De Vlieger, Sep 22 2017 *)

Formula

a(n) + A292593(n) = n, a(n) AND A292593(n) = 0.
a(n) AND n = a(n), where AND is bitwise-AND (A004198).

A292944 a(n) = A292272(A004754(n)) - 2*A053644(n).

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 2, 2, 0, 1, 2, 2, 4, 5, 4, 4, 0, 1, 2, 2, 4, 5, 4, 4, 8, 9, 10, 10, 8, 9, 8, 8, 0, 1, 2, 2, 4, 5, 4, 4, 8, 9, 10, 10, 8, 9, 8, 8, 16, 17, 18, 18, 20, 21, 20, 20, 16, 17, 18, 18, 16, 17, 16, 16, 0, 1, 2, 2, 4, 5, 4, 4, 8, 9, 10, 10, 8, 9, 8, 8, 16, 17, 18, 18, 20, 21, 20, 20, 16, 17, 18, 18, 16, 17, 16, 16, 32, 33, 34, 34, 36, 37, 36, 36
Offset: 0

Views

Author

Antti Karttunen, Sep 28 2017

Keywords

Comments

In binary expansion (A007088) of n, clear the most significant bit and all those 1-bits that have another 1-bit at their left side, except for the second most significant 1-bit, even in cases where the binary expansion begins as "11...".
Because A292943(n) = a(A243071(n)), the sequence works as a "masking function" where the 1-bits in a(n) (always a subset of the 1-bits in binary expansion of n) indicate which numbers are of the form 6k+3 (odd multiples of three) in binary tree A163511 (or its mirror image tree A005940) on that trajectory which leads from the root of the tree to the node containing A163511(n).

Examples

			For n = 23, 10111 in binary, when we clear (change to zero) the most significant bit (always 1) and also all 1-bits that have 1's at their left side, we are left with 100, which in binary stands for 4, thus a(23) = 4.
For n = 27, 11011 in binary, when we clear the most significant bit, and also all 1-bits that have 1's at their left side except the second most significant, we are left with 1010, which in binary stands for ten, thus a(27) = 10.
		

Crossrefs

Programs

Formula

a(n) = A292272(A004754(n)) - 2*A053644(n).
a(n) = A292943(A163511(n)).
Other identities. For all n >= 0:
a(n) + A292264(n) = A292942(n) + a(n) + A292946(n) = a(n) + A292254(n) + A292256(n) = n.
a(n) = a(n) AND n; a(n) AND A292264(n) = 0, where AND is bitwise-and (A004198).

A292254 a(n) = A292253(A163511(n)).

Original entry on oeis.org

0, 1, 2, 2, 4, 4, 4, 4, 8, 8, 8, 9, 8, 8, 8, 8, 16, 16, 16, 16, 16, 16, 18, 19, 16, 16, 16, 17, 16, 16, 16, 17, 32, 32, 32, 33, 32, 32, 32, 32, 32, 32, 32, 32, 36, 36, 38, 39, 32, 32, 32, 32, 32, 32, 34, 34, 32, 32, 32, 32, 32, 32, 34, 35, 64, 64, 64, 64, 64, 64, 66, 67, 64, 64, 64, 65, 64, 64, 64, 65, 64, 64, 64, 65, 64, 64, 64, 64, 72, 72, 72, 72, 76, 76
Offset: 0

Views

Author

Antti Karttunen, Sep 28 2017

Keywords

Comments

Because A292253(n) = a(A243071(n)), the sequence works as a "masking function" where the 1-bits in a(n) (always a subset of the 1-bits in binary expansion of n) indicate the numbers that are either of the form 12k+1 or of the form 12k+11 in binary tree A163511 (or its mirror image tree A005940) on that trajectory which leads from the root of the tree to the node containing A163511(n).
The AND - XOR formula just restates the fact that J(3|n) = J(-1|n)*J(-3|n), as the Jacobi-symbol is multiplicative (also) with respect to its upper argument.

Crossrefs

Cf also A292247, A292248, A292256, A292264, A292271, A292274, A292592, A292593, A292942, A292944, A292946 (for similarly constructed sequences).

Programs

Formula

a(n) = A292253(A163511(n)).
a(n) = A292264(n) AND (A292274(n) XOR A292942(n)), where AND is bitwise-and (A004198) and XOR is bitwise-XOR (A003987). [See comments.]
For all n >= 0, a(n) + A292944(n) + A292256(n) = n.

A292256 a(n) = A292255(A163511(n)).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 2, 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 6, 6, 0, 0, 0, 0, 0, 0, 2, 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 8, 8, 8, 9, 12, 12, 12, 12, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 6, 6, 0, 0, 0, 0, 0, 0, 2, 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 2, 2, 16, 16, 16, 16, 16, 16
Offset: 0

Views

Author

Antti Karttunen, Sep 28 2017

Keywords

Comments

Because A292255(n) = a(A243071(n)), the sequence works as a "masking function" where the 1-bits in a(n) (always a subset of the 1-bits in binary expansion of n) indicate the numbers that are either of the form 12k+5 or of the form 12k+7 in binary tree A163511 (or its mirror image tree A005940) on that trajectory which leads from the root of the tree to the node containing A163511(n).
The AND - XOR formulas just restate the fact that J(3|n) = J(-1|n)*J(-3|n), as the Jacobi-symbol is multiplicative (also) with respect to its upper argument.

Crossrefs

Cf. also A292247, A292248, A292254, A292264, A292271, A292274, A292592, A292593, A292942, A292944, A292946 (for similarly constructed sequences).

Programs

Formula

a(n) = A292255(A163511(n)).
a(n) = A292264(n) AND (A292274(n) XOR A292946(n)), where AND is bitwise-and (A004198) and XOR is bitwise-XOR (A003987).
a(n) = A292264(n) AND (A292271(n) XOR A292942(n)). [See comments].
For all n >= 0, a(n) + A292944(n) + A292254(n) = n.

A292942 a(n) = A292941(A163511(n)).

Original entry on oeis.org

0, 1, 2, 2, 4, 4, 4, 4, 8, 8, 8, 9, 8, 8, 8, 9, 16, 16, 16, 16, 16, 16, 18, 19, 16, 16, 16, 16, 16, 16, 18, 18, 32, 32, 32, 33, 32, 32, 32, 33, 32, 32, 32, 32, 36, 36, 38, 39, 32, 32, 32, 33, 32, 32, 32, 32, 32, 32, 32, 33, 36, 36, 36, 37, 64, 64, 64, 64, 64, 64, 66, 67, 64, 64, 64, 64, 64, 64, 66, 66, 64, 64, 64, 65, 64, 64, 64, 65, 72, 72, 72, 72, 76, 76
Offset: 0

Views

Author

Antti Karttunen, Sep 28 2017

Keywords

Comments

Because A292941(n) = a(A243071(n)), the sequence works as a "masking function" where the 1-bits in a(n) (always a subset of the 1-bits in binary expansion of n) indicate which numbers are of the form 6k+1 in binary tree A163511 (or its mirror image tree A005940) on that trajectory which leads from the root of the tree to the node containing A163511(n).
The AND - XOR formula is just a restatement of the fact that J(-3|n) = J(-1|n)*J(3|n), as the Jacobi-symbol is multiplicative (also) with respect to its upper argument.

Crossrefs

Cf. also A292247, A292248, A292254, A292256, A292264, A292271, A292274, A292592, A292593, A292944, A292946 (for similarly constructed sequences).

Programs

Formula

a(n) = A292941(A163511(n)).
a(n) = A292264(n) AND (A292254(n) XOR A292274(n)), where AND is bitwise-and (A004198) and XOR is bitwise-XOR (A003987). [See comments.]
For all n >= 0, a(n) + A292944(n) + A292946(n) = n.

A292946 a(n) = A292945(A163511(n)).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 4, 4, 4, 5, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 8, 8, 8, 8, 8, 8, 10, 10, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 4, 4, 4, 5, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0
Offset: 0

Views

Author

Antti Karttunen, Sep 28 2017

Keywords

Comments

Because A292945(n) = a(A243071(n)), the sequence works as a "masking function" where the 1-bits in a(n) (always a subset of the 1-bits in binary expansion of n) indicate which numbers are of the form 6k+5 in binary tree A163511 (or its mirror image tree A005940) on that trajectory which leads from the root of the tree to the node containing A163511(n).
The AND - XOR formulas just restate the fact that J(-3|n) = J(-1|n)*J(3|n), as the Jacobi-symbol is multiplicative (also) with respect to its upper argument.

Crossrefs

Cf. also A292247, A292248, A292254, A292256, A292264, A292271, A292274, A292592, A292593, A292942, A292944 (for similarly constructed sequences).

Programs

Formula

a(n) = A292945(A163511(n)).
a(n) = A292264(n) AND (A292256(n) XOR A292274(n)), where AND is bitwise-and (A004198) and XOR is bitwise-XOR (A003987).
a(n) = A292264(n) AND (A292254(n) XOR A292271(n)). [See comments.]
For all n >= 0, A292942(n) + A292944(n) + a(n) = n.

A292591 a(1) = 0, a(2) = 1; and for n > 2, a(n) = 2*a(A285712(n)) + [1 == (n mod 3)].

Original entry on oeis.org

0, 1, 2, 5, 2, 10, 21, 4, 42, 85, 10, 170, 5, 4, 340, 681, 20, 8, 1363, 42, 2726, 5453, 8, 10906, 11, 84, 21812, 21, 170, 43624, 87249, 20, 40, 174499, 340, 348998, 697997, 10, 16, 1395995, 8, 2791990, 85, 680, 5583980, 43, 1362, 168, 11167961, 40, 22335922, 44671845, 16, 89343690, 178687381, 2726, 357374762, 341, 84, 80, 23, 5452, 8, 714749525, 10906
Offset: 1

Views

Author

Antti Karttunen, Sep 20 2017

Keywords

Comments

Binary expansion of a(n) encodes the positions of numbers of the form 3k+1 (with k >= 1) in the path taken from n to the root in the binary trees A245612 and A244154, except that the most significant 1-bit of a(n) always corresponds to 2 instead of 1 at the root of those trees.

Crossrefs

Programs

  • Mathematica
    f[n_] := f[n] = Which[n == 1, 0, Mod[n, 3] == 2, Ceiling[n/3], True, (Times @@ Power[If[# == 1, 1, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger[2 n - 1] + 1)/2]; a[n_] := a[n] = If[n <= 2, n - 1, 2 a[f@ n] + Boole[Mod[n, 3] == 1]]; Array[a, 65] (* Michael De Vlieger, Sep 22 2017 *)
  • Scheme
    (define (A292591 n) (if (<= n 2) (- n 1) (+ (if (= 1 (modulo n 3)) 1 0) (* 2 (A292591 (A285712 n))))))

Formula

a(n) + A292590(n) = A245611(n).
a(A245612(n)) = A292593(n).
A000120(a(n)) = A292595(n).

A332995 a(n) = A332895(A332817(n)).

Original entry on oeis.org

0, 1, 2, 2, 4, 5, 4, 5, 8, 8, 10, 11, 8, 8, 10, 10, 16, 17, 16, 17, 20, 20, 22, 23, 16, 17, 16, 16, 20, 21, 20, 21, 32, 32, 34, 35, 32, 32, 34, 34, 40, 41, 40, 41, 44, 44, 46, 47, 32, 32, 34, 34, 32, 33, 32, 32, 40, 40, 42, 43, 40, 40, 42, 42, 64, 65, 64, 65, 68, 68, 70, 71, 64, 65, 64, 64, 68, 69, 68, 69, 80, 80, 82, 83, 80, 80, 82, 82, 88, 89, 88, 89, 92
Offset: 0

Views

Author

Antti Karttunen, Mar 05 2020

Keywords

Comments

In contrast to similarly constructed A292271, this sequence can be computed directly from the binary expansion of n, without involving primes or their distribution at all.

Crossrefs

Differs from a similarly constructed A292593 for the first time at n=511, where a(511) = 341, while A292593(511) = 340.

Programs

Formula

a(n) = A332895(A332817(n)).
a(n) = n - A332996(n) = n XOR A332996(n).
A000120(a(n)) = A332997(n).
Showing 1-8 of 8 results.