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.

A067395 First differences of A067368.

This page as a plain text file.
%I A067395 #11 Feb 18 2025 08:58:57
%S A067395 4,4,4,2,2,4,4,4,4,4,4,4,2,2,4,4,4,4,4,4,4,2,2,4,4,4,4,4,4,4,2,2,4,4,
%T A067395 4,2,2,4,4,4,2,2,4,4,4,4,4,4,4,2,2,4,4,4,4,4,4,4,2,2,4,4,4,4,4,4,4,2,
%U A067395 2,4,4,4,4,4,4,4,2,2,4,4,4,4,4,4,4,2,2,4,4,4,4,4,4,4,2,2,4,4,4,4,4,4,4,2,2
%N A067395 First differences of A067368.
%C A067395 See A067396 for the locations of the four consecutive terms {...,4,2,2,4,...} in this sequence.
%C A067395 The asymptotic density of the occurrences of k = 2 and 4 is 1/4 and 3/4, respectively. The asymptotic mean of this sequence is 7/2. - _Amiram Eldar_, May 31 2024
%o A067395 (Python)
%o A067395 def A067395(n):
%o A067395     def iterfun(f,n=0):
%o A067395         m, k = n, f(n)
%o A067395         while m != k: m, k = k, f(k)
%o A067395         return m
%o A067395     def f(x): return x-sum(((x>>i)-1>>1)+1 for i in range(0,x.bit_length(),3))
%o A067395     return iterfun(lambda x:f(x)+n+1,n+1)-iterfun(lambda x:f(x)+n,n)<<1 # _Chai Wah Wu_, Feb 17 2025
%Y A067395 Cf. A067368, A067396.
%K A067395 nonn
%O A067395 1,1
%A A067395 _John W. Layman_, Jan 22 2002