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.

A219641 a(n) = n minus (number of 1's in Zeckendorf expansion of n).

This page as a plain text file.
%I A219641 #32 Jul 17 2025 14:46:38
%S A219641 0,0,1,2,2,4,4,5,7,7,8,9,9,12,12,13,14,14,16,16,17,20,20,21,22,22,24,
%T A219641 24,25,27,27,28,29,29,33,33,34,35,35,37,37,38,40,40,41,42,42,45,45,46,
%U A219641 47,47,49,49,50,54,54,55,56,56,58,58,59,61,61,62,63,63,66
%N A219641 a(n) = n minus (number of 1's in Zeckendorf expansion of n).
%C A219641 See A014417 for the Fibonacci number system representation, also known as Zeckendorf expansion.
%H A219641 Antti Karttunen, <a href="/A219641/b219641.txt">Table of n, a(n) for n = 0..10000</a>
%H A219641 Paul Baird-Smith, Alyssa Epstein, Kristen Flint, and Steven J. Miller, <a href="https://arxiv.org/abs/1809.04881">The Zeckendorf Game</a>, arXiv:1809.04881 [math.NT], 2018.
%F A219641 a(n) = n - A007895(n).
%t A219641 zeck = DigitCount[Select[Range[0, 500], BitAnd[#, 2*#] == 0&], 2, 1];
%t A219641 Range[0, Length[zeck]-1] - zeck (* _Jean-François Alcover_, Jan 25 2018 *)
%o A219641 (Scheme) (define (A219641 n) (- n (A007895 n)))
%o A219641 (Python)
%o A219641 from sympy import fibonacci
%o A219641 def a(n):
%o A219641     k=0
%o A219641     x=0
%o A219641     while n>0:
%o A219641         k=0
%o A219641         while fibonacci(k)<=n: k+=1
%o A219641         x+=10**(k - 3)
%o A219641         n-=fibonacci(k - 1)
%o A219641     return str(x).count("1")
%o A219641 print([n - a(n) for n in range(101)]) # _Indranil Ghosh_, Jun 09 2017
%Y A219641 Cf. A007895, A014417. A022342 gives the positions of records, resulting the same sequence with duplicates removed: A219640. A035336 gives the positions  of values that occur only once: A219639. Cf. also A219637, A219642. Analogous sequence for binary system: A011371, for factorial number system: A219651.
%K A219641 nonn
%O A219641 0,4
%A A219641 _Antti Karttunen_, Nov 24 2012