Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Number of Lucas numbers (A000032) <= n.
16

%I #29 Sep 08 2022 08:45:30

%S 0,1,2,3,4,4,4,5,5,5,5,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8,

%T 8,8,8,8,8,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,

%U 9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10

%N Number of Lucas numbers (A000032) <= n.

%C Partial sums of the Lucas indicator sequence A102460.

%C For n>=2, we have a(A000032(n)) = n + 1.

%H Antti Karttunen, <a href="/A130245/b130245.txt">Table of n, a(n) for n = 0..64079</a>

%H Dorin Andrica, Ovidiu Bagdasar, and George Cătălin Tųrcąs, <a href="https://doi.org/10.2478/auom-2021-0002">On some new results for the generalised Lucas sequences</a>, An. Şt. Univ. Ovidius Constanţa (Romania, 2021) Vol. 29, No. 1, 17-36.

%F a(n) = 1 +floor(log_phi((n+sqrt(n^2+4))/2)) = 1 +floor(arcsinh(n/2)/log(phi)) for n>=2, where phi = (1+sqrt(5))/2.

%F a(n) = A130241(n)+1 = A130242(n+1) for n>=2.

%F G.f.: g(x) = 1/(1-x)*sum{k>=0, x^Lucas(k)}.

%F a(n) = 1 +floor(log_phi(n+1/2)) for n>=1, where phi is the golden ratio.

%e a(9)=5 because there are 5 Lucas numbers <=9 (2,1,3,4 and 7).

%t Join[{0}, Table[1+Floor[Log[GoldenRatio, (2*n+1)/2]], {n,1,100}]] (* _G. C. Greubel_, Sep 09 2018 *)

%o (PARI)

%o 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)); };

%o A130245(n) = if(!n,n,A102460(n)+A130245(n-1));

%o \\ Or just as:

%o c=0; for(n=0,123,c += A102460(n); print1(c,", ")); \\ _Antti Karttunen_, May 13 2018

%o (Magma) [0] cat [1+Floor(Log((2*n+1)/2)/Log((1+Sqrt(5))/2)): n in [1..100]]; // _G. C. Greubel_, Sep 09 2018

%o (Python)

%o from itertools import count, islice

%o def A130245_gen(): # generator of terms

%o yield from (0, 1, 2)

%o a, b = 3,4

%o for i in count(3):

%o yield from (i,)*(b-a)

%o a, b = b, a+b

%o A130245_list = list(islice(A130245_gen(),40)) # _Chai Wah Wu_, Jun 08 2022

%Y Partial sums of A102460.

%Y For partial sums of this sequence, see A130246. Other related sequences: A000032, A130241, A130242, A130247, A130249, A130253, A130255, A130259.

%Y For Fibonacci inverse, see A130233 - A130240, A104162, A108852.

%K nonn

%O 0,3

%A _Hieronymus Fischer_, May 19 2007, Jul 02 2007