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-10 of 13 results. Next

A074048 Pentanacci numbers with initial conditions a(0)=5, a(1)=1, a(2)=3, a(3)=7, a(4)=15.

Original entry on oeis.org

5, 1, 3, 7, 15, 31, 57, 113, 223, 439, 863, 1695, 3333, 6553, 12883, 25327, 49791, 97887, 192441, 378329, 743775, 1462223, 2874655, 5651423, 11110405, 21842481, 42941187, 84420151, 165965647, 326279871, 641449337, 1261056193, 2479171199, 4873922247
Offset: 0

Views

Author

Mario Catalani (mario.catalani(AT)unito.it), Aug 14 2002

Keywords

Comments

These pentanacci numbers follow the same pattern as Lucas, generalized tribonacci(A001644) and generalized tetranacci (A073817) numbers: Binet's formula is a(n)=r1^n+r^2^n+r3^n+r4^n+r5^n, with r1, r2, r3, r4, r5 roots of the characteristic polynomial. a(n) is also the trace of A^n, where A is the pentamatrix ((1,1,0,0,0),(1,0,1,0,0),(1,0,0,1,0),(1,0,0,0,1),(1,0,0,0,0)).
For n >= 5, a(n) is the number of cyclic sequences consisting of n zeros and ones that do not contain five consecutive ones provided the positions of the zeros and ones are fixed on a circle. This is proved in Charalambides (1991) and Zhang and Hadjicostas (2015). (For n=1,2,3,4 the statement is still true provided we allow the sequence to wrap around itself on a circle). - Petros Hadjicostas, Dec 18 2016
a(3407) has 1001 decimal digits. - Michael De Vlieger, Dec 28 2016

Crossrefs

Cf. A000078, A001630, A001644, A000032, A073817, A106297 (Pisano Periods).
Essentially the same as A023424.
Cf. A106273.

Programs

  • Mathematica
    CoefficientList[Series[(5-4*x-3*x^2-2*x^3-x^4)/(1-x-x^2-x^3-x^4-x^5), {x, 0, 30}], x]
    LinearRecurrence[{1, 1, 1, 1, 1}, {5, 1, 3, 7, 15}, 60] (* Vladimir Joseph Stephan Orlovsky, Feb 08 2012 *)
  • PARI
    polsym(polrecip(1-x-x^2-x^3-x^4-x^5),33) \\ Joerg Arndt, Jan 28 2019

Formula

a(n) = a(n-1) +a(n-2) +a(n-3) +a(n-4) +a(n-5).
G.f.: (5-4*x-3*x^2-2*x^3-x^4) / (1-x-x^2-x^3-x^4-x^5).
a(n) = 2*a(n-1) -a(n-6), n>5. [Vincenzo Librandi, Dec 20 2010]
For k>0 and n>=0, a(n+5*k) = a(k)*a(n+4*k) - A123127(k-1)*a(n+3*k) + A123126(k-1)*a(n+2*k) - A074062(k)*a(n+k) + a(n). For example, if k=4, n=3, we have a(n+5*k) = a(23) = 5651423, a(4)*a(19) - A123127(3)*a(15) + A123126(3)*a(1695) - A074062(4)*a(7) + a(3) = (15)*(378329) - (1)*(25327) + (1)*(1695) - (-1)*(113) + (7) = 5651423. - Kai Wang, Sep 13 2020
From Kai Wang, Dec 16 2020: (Start)
For k >= 0,
| a(k+4) a(k+5) a(k+6) a(k+7) a(k+8) |
| a(k+3) a(k+4) a(k+5) a(k+6) a(k+7) |
det | a(k+2) a(k+3) a(k+4) a(k+5) a(k+6) | = 9584 = A106273(5).
| a(k+1) a(k+2) a(k+3) a(k+4) a(k+5) |
| a(k) a(k+1) a(k+2) a(k+3) a(k+4) |
(End)

A106291 Period of the Lucas sequence A000032 mod n.

Original entry on oeis.org

1, 3, 8, 6, 4, 24, 16, 12, 24, 12, 10, 24, 28, 48, 8, 24, 36, 24, 18, 12, 16, 30, 48, 24, 20, 84, 72, 48, 14, 24, 30, 48, 40, 36, 16, 24, 76, 18, 56, 12, 40, 48, 88, 30, 24, 48, 32, 24, 112, 60, 72, 84, 108, 72, 20, 48, 72, 42, 58, 24, 60, 30, 48, 96, 28, 120, 136, 36, 48, 48
Offset: 1

Views

Author

T. D. Noe, May 02 2005

Keywords

Comments

This sequence differs from the Fibonacci periods (A001175) only when n is a multiple of 5, which can be traced to 5 being the discriminant of the characteristic polynomial x^2-x-1.
This sequence coincides with the Fibonacci periods (A001175) if n is a multiple of 5^j and the following conditions apply: n contains at least one prime factor of the form p = 10*k+1 (A030430) which occurs in Fibonacci(m) or Lucas(m) as prime factor, where m must be the smallest possible index containing p and a factor 5^i and j <= i. If n contains several prime factors from A030430 that satisfy the above conditions, the largest applicable i is decisive. - Klaus Purath, Apr 26 2019

Examples

			From _Klaus Purath_, Jul 10 2019: (Start)
n = 3*5*31 = 465, j = 1; L(15) is the smallest Lucas number with prime factor 31; 15 = 3*5, i = 1 = j. Hence Lucas period (mod 465) = Fibonacci period (mod 465) = 120, but if n = 3*5^2*31 = 2325, j = 2 > i. Hence Lucas period (mod 2325) = 120 < Fibonacci period (mod 2325) = 600.
n = 5*701 = 3505, j = 1; F(175) is the smallest Fibonacci number with prime factor 701; 175 = 7*5^2, i = 2 > j. Therefore Lucas period (mod 3505) = Fibonacci period (mod 3505) = 700, but if n = 5^3*701 = 87625, j = 3 > i. Therefore Lucas period (mod 87625) = 700 < Fibonacci period (mod 87625) = 3500.
n = 5^2*11*101 = 27775, j =2; L(5) is the smallest Lucas number with prime factor 11, i = 1; L(25) = is the smallest Lucas number with prime factor 101; 25 = 5^2, i = 2 ( decisive); j = i. Hence Lucas period (mod 27775) = Fibonacci period (mod 27775) = 100, but if n = 5^3*11*101 = 138875, j = 3 > i. Hence Lucas period (mod 138875) = 100 < Fibonacci period (mod 138875) = 500. (End)
		

References

  • S. Vajda, Fibonacci and Lucas numbers and the Golden Section, Ellis Horwood Ltd., Chichester, 1989. See p. 89. - From N. J. A. Sloane, Feb 20 2013

Crossrefs

Cf. A106273 (discriminant of the polynomial x^n-x^(n-1)-...-x-1).

Programs

  • Mathematica
    n=2; Table[p=i; a=Join[Table[ -1, {n-1}], {n}]; a=Mod[a, p]; a0=a; k=0; While[k++; s=Mod[Plus@@a, p]; a=RotateLeft[a]; a[[n]]=s; a!=a0]; k, {i, 70}]
  • Python
    from math import lcm
    from functools import lru_cache
    from sympy import factorint
    @lru_cache(maxsize=None)
    def A106291(n):
        if n < 3:
            return (n<<1)-1
        f = factorint(n).items()
        if len(f) > 1:
            return lcm(*(A106291(a**b) for a,b in f))
        else:
            k,x = 1, (1,3)
            while x != (2,1):
                k += 1
                x = (x[1], (x[0]+x[1]) % n)
            return k # Chai Wah Wu, Apr 25 2025
  • Sage
    def a(n): return BinaryRecurrenceSequence(1, 1, 2, 1).period(n)
    [a(n) for n in (1..100)] # G. C. Greubel, Apr 27 2019
    

Formula

Let the prime factorization of n be p1^e1...pk^ek. Then a(n) = lcm(a(p1^e1), ..., a(pk^ek)).

A106303 Period of the Fibonacci 5-step sequence A001591 mod n.

Original entry on oeis.org

1, 6, 104, 12, 781, 312, 2801, 24, 312, 4686, 16105, 312, 30941, 16806, 81224, 48, 88741, 312, 13032, 9372, 291304, 96630, 12166, 312, 3905, 185646, 936, 33612, 70728, 243672, 190861, 96, 1674920, 532446, 2187581, 312, 1926221, 13032
Offset: 1

Views

Author

T. D. Noe, May 02 2005

Keywords

Comments

This sequence can differ from the corresponding Lucas sequence (A106297) only when n is a multiple of 2 or 599 because 9584 is the discriminant of the characteristic polynomial x^5-x^4-x^3-x^2-x-1 and the prime factors of 9584 are 2 and 599. [Corrected by Avery Diep, Aug 25 2025]

Crossrefs

Cf. A001591, A106273 (discriminant of the polynomial x^n-x^(n-1)-...-x-1), A106297 (period of Lucas 5-step sequence mod n).

Programs

  • Mathematica
    n=5; Table[p=i; a=Join[{1}, Table[0, {n-1}]] a=Mod[a, p]; a0=a; k=0; While[k++; s=Mod[Plus@@a, p]; a=RotateLeft[a]; a[[n]]=s; a!=a0]; k, {i, 50}]
  • Python
    from itertools import count
    def A106303(n):
        a = b = (0,)*4+(1 % n,)
        s = 1 % n
        for m in count(1):
            b, s = b[1:] + (s,), (s+s-b[0]) % n
            if a == b:
                return m # Chai Wah Wu, Feb 21-27 2022

Formula

Let the prime factorization of n be p1^e1...pk^ek. Then a(n) = lcm(a(p1^e1), ..., a(pk^ek)).
Conjectures: a(5^k) = 781*5^(k-1) for k > 0. If a(p) != a(p^2) for p prime, then a(p^k) = p^(k-1)*a(p) for k > 0. - Chai Wah Wu, Feb 25 2022

A106295 Period of the Lucas 4-step sequence A073817 mod n.

Original entry on oeis.org

1, 5, 26, 10, 312, 130, 342, 20, 78, 1560, 120, 130, 84, 1710, 312, 40, 4912, 390, 6858, 1560, 4446, 120, 12166, 260, 1560, 420, 234, 1710, 280, 1560, 61568, 80, 1560, 24560, 17784, 390, 1368, 34290, 1092, 1560, 240, 22230, 162800, 120, 312, 60830, 103822
Offset: 1

Views

Author

T. D. Noe, May 02 2005

Keywords

Comments

This sequence is the same as the period of Fibonacci 4-step sequence (A000078) mod n for n<563 because the discriminant of the characteristic polynomial x^4-x^3-x^2-x-1 is -563. The two sequences differ only at n that are multiples of 563.

Crossrefs

Cf. A000078, A073817, A106273 (discriminant of the polynomial x^n-x^(n-1)-...-x-1).

Programs

  • Mathematica
    n=4; Table[p=i; a=Join[Table[ -1, {n-1}], {n}]; a=Mod[a, p]; a0=a; k=0; While[k++; s=Mod[Plus@@a, p]; a=RotateLeft[a]; a[[n]]=s; a!=a0]; k, {i, 60}]
  • Python
    from itertools import count
    def A106295(n):
        a = b = (4%n,1%n,3%n,7%n)
        s = sum(b) % n
        for m in count(1):
            b, s = b[1:] + (s,), (s+s-b[0]) % n
            if a == b:
                return m # Chai Wah Wu, Feb 22-27 2022

Formula

Let the prime factorization of n be p1^e1...pk^ek. Then a(n) = lcm(a(p1^e1), ..., a(pk^ek)).
a(2^k) = 5*2^(k-1) for k > 0. If a(p) != a(p^2) for p prime, then a(p^k) = p^(k-1)*a(p) for k > 0 [Waddill, 1992]. - Chai Wah Wu, Feb 25 2022

A106302 Period of the Fibonacci 3-step sequence A000073 mod prime(n).

Original entry on oeis.org

4, 13, 31, 48, 110, 168, 96, 360, 553, 140, 331, 469, 560, 308, 46, 52, 3541, 1860, 1519, 5113, 5328, 3120, 287, 8011, 3169, 680, 51, 1272, 990, 12883, 5376, 5720, 18907, 3864, 7400, 2850, 8269, 162, 9296, 2494, 32221, 10981, 36673, 4656, 3234, 198, 5565
Offset: 1

Views

Author

T. D. Noe, May 02 2005, Sep 18 2008

Keywords

Comments

This sequence differs from the corresponding Lucas sequence (A106294) at n=1 and 5 because these correspond to the primes 2 and 11, which are the prime factors of -44, the discriminant of the characteristic polynomial x^3-x^2-x-1. We have a(n) < prime(n) for the primes in A106279.

Crossrefs

Programs

  • Mathematica
    n=3; Table[p=Prime[i]; a=Join[{1},Table[0,{n-1}]]; a=Mod[a,p]; a0=a; k=0; While[k++; s=Mod[Plus@@a, p]; a=RotateLeft[a]; a[[n]]=s; a!=a0]; k, {i,60}]
  • Python
    from itertools import count
    from sympy import prime
    def A106302(n):
        a = b = (0,)*2+(1 % (p:= prime(n)),)
        for m in count(1):
            b = b[1:] + (sum(b) % p,)
            if a == b:
                return m # Chai Wah Wu, Feb 27 2022

Formula

a(n) = A046738(prime(n)).

A106276 Number of distinct zeros of x^3-x^2-x-1 mod prime(n).

Original entry on oeis.org

1, 0, 0, 1, 2, 1, 1, 1, 0, 1, 0, 0, 1, 1, 3, 3, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 3, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 3, 1, 1, 0, 0, 0, 1, 1, 3, 1, 0, 1, 0, 1, 1, 1, 0, 3, 1, 3, 1, 1, 1, 1, 1, 1, 3, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 3, 3, 1, 3, 3, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 3, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1
Offset: 1

Views

Author

T. D. Noe, May 02 2005

Keywords

Comments

This polynomial is the characteristic polynomial of the Fibonacci and Lucas 3-step recursions, A000073 and A001644. Similar polynomials are treated in Serre's paper. The discriminant of the polynomial is -44 = -4*11. The primes p yielding 3 distinct zeros, A106279, correspond to the periods of the sequences A000073(k) mod p and A001644(k) mod p having length less than p. The Lucas 3-step sequence mod p has two additional primes p for which the period is less than p: 2 and 11, which are factors of the discriminant -44. For p=11, the Fibonacci 3-step sequence mod p has a period of p(p-1).

Crossrefs

Cf. A106273 (discriminant of the polynomial x^n-x^(n-1)-...-x-1), A106293 (period of the Lucas 3-step sequences mod prime(n)), A106282 (prime moduli for which the polynomial is irreducible).

Programs

  • Mathematica
    Table[p=Prime[n]; cnt=0; Do[If[Mod[x^3-x^2-x-1, p]==0, cnt++ ], {x, 0, p-1}]; cnt, {n, 150}]

A106293 Period of the Lucas 3-step sequence A001644 mod n.

Original entry on oeis.org

1, 1, 13, 4, 31, 13, 48, 8, 39, 31, 10, 52, 168, 48, 403, 16, 96, 39, 360, 124, 624, 10, 553, 104, 155, 168, 117, 48, 140, 403, 331, 32, 130, 96, 1488, 156, 469, 360, 2184, 248, 560, 624, 308, 20, 1209, 553, 46, 208, 336, 155, 1248, 168, 52, 117, 310, 48, 4680, 140
Offset: 1

Views

Author

T. D. Noe, May 02 2005

Keywords

Comments

This sequence can differ from the corresponding Fibonacci sequence (A046738) only when n is a multiple of 2 or 11 because the discriminant of the characteristic polynomial x^3-x^2-x-1 is -44. [Clarified by Avery Diep, Aug 22 2025]
a(n) divides A046738(n). - Avery Diep, Aug 22 2025

Crossrefs

Cf. A046738 (period of Fibonacci 3-step sequence mod n), A106273 (discriminant of the polynomial x^n-x^(n-1)-...-x-1).

Programs

  • Mathematica
    n=3; Table[p=i; a=Join[Table[ -1, {n-1}], {n}]; a=Mod[a, p]; a0=a; k=0; While[k++; s=Mod[Plus@@a, p]; a=RotateLeft[a]; a[[n]]=s; a!=a0]; k, {i, 60}]

Formula

Let the prime factorization of n be p1^e1...pk^ek. Then a(n) = lcm(a(p1^e1), ..., a(pk^ek)).

A106297 Period of the Lucas 5-step sequence A074048 mod n.

Original entry on oeis.org

1, 1, 104, 6, 781, 104, 2801, 12, 312, 781, 16105, 312, 30941, 2801, 81224, 24, 88741, 312, 13032, 4686, 291304, 16105, 12166, 312, 3905, 30941, 936, 16806, 70728, 81224, 190861, 48, 1674920, 88741, 2187581, 312, 1926221, 13032, 3217864, 9372, 2896405
Offset: 1

Views

Author

T. D. Noe, May 02 2005, Nov 19 2006

Keywords

Comments

This sequence can differ from the corresponding Fibonacci sequence (A106303) only when n is a multiple of 2 or 599 because 9584 is the discriminant of the characteristic polynomial x^5-x^4-x^3-x^2-x-1 and the prime factors of 9584 are 2 and 599. [corrected by Avery Diep, Aug 25 2025]
a(n) divides A106303(n). - Avery Diep, Aug 25 2025

Crossrefs

Cf. A074048, A106303 (period of Fibonacci 5-step sequence mod n), A106273 (discriminant of the polynomial x^n-x^(n-1)-...-x-1).

Programs

  • Mathematica
    n=5; Table[p=i; a=Join[Table[ -1, {n-1}], {n}]; a=Mod[a, p]; a0=a; k=0; While[k++; s=Mod[Plus@@a, p]; a=RotateLeft[a]; a[[n]]=s; a!=a0]; k, {i, 50}]
  • Python
    from itertools import count
    def A106297(n):
        a = b = (5%n,1%n,7%n,3%n,15%n)
        s = sum(b) % n
        for m in count(1):
            b, s = b[1:] + (s,), (s+s-b[0]) % n
            if a == b:
                return m # Chai Wah Wu, Feb 22-27 2022

Formula

Let the prime factorization of n be p1^e1...pk^ek. Then a(n) = lcm(a(p1^e1), ..., a(pk^ek)).
Conjectures: a(5^k) = 781*5^(k-1) for k > 0. a(2^k) = 3*2^(k-1) for k > 1. If a(p) != a(p^2) for prime p > 2, then a(p^k) = p^(k-1)*a(p) for k > 0. - Chai Wah Wu, Feb 25 2022

A106294 Period of the Lucas 3-step sequence A001644 mod prime(n).

Original entry on oeis.org

1, 13, 31, 48, 10, 168, 96, 360, 553, 140, 331, 469, 560, 308, 46, 52, 3541, 1860, 1519, 5113, 5328, 3120, 287, 8011, 3169, 680, 51, 1272, 990, 12883, 5376, 5720, 18907, 3864, 7400, 2850, 8269, 162, 9296, 2494, 32221, 10981, 36673, 4656, 3234, 198, 5565
Offset: 1

Views

Author

T. D. Noe, May 02 2005

Keywords

Comments

This sequence differs from the corresponding Fibonacci sequence (A106302) at n=1 and 5 because these correspond to the primes 2 and 11, which are the prime factors of -44, the discriminant of the characteristic polynomial x^3-x^2-x-1. We have a(n) < prime(n) for the primes 2, 11 and A106279.
For a prime p, the period depends on the zeros of x^3-x^2-x-1 mod p. If there are 3 zeros, then the period is < p. If there are no zeros, then the period is p^2+p+1 or a simple fraction of p^2+p+1. Also note that the period can be prime, as for p=3, 5, 31, 59, 71, 89, 97, 157, 223. When the period is prime, the orbits have a simple structure. [From T. D. Noe, Sep 18 2008]

Crossrefs

Programs

  • Mathematica
    n=3; Table[p=Prime[i]; a=Join[Table[ -1, {n-1}], {n}]; a=Mod[a, p]; a0=a; k=0; While[k++; s=Mod[Plus@@a, p]; a=RotateLeft[a]; a[[n]]=s; a!=a0]; k, {i, 60}]

Formula

a(n) = A106293(prime(n)).

A106296 Period of the Lucas 4-step sequence A073817 mod prime(n).

Original entry on oeis.org

5, 26, 312, 342, 120, 84, 4912, 6858, 12166, 280, 61568, 1368, 240, 162800, 103822, 303480, 205378, 226980, 100254, 357910, 2664, 998720, 1157520, 9320, 368872, 1030300, 10608, 1225042, 2614040, 13874, 2048382, 4530768, 136, 772880, 3307948
Offset: 1

Views

Author

T. D. Noe, May 02 2005

Keywords

Comments

This sequence is the same as the period of Fibonacci 4-step sequence (A000078) mod prime(n) except for n=103, which corresponds to the prime 563 because the discriminant of the characteristic polynomial x^4-x^3-x^2-x-1 is -563. We have a(n) < prime(n) for primes 563 and A106280.

Crossrefs

Cf. A106273 (discriminant of the polynomial x^n-x^(n-1)-...-x-1), A106280 (primes p such that x^4-x^3-x^2-x-1 mod p has 4 distinct zeros), A106295.

Programs

  • Mathematica
    n=4; Table[p=Prime[i]; a=Join[Table[ -1, {n-1}], {n}]; a=Mod[a, p]; a0=a; k=0; While[k++; s=Mod[Plus@@a, p]; a=RotateLeft[a]; a[[n]]=s; a!=a0]; k, {i, 60}]

Formula

a(n) = A106295(prime(n)).
Showing 1-10 of 13 results. Next