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.

A182577 Number of ones in Zeckendorf representation of n!

This page as a plain text file.
%I A182577 #13 Jun 15 2018 11:38:38
%S A182577 1,1,1,2,2,4,3,5,6,9,8,11,11,11,16,17,17,18,23,23,28,31,33,27,33,29,
%T A182577 40,37,42,42,41,44,47,44,53,56,57,50,64,55,59,68,63,72,70,61,69,85,80,
%U A182577 83,87,97,98,101,87,91,100,102,114,108,116,109,117,117,113,124
%N A182577 Number of ones in Zeckendorf representation of n!
%H A182577 Chai Wah Wu, <a href="/A182577/b182577.txt">Table of n, a(n) for n = 0..10000</a>
%e A182577 5! = {1, 0, 0, 1, 0, 1, 0, 0, 1, 0} in the Zeckendorf base.
%o A182577 (Python)
%o A182577 from math import factorial
%o A182577 def A182577(n):
%o A182577     m, tlist, s = factorial(n), [1,2], 0
%o A182577     while tlist[-1]+tlist[-2] <= m:
%o A182577         tlist.append(tlist[-1]+tlist[-2])
%o A182577     for d in tlist[::-1]:
%o A182577         if d <= m:
%o A182577             s += 1
%o A182577             m -= d
%o A182577     return s # _Chai Wah Wu_, Jun 15 2018
%Y A182577 Cf. A007895, A020908, A020910, A025496-A025502, A182535, A182576, A000142.
%K A182577 nonn
%O A182577 0,4
%A A182577 _Alex Ratushnyak_, May 05 2012