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

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

Original entry on oeis.org

0, 0, 1, 2, 0, 5, 10, 2, 21, 42, 4, 85, 0, 0, 171, 342, 10, 5, 684, 20, 1369, 2738, 4, 5477, 0, 42, 10955, 8, 84, 21911, 43822, 8, 21, 87644, 170, 175289, 350578, 0, 11, 701156, 0, 1402313, 40, 342, 2804627, 16, 684, 85, 5609254, 20, 11218509, 22437018, 10, 44874037, 89748074, 1368, 179496149, 168, 40, 43, 0, 2738, 1, 358992298, 5476, 717984597, 80, 8
Offset: 1

Views

Author

Antti Karttunen, Sep 20 2017

Keywords

Comments

Binary expansion of a(n) encodes the positions of multiples of three in the path taken from n to the root in the binary trees like A245612 and A244154.

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[a, 67] (* Michael De Vlieger, Sep 22 2017 *)
  • Scheme
    (define (A292590 n) (if (<= n 1) 0 (+ (if (zero? (modulo n 3)) 1 0) (* 2 (A292590 (A285712 n))))))

Formula

a(1) = 0; and for n > 1, a(n) = A079978(n) + 2*a(A285712(n)).
a(n) + A292591(n) = A245611(n).
a(A245612(n)) = A292592(n).
A000120(a(n)) = A292594(n).

A292595 a(n) = A000120(A292591(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Sep 20 2017

Keywords

Comments

If n > 1, then locate the node which contains n in binary tree A245612 (or in its mirror-image A244154) and traverse from that node towards the root [by iterating the map n -> A285712(n)], at the same time counting all numbers of the form 3k+1 that occur on the path, down to the final 1. This count includes also n itself if it is of the form 3k+1, with k > 0 (thus a(1) = 0).

Crossrefs

Programs

  • Scheme
    (define (A292595 n) (if (<= n 2) (- n 1) (+ (if (= 1 (modulo n 3)) 1 0) (A292595 (A285712 n)))))

Formula

a(1) = 0, a(2) = 1, and for n > 1, a(n) = a(A285712(n)) + [1 == (n mod 3)].
a(n) = A000120(A292591(n)).
a(n) + A292594(n) = A285715(n).
Showing 1-2 of 2 results.