login
Non-Lucas numbers: complement of A000204.
13

%I #31 Sep 10 2024 11:04:02

%S 0,2,5,6,8,9,10,12,13,14,15,16,17,19,20,21,22,23,24,25,26,27,28,30,31,

%T 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,48,49,50,51,52,53,54,55,

%U 56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,77,78,79

%N Non-Lucas numbers: complement of A000204.

%H G. C. Greubel, <a href="/A090946/b090946.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = A057854(n-2), n>2. - _R. J. Mathar_, Jan 29 2019

%p L[1]:=1: L[2]:=3: for n from 3 to 10 do L[n]:=L[n-1]+L[n-2] od: A:={seq(L[n],n=1..10)}: B:={seq(n,n=0..L[10])}: C:=B minus A; # _Emeric Deutsch_, Dec 14 2004

%t Complement[Range[0,100],LucasL[Range[10]]] (* _Harvey P. Dale_, Mar 21 2012 *)

%o (Python)

%o def A090946(n):

%o if n == 1: return 0

%o def f(x):

%o if x<=2: return n

%o a, b, c = 1, 3, 0

%o while b<=x:

%o a, b = b, a+b

%o c += 1

%o return n+c

%o m, k = n, f(n)

%o while m != k: m, k = k, f(k)

%o return m # _Chai Wah Wu_, Sep 10 2024

%Y Cf. A000032, A000204, A022801.

%K nonn,easy

%O 1,2

%A _N. J. A. Sloane_, Feb 28 2004

%E More terms from _Emeric Deutsch_, Dec 14 2004

%E Offset corrected by _Michel Marcus_, Aug 15 2017