

A322305


a(0) = 1 & a(1) = 0; for n > 0, a(2n) = a(n) + a(n1); 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 evenindexed numbers in the sequence is the sum of two adjacent terms (taken from the formula for the Fibonacci sequence), while each of the oddindexed numbers is the result of a single iteration of the function similar to the Collatz function; so I call a sequence like this a "Collanacci" sequence. When the sequence is graphed, one can see that it contains a fractal pattern of perfectly symmetric subsequences resembling cathedrals or a cityscape.


LINKS



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[i1])
....if s[i]%2==0:
........s = np.append(s, s[i]//2)
....else:
........s = np.append(s, (3*s[i]1)//2)


CROSSREFS



KEYWORD



AUTHOR



STATUS

approved



