A343334 a(1) = 0; thereafter a(n+1) = abs(a(n)-y), where y is the number of numbers m < n such that a(m) = a(n).
0, 0, 1, 1, 0, 2, 2, 1, 1, 2, 0, 3, 3, 2, 1, 3, 1, 4, 4, 3, 0, 4, 2, 2, 3, 1, 5, 5, 4, 1, 6, 6, 5, 3, 2, 4, 0, 5, 2, 5, 1, 7, 7, 6, 4, 1, 8, 8, 7, 5, 0, 6, 3, 3, 4, 2, 6, 2, 7, 4, 3, 5, 1, 9, 9, 8, 6, 1, 10, 10, 9, 7, 3, 6, 0, 7, 2, 8, 5, 2, 9, 6, 1, 11, 11
Offset: 1
Links
- Pontus von Brömssen, Table of n, a(n) for n = 1..10000
Programs
-
Python
def A343334_list(n_max): a=0 a_list=[0] count=[] for i in range(n_max-1): if a==len(count): count.append(0) else: count[a]+=1 a=abs(a-count[a]) a_list.append(a) return a_list
Comments