cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A130245 Number of Lucas numbers (A000032) <= n.

Original entry on oeis.org

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, 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, 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
Offset: 0

Views

Author

Hieronymus Fischer, May 19 2007, Jul 02 2007

Keywords

Comments

Partial sums of the Lucas indicator sequence A102460.
For n>=2, we have a(A000032(n)) = n + 1.

Examples

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

Crossrefs

Partial sums of A102460.
For partial sums of this sequence, see A130246. Other related sequences: A000032, A130241, A130242, A130247, A130249, A130253, A130255, A130259.
For Fibonacci inverse, see A130233 - A130240, A104162, A108852.

Programs

  • 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
    
  • Mathematica
    Join[{0}, Table[1+Floor[Log[GoldenRatio, (2*n+1)/2]], {n,1,100}]] (* G. C. Greubel, Sep 09 2018 *)
  • 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)); };
    A130245(n) = if(!n,n,A102460(n)+A130245(n-1));
    \\ Or just as:
    c=0; for(n=0,123,c += A102460(n); print1(c,", ")); \\ Antti Karttunen, May 13 2018
    
  • Python
    from itertools import count, islice
    def A130245_gen(): # generator of terms
        yield from (0, 1, 2)
        a, b = 3,4
        for i in count(3):
            yield from (i,)*(b-a)
            a, b = b, a+b
    A130245_list = list(islice(A130245_gen(),40)) # Chai Wah Wu, Jun 08 2022

Formula

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.
a(n) = A130241(n)+1 = A130242(n+1) for n>=2.
G.f.: g(x) = 1/(1-x)*sum{k>=0, x^Lucas(k)}.
a(n) = 1 +floor(log_phi(n+1/2)) for n>=1, where phi is the golden ratio.
Sum_{n>=1} (-1)^(n+1)/a(n) = 3/2 - Pi/(6*sqrt(3)) - log(3)/2. - Amiram Eldar, Jul 25 2025