A102460 a(n) = 1 if n is a Lucas number, else a(n) = 0.
0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
Offset: 0
Keywords
Links
- Antti Karttunen, Table of n, a(n) for n = 0..65537
- Casey Mongoven, Lucas Binary no. 1; electronic music created with this sequence.
- Index entries for characteristic functions
Crossrefs
Programs
-
Mathematica
{0}~Join~ReplacePart[ConstantArray[0, Last@ #], Map[# -> 1 &, #]] &@ Array[LucasL, 11, 0] (* Michael De Vlieger, Nov 22 2017 *) With[{nn=130,lc=LucasL[Range[0,20]]},Table[If[MemberQ[lc,n],1,0],{n,0,nn}]] (* Harvey P. Dale, Jul 03 2022 *)
-
PARI
a(n)=my(f=factor(25*'x^4-10*n^2*'x^2+n^4-16)[,1]); sum(i=1,#f, poldegree(f[i])==1 && polcoeff(f[i],0)<=0) \\ Charles R Greathouse IV, Nov 06 2014
-
PARI
A102460(n) = { my(u1=1,u2=3,old_u1); if(n<=2,sign(n),while(n>u2,old_u1=u1;u1=u2;u2=old_u1+u2);(u2==n)); }; \\ Antti Karttunen, Nov 22 2017
-
Python
from sympy.ntheory.primetest import is_square def A102460(n): return int(is_square(m:=5*(n**2-4)) or is_square(m+40)) # Chai Wah Wu, Jun 13 2024
Formula
From Hieronymus Fischer, Jul 02 2007: (Start)
G.f.: g(x) = Sum_{k>=0} x^A000032(k).
a(n) = 1+floor(arcsinh(n/2)/log(phi))-ceiling(arccosh(n/2)/log(phi)) for n>=3, where phi=(1+sqrt(5))/2.
Extensions
Data section extended up to a(123) by Antti Karttunen, Nov 22 2017
Comments