The OEIS is supported by the many generous donors to the OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A322305 a(0) = 1 & a(1) = 0; for n > 0, a(2n) = a(n) + a(n-1); if a(n) is even then a(2n+1) = a(n)/2, but if a(n) is odd then a(2n+1) = (3a(n)-1)/2 1
 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 2, 1, 2, 1, 1, 0, 1, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 2, 1, 1, 0, 1, 1, 2, 1, 3, 1, 3, 1, 4, 4, 4, 1, 4, 4, 4, 1, 4, 4, 4, 1, 4, 4, 4, 1, 3, 1, 3, 1, 2, 1, 1, 0, 1, 1, 2, 1, 3, 1, 3, 1, 4, 4, 4, 1, 4, 4, 4, 1, 5, 2, 8, 2, 8, 2, 5, 1, 5, 2, 8, 2, 8, 2, 5, 1, 5, 2, 8, 2 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,11 COMMENTS Each of the even-indexed numbers in the sequence is the sum of two adjacent terms (taken from the formula for the Fibonacci sequence), while each of the odd-indexed numbers is the result of a single iteration of the function similar to the Collatz function; so I call a sequence like this a "Colla-nacci" sequence. When the sequence is graphed, one can see that it contains a fractal pattern of perfectly symmetric subsequences resembling cathedrals or a city-scape. LINKS Daniel Godzieba, Table of n, a(n) for n = 0..65535 MATHEMATICA a[0] = 1; a[1] = 0; a[n_] := a[n] = If[EvenQ[n], a[n/2] + a[n/2 - 1], If[EvenQ[ a[(n - 1)/2]], a[(n - 1)/2]/2, (3*a[(n - 1)/2] - 1)/2]]; Array[a, 100, 0] (* Amiram Eldar, Aug 29 2019 *) PROG (Python) import numpy as np s = np.array([1, 0]) for i in range(1, 1000): ....s = np.append(s, s[i] + s[i-1]) ....if s[i]%2==0: ........s = np.append(s, s[i]//2) ....else: ........s = np.append(s, (3*s[i]-1)//2) CROSSREFS Sequence in context: A128915 A063995 A280737 * A020951 A117118 A117168 Adjacent sequences: A322302 A322303 A322304 * A322306 A322307 A322308 KEYWORD easy,nonn,look AUTHOR Daniel Godzieba, Aug 28 2019 STATUS approved

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

Last modified May 29 13:20 EDT 2023. Contains 363042 sequences. (Running on oeis4.)