A010056 Characteristic function of Fibonacci numbers: a(n) = 1 if n is a Fibonacci number, otherwise 0.
1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 0
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
- Jean-Paul Allouche, Julien Cassaigne, Jeffrey Shallit, and Luca Q. Zamboni, A Taxonomy of Morphic Sequences, arXiv preprint arXiv:1711.10807 [cs.FL], Nov 29 2017.
- D. Bailey et al., On the binary expansions of algebraic numbers, Journal de Théorie des Nombres de Bordeaux (2004), Volume: 16, Issue: 3, page 487-518.
- Wikipedia, Fibonacci number
- Index entries for characteristic functions
Crossrefs
Decimal expansion of Fibonacci binary is in A084119.
Sequences mentioned in the Allouche et al. "Taxonomy" paper, listed by example number: 1: A003849, 2: A010060, 3: A010056, 4: A020985 and A020987, 5: A191818, 6: A316340 and A273129, 18: A316341, 19: A030302, 20: A063438, 21: A316342, 22: A316343, 23: A003849 minus its first term, 24: A316344, 25: A316345 and A316824, 26: A020985 and A020987, 27: A316825, 28: A159689, 29: A049320, 30: A003849, 31: A316826, 32: A316827, 33: A316828, 34: A316344, 35: A043529, 36: A316829, 37: A010060.
Cf. A079586 (Dirich. g.f. at s=1).
Programs
-
Haskell
import Data.List (genericIndex) a010056 = genericIndex a010056_list a010056_list = 1 : 1 : ch [2..] (drop 3 a000045_list) where ch (x:xs) fs'@(f:fs) = if x == f then 1 : ch xs fs else 0 : ch xs fs' -- Reinhard Zumkeller, Oct 10 2013
-
Maple
a:= n-> (t-> `if`(issqr(t+4) or issqr(t-4), 1, 0))(5*n^2): seq(a(n), n=0..144); # Alois P. Heinz, Dec 06 2020
-
Mathematica
Join[{1},With[{fibs=Fibonacci[Range[15]]},If[MemberQ[fibs,#],1,0]& /@Range[100]]] (* Harvey P. Dale, May 02 2011 *)
-
PARI
a(n)=my(k=n^2);k+=(k+1)<<2; issquare(k) || (n>0 && issquare(k-8)) \\ Charles R Greathouse IV, Jul 30 2012
-
Python
from sympy.ntheory.primetest import is_square def A010056(n): return int(is_square(m:=5*n**2-4) or is_square(m+8)) # Chai Wah Wu, Mar 30 2023
Formula
G.f.: (Sum_{k>=0} x^A000045(k)) - x. - Hieronymus Fischer, May 17 2007
Comments