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.
%I A297155 #27 Mar 19 2025 14:26:40 %S A297155 0,0,0,0,0,1,0,0,0,1,0,1,0,1,1,0,0,1,0,1,1,1,0,1,0,1,0,1,0,2,0,0,1,1, %T A297155 1,1,0,1,1,1,0,2,0,1,1,1,0,1,0,1,1,1,0,1,1,1,1,1,0,2,0,1,1,0,1,2,0,1, %U A297155 1,2,0,1,0,1,1,1,1,2,0,1,0,1,0,2,1,1,1,1,0,2,1,1,1,1,1,1,0,1,1,1,0,2,0,1,2 %N A297155 a(1) = a(2) = 0, after which, a(n) = 1+a(n/2) if n is of the form 4k+2, otherwise a(n) = a(A252463(n)). %C A297155 Consider the binary tree illustrated in A005940: If we start from any vertex containing n, computing successive iterations of A252463 until 1 is reached, a(n) gives the number of the numbers of the form 4k+2 (with k >= 1) encountered on the path (i.e., excluding 2 from the count but including the starting n if it is of the form 4k+2). %H A297155 Antti Karttunen, <a href="/A297155/b297155.txt">Table of n, a(n) for n = 1..12000</a> %H A297155 <a href="/index/Pri#prime_indices">Index entries for sequences computed from indices in prime factorization</a> %F A297155 a(n) = A252464(n) - A297113(n). %F A297155 a(n) = A037800(A156552(n)). %F A297155 a(n) = A001221(n) - 1 for all n > 1. - _Velin Yanev_, Mar 26 2019 %o A297155 (PARI) %o A297155 A064989(n) = {my(f); f = factor(n); if((n>1 && f[1,1]==2), f[1,2] = 0); for (i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f)}; %o A297155 A297155(n) = if(n<=2,0,if(n%2,A297155(A064989(n)),(2==(n%4))+A297155(n/2))); %o A297155 (Scheme) %o A297155 ;; With memoization-macro definec. %o A297155 (definec (A297155 n) (cond ((<= n 2) 0) ((= 2 (modulo n 4)) (+ 1 (A297155 (/ n 2)))) (else (A297155 (A252463 n))))) %Y A297155 Cf. A001221, A005940, A037800, A156552, A252463, A252464, A297113. %K A297155 nonn %O A297155 1,30 %A A297155 _Antti Karttunen_, Dec 27 2017