login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A261393 Additive terms of the rational Collatz tree. 1
0, 1, 2, 4, 4, 5, 8, 13, 8, 7, 10, 14, 16, 17, 26, 40, 16, 11, 14, 16, 20, 19, 28, 41, 32, 25, 34, 44, 52, 53, 80, 121, 32, 19, 22, 20, 28, 23, 32, 43, 40, 29, 38, 46, 56, 55, 82, 122, 64, 41, 50, 52, 68, 61, 88, 125, 104, 79, 106, 134 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

COMMENTS

A full binary tree can be constructed by inverting the Collatz function and removing the even and odd branch conditions. The rational numbers formed by this tree have the form c = ((2^x + a(n))/(3^y)) where (y = A000120(n)) and (x >= A029837(c+1)-y).

LINKS

Charles R Greathouse IV, Table of n, a(n) for n = 0..10000

FORMULA

a(0) = 0, a(2*n) = 2*a(n), and a(2*n+1) = a(n) + 3^A000120(n).

EXAMPLE

a(0) = 0.

a(1) = a(2*0+1) = a(0) + 3^A000120(0) = 0 + 3^0 = 1.

a(2) = a(2*1) = 2*a(1) = 2*1 = 2.

a(3) = a(2*1+1) = a(1) + 3^A000120(1) = 1 + 3^1 = 4.

a(4) = a(2*2) = 2*a(2) = 2*2 = 4.

a(5) = a(2*2+1) = a(2) + 3^A000120(2) = 2 + 3^1 = 5.

a(6) = a(2*3) = 2*a(3) = 2*4 = 8.

a(7) = a(2*3+1) = a(3) + 3^A000120(3) = 4 + 3^2 = 13.

a(8) = a(2*4) = 2*a(4) = 2*4 = 8.

PROG

(Python)

def h(n):

  if(n == 0):     return 0

  elif(n%2 == 0): return h(n/2)

  else:           return h((n-1)/2) + 1

def a(n):

  if(n == 0):     return 0

  elif(n%2 == 0): return 2*a(n/2)

  else:           return a((n-1)/2) + 3**h((n-1)/2)

(PARI) h(n)=if(n, n>>=valuation(n, 2); h(n\2)+1, 0)

a(n)=if(n, my(k=valuation(n, 2)); n>>=k+1; (a(n)+3^h(n))<<k, 0) \\ Charles R Greathouse IV, Aug 18 2015

CROSSREFS

Cf. A000120, A029837.

Sequence in context: A084824 A184615 A151969 * A327629 A121528 A243003

Adjacent sequences:  A261390 A261391 A261392 * A261394 A261395 A261396

KEYWORD

nonn,easy

AUTHOR

Jared Deckard, Aug 17 2015

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified November 12 09:29 EST 2019. Contains 329054 sequences. (Running on oeis4.)