%I #28 Oct 10 2023 12:20:52
%S 1,1,1,1,1,0,1,0,1,0,1,0,1,0,0,1,1,0,1,0,0,0,1,1,1,0,0,0,1,1,1,0,0,0,
%T 0,0,1,0,0,1,1,1,1,0,0,0,1,0,1,0,0,0,1,1,0,1,0,0,1,0,1,0,0,0,0,1,1,0,
%U 0,1,1,0,1,0,0,0,0,1,1,0,1,0,1,0,0,0,0,1,1,0,0,0,0,0,0,0,1,0,0,0,1,1,1
%N Characteristic function of natural numbers with number of divisors equal to a Fibonacci number.
%H Antti Karttunen, <a href="/A122895/b122895.txt">Table of n, a(n) for n = 1..10000</a>
%H <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>
%H <a href="/index/Eu#epf">Index entries for sequences computed from exponents in factorization of n</a>
%F a(n) = A010056(A000005(n)). - _Chayim Lowen_, Aug 01 2015
%t fibQ[n_] := IntegerQ@ Sqrt[5*n^2+4] || IntegerQ@ Sqrt[5*n^2-4]; Boole[ fibQ /@ DivisorSigma[0, Range[103]]] (* _Giovanni Resta_, Mar 10 2017 *)
%o (PARI) isfib(n) = my(k=n^2); k+=(k+1)<<2; issquare(k) || (n>0 && issquare(k-8));
%o a(n) = isfib(numdiv(n)); \\ _Michel Marcus_, Mar 10 2017
%o (Python)
%o from sympy import divisor_count
%o from sympy.ntheory.primetest import is_square
%o def A122895(n): return int(is_square(m:=5*int(divisor_count(n))**2-4) or is_square(m+8)) # _Chai Wah Wu_, Oct 10 2023
%Y Cf. A000005, A010056, A115568, A123193, A123240.
%K easy,nonn
%O 1,1
%A _Giovanni Teofilatto_, Oct 24 2006
%E a(0)=0 removed from data by _Michel Marcus_, Mar 10 2017