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-4 of 4 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).

A292594 a(n) = A000120(A292590(n)).

Original entry on oeis.org

0, 0, 1, 1, 0, 2, 2, 1, 3, 3, 1, 4, 0, 0, 5, 5, 2, 2, 5, 2, 6, 6, 1, 7, 0, 3, 8, 1, 3, 9, 9, 1, 3, 9, 4, 10, 10, 0, 3, 10, 0, 11, 2, 5, 12, 1, 5, 4, 12, 2, 13, 13, 2, 14, 14, 5, 15, 3, 2, 4, 0, 6, 1, 15, 6, 16, 2, 1, 17, 17, 7, 4, 4, 0, 18, 18, 3, 6, 18, 8, 5, 18, 1, 19, 0, 3, 20, 1, 9, 21, 21, 9, 6, 1, 1, 22, 22, 3, 23, 23, 9, 4, 5, 4, 5
Offset: 1

Views

Author

Antti Karttunen, Sep 20 2017

Keywords

Comments

Locate the node which contains n in binary tree A245612 (or in its mirror-image A244154) and traverse from that node towards the root, counting all multiples of three that occur on the path. More formally, for n > 1, a(n) counts the multiples of 3 encountered until 1 is reached, when we iterate the map x -> A285712(x), starting from x=n. The count includes also n itself if it is a multiple of 3.

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 == 1, n - 1, 2 a[f@ n] + Boole[Divisible[n, 3]]]; Array[DigitCount[a@ #, 2, 1] &, 105] (* Michael De Vlieger, Sep 22 2017 *)

Formula

a(1) = 0; and for n > 1, a(n) = A079978(n) + a(A285712(n)).
a(n) = A000120(A292590(n)).
a(n) + A292595(n) = A285715(n).

A292244 Base-2 expansion of a(n) encodes the steps where multiples of 3 are encountered when map x -> A253889(x) is iterated down to 1, starting from x=n.

Original entry on oeis.org

0, 0, 1, 0, 0, 3, 0, 2, 5, 0, 0, 1, 0, 0, 1, 12, 6, 7, 14, 0, 1, 0, 4, 1, 8, 10, 3, 0, 0, 21, 24, 0, 1, 28, 2, 3, 2, 0, 1, 0, 0, 5, 2, 2, 1, 22, 24, 17, 0, 12, 33, 32, 14, 35, 42, 28, 45, 24, 0, 1, 16, 2, 11, 48, 0, 59, 0, 8, 3, 0, 2, 5, 0, 16, 1, 4, 20, 3, 6, 6, 7, 8, 0, 1, 56, 0, 3, 0, 42, 5, 0, 48, 5, 0, 0, 1, 14, 2, 65, 64, 56, 49, 44, 4, 49, 64, 6, 57, 0
Offset: 1

Views

Author

Antti Karttunen, Sep 15 2017

Keywords

Examples

			For n = 3, the starting value is a multiple of three, after which follows A253889(3) = 1, the end point of iteration, which is not a multiple of three, thus a(3) = 1*(2^0) = 1.
For n = 8, the starting value is not a multiple of three, after which follows A253889(8) = 3, which is, thus a(8) = 0*(2^0) + 1*(2^1) = 2.
For n = 9, the starting value is a multiple of three, after which follows A253889(9) = 8 (which is not), while A253889(8) = 3 (which is), thus a(9) = 1*(2^0) + 0*(2^1) + 1*(2^2) = 5.
		

Crossrefs

Cf. also A292245, A292246, and A292381, A292383, A292385, and A292590, A292591 for similarly constructed sequences, and also A292250.

Programs

  • Mathematica
    f[n_] := Times @@ Power[If[# == 1, 1, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger[2 n - 1];g[n_] := (Times @@ Power[If[# == 1, 1, NextPrime@ #] & /@ First@ #, Last@ #] + 1)/2 &@ Transpose@ FactorInteger@ n;Table[FromDigits[#, 2] &@ Map[Boole[Divisible[#, 3]] &,  Reverse@ NestWhileList[Floor@ g[Floor[f[#]/2]] &, n, # > 1 &]], {n, 109}] (* Michael De Vlieger, Sep 16 2017 *)
  • Scheme
    (define (A292244 n) (A291770 (A292243 n)))

Formula

a(n) = A291770(A292243(n)).
Other identities. For all n >= 1:
a(A048673(n)) = A292247(n).
a(n) + A292245(n) = A064216(n).
a(n) AND A292245(n) = a(n) AND A292246(n) = 0, where AND is a bitwise-AND (A004198).

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).
Showing 1-4 of 4 results.