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.

Showing 1-1 of 1 results.

A375089 Number of positive integers with Pisano period equal to 2n.

Original entry on oeis.org

0, 0, 1, 1, 1, 1, 1, 2, 3, 2, 1, 10, 1, 2, 8, 4, 1, 9, 1, 11, 8, 2, 3, 55, 6, 2, 6, 11, 3, 49, 1, 8, 8, 2, 13, 133, 1, 6, 20, 46, 1, 49, 3, 27, 81, 4, 1, 260, 2, 38, 20, 11, 1, 106, 21, 78, 20, 4, 7, 874, 1, 6, 81, 48, 29, 49, 3, 27, 42, 108, 1, 1319, 3, 14, 174, 23, 13, 101, 1, 444
Offset: 1

Views

Author

Keywords

Comments

a(n) = 0 for all odd values n > 3 since the Pisano period of m is always even except when m=1 or 2.
The Pisano period of m divides n if and only if F_m = 0 (mod n) and F_{m+1} = 1 (mod n), hence n | gcd(F_m,F_{m+1}-1).
Conjecture: If n is of the form 12*5^j (i.e. 2n is of the form 24*5^j which has the unique property that pi(2n)=2n), then a(n) > a(m) for all m < n.
Conjecture: Every natural number appears on this list.

Examples

			a(9) = 3 because the Pisano periods of 76, 38, and 19, but no others, are 2*9=18.
There are no numbers with Pisano period 2 or 4, so a(1) = a(2) = 0.
		

Crossrefs

See A375519 for the "equal to n" version.

Programs

  • Python
    from functools import lru_cache
    from math import gcd, lcm
    from sympy import factorint, divisors, fibonacci
    def A375089(n):
        @lru_cache(maxsize=None)
        def A001175(n):
            if n == 1:
                return 1
            f = factorint(n).items()
            if len(f) > 1:
                return lcm(*(A001175(a**b) for a,b in f))
            else:
                k,x = 1, (1,1)
                while x != (0,1):
                    k += 1
                    x = (x[1], (x[0]+x[1]) % n)
                return k
        a, b = fibonacci((m:=n<<1)+1), fibonacci(m)
        return sum(1 for d in divisors(gcd(a-1,b),generator=True) if A001175(d)==m) # Chai Wah Wu, Aug 28 2024
  • Sage
    def a(n):
        num=0
        if n<3:
            return 0
        x=gcd(fibonacci(2*n),fibonacci(2*n+1)-1)
        for d in divisors(x):
            if BinaryRecurrenceSequence(1,1,0,1).period(d)==2*n:
                num+=1
        return num
    for i in range(1,101):
        print(a(i))
    
Showing 1-1 of 1 results.