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.

A245710 Number of nonzero evil numbers <= n, see A001969.

This page as a plain text file.
%I A245710 #17 Mar 01 2023 19:22:46
%S A245710 0,0,0,1,1,2,3,3,3,4,5,5,6,6,6,7,7,8,9,9,10,10,10,11,12,12,12,13,13,
%T A245710 14,15,15,15,16,17,17,18,18,18,19,20,20,20,21,21,22,23,23,24,24,24,25,
%U A245710 25,26,27,27,27,28,29,29,30,30,30,31,31,32,33,33,34,34,34,35,36
%N A245710 Number of nonzero evil numbers <= n, see A001969.
%H A245710 Michael De Vlieger, <a href="/A245710/b245710.txt">Table of n, a(n) for n = 0..10000</a>
%H A245710 Hsien-Kuei Hwang, Svante Janson, and Tsung-Hsi Tsai, <a href="https://arxiv.org/abs/2210.10968">Identities and periodic oscillations of divide-and-conquer recurrences splitting at half</a>, arXiv:2210.10968 [cs.DS], 2022, p. 52.
%F A245710 a(0) = 0, and for n >= 1, a(n) = A010059(n) + a(n-1). [Partial sums of A010059, after ignoring the first one at zero].
%F A245710 a(n) = n  - A115384(n).
%F A245710 a(n) = A159481(n)-1.
%t A245710 Join[{0},Accumulate[Table[If[EvenQ[DigitCount[n,2,1]],1,0],{n,80}]]] (* _Harvey P. Dale_, Aug 01 2021 *)
%o A245710 (Scheme, two alternative implementations)
%o A245710 ;; With memoizing definec-macro:
%o A245710 (definec (A245710 n) (if (zero? n) n (+ (A010059 n) (A245710 (- n 1)))))
%o A245710 (define (A245710 n) (- n (A115384 n)))
%o A245710 (Python)
%o A245710 def A245710(n): return (n+1>>1)-((n+1).bit_count()&1&(n+1)^1) # _Chai Wah Wu_, Mar 01 2023
%Y A245710 One less than A159481.
%Y A245710 Cf. A001969, A010059, A115384, A246159, A246162.
%K A245710 nonn
%O A245710 0,6
%A A245710 _Antti Karttunen_, Aug 18 2014