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.

Previous Showing 11-17 of 17 results.

A229339 GCD of all sums of n consecutive Lucas numbers.

Original entry on oeis.org

1, 1, 2, 5, 1, 4, 1, 15, 2, 11, 1, 40, 1, 29, 2, 105, 1, 76, 1, 275, 2, 199, 1, 720, 1, 521, 2, 1885, 1, 1364, 1, 4935, 2, 3571, 1, 12920, 1, 9349, 2, 33825, 1, 24476, 1, 88555, 2, 64079, 1, 231840, 1, 167761, 2, 606965, 1, 439204, 1, 1589055, 2, 1149851, 1, 4160200, 1, 3010349, 2
Offset: 1

Views

Author

Alonso del Arte, Sep 23 2013

Keywords

Comments

The sum of two consecutive Lucas number is the sum of four consecutive Fibonacci numbers, which is verified easily enough with the identity L(n) = F(n - 1) + F(n + 1). Therefore a(1) = a(2) = A210209(4).

Examples

			a(3) = 2 because any sum of three consecutive Lucas numbers is an even number.
a(4) = 5 because all sums of four consecutive Lucas numbers are divisible by 5.
a(5) = 1 because some sums of five consecutive Lucas numbers are coprime.
		

Crossrefs

Cf. A210209, A022112, A022088, A022098, A106291 (Pisano periods of the Lucas sequence).

Programs

  • Mathematica
    a[n_] := a[n] = If[n <= 14, {1, 1, 2, 5, 1, 4, 1, 15, 2, 11, 1, 40, 1, 29}[[n]], 3*a[n - 4] + a[n - 6] - a[n - 8] - 3*a[n - 10] + a[n - 14]]; Array[a, 64] (* Giovanni Resta, Oct 04 2013 *)
    CoefficientList[Series[(x^12 - x^11 + 2 x^10 - 5 x^9 - 2 x^8 - x^7 - 6 x^6 + x^5 - 2 x^4 + 5 x^3 + 2 x^2 + x + 1) / (-x^14 + 3 x^10 + x^8 - x^6 - 3 x^4 + 1), {x, 0, 40}], x] (* Vincenzo Librandi, Nov 09 2014 *)
    LinearRecurrence[{0,0,0,3,0,1,0,-1,0,-3,0,0,0,1},{1,1,2,5,1,4,1,15,2,11,1,40,1,29},70] (* Harvey P. Dale, Jul 21 2021 *)
    Table[GCD[LucasL[n + 1] - 2, LucasL[n] + 1], {n, 0, 50}] (* Horst H. Manninger, Dec 25 2021 *)
  • PARI
    Vec(x*(x^12 -x^11 +2*x^10 -5*x^9 -2*x^8 -x^7 -6*x^6 +x^5 -2*x^4 +5*x^3 +2*x^2 +x +1) / (-x^14 +3*x^10 +x^8 -x^6 -3*x^4 +1) + O(x^100)) \\ Colin Barker, Nov 09 2014

Formula

a(n) = 3*a(n-4) + a(n-6) - a(n-8) - 3*a(n-10) + a(n-14) for n > 14. - Giovanni Resta, Oct 04 2013
G.f.: x*(x^12 -x^11 +2*x^10 -5*x^9 -2*x^8 -x^7 -6*x^6 +x^5 -2*x^4 +5*x^3 +2*x^2 +x +1) / (-x^14 +3*x^10 +x^8 -x^6 -3*x^4 +1). - Colin Barker, Nov 09 2014
From Aba Mbirika, Jan 04 2022: (Start)
a(n) = gcd(L(n+1)-1, L(n+2)-3).
a(n) = Lcm_{A106291(m) divides n} m.
Proofs of these formulas are given in Theorems 15 and 25 of the Guyer-Mbirika paper. (End)

A223488 Number of distinct residues in the Lucas sequence mod the n-th prime.

Original entry on oeis.org

2, 3, 4, 7, 7, 12, 16, 12, 19, 10, 19, 28, 19, 33, 15, 44, 37, 28, 51, 44, 56, 49, 63, 24, 80, 35, 79, 33, 48, 40, 97, 82, 100, 33, 72, 37, 124, 123, 127, 124, 112, 62, 119, 144, 148, 16, 30, 169, 171, 80, 28, 149, 103, 157, 196, 85, 120, 169, 204, 27, 213, 212
Offset: 1

Views

Author

Casey Mongoven, Mar 20 2013

Keywords

Comments

The Lucas numbers mod n for any n are periodic; see A106291 for period lengths.

Examples

			The 5th prime number is 11. The Lucas sequence mod 11 is {2,1,3,4,7,0,7,7,3,10,2,1,3,...} - a periodic sequence. There are 7 distinct residues in this sequence, namely {0,1,2,3,4,7,10}. So a(5) = 7.
		

References

  • V. E. Hoggatt, Jr., Fibonacci and Lucas Numbers. Houghton, Boston, MA, 1969.

Crossrefs

Cf. A137750.

Programs

  • Mathematica
    pisano[n_] := Module[{a = {2, 1}, a0, k = 0, s}, If[n == 1, 1, a0 = a; Reap[While[k++; s = Mod[Plus @@ a, n]; Sow[s]; a[[1]] = a[[2]]; a[[2]] = s; a != a0]][[2, 1]]]]; Join[{2}, Table[u = Union[pisano[n]]; Length[u], {n, Prime[Range[2, 100]]}]] (* T. D. Noe, Mar 22 2013 *)

A223489 a(n) = number of missing residues in the Lucas sequence mod the n-th prime number.

Original entry on oeis.org

0, 0, 1, 0, 4, 1, 1, 7, 4, 19, 12, 9, 22, 10, 32, 9, 22, 33, 16, 27, 17, 30, 20, 65, 17, 66, 24, 74, 61, 73, 30, 49, 37, 106, 77, 114, 33, 40, 40, 49, 67, 119, 72, 49, 49, 183, 181, 54, 56, 149, 205, 90, 138, 94, 61, 178, 149, 102, 73, 254, 70, 81, 264, 117, 69
Offset: 1

Views

Author

Casey Mongoven, Mar 20 2013

Keywords

Comments

The Lucas numbers mod n for any n are periodic - see A106291 for period lengths.

Examples

			The 5th prime number is 11. The Lucas sequence mod 11 is {2,1,3,4,7,0,7,7,3,10,2,1,3,...} - a periodic sequence. There are 4 residues which do not occur in this sequence, namely {5,6,8,9}. So a(5) = 4.
		

References

  • V. E. Hoggatt, Jr., Fibonacci and Lucas Numbers. Houghton, Boston, MA, 1969.

Crossrefs

Cf. A137751.

Programs

  • Mathematica
    pisano[n_] := Module[{a = {2, 1}, a0, k = 0, s}, If[n == 1, 1, a0 = a; Reap[While[k++; s = Mod[Plus @@ a, n]; Sow[s]; a[[1]] = a[[2]]; a[[2]] = s; a != a0]][[2, 1]]]]; Join[{2}, Table[u = Union[pisano[n]]; mx = Max[u]; Length[Complement[Range[0,mx], u]], {n, Prime[Range[2, 100]]}]] (* T. D. Noe, Mar 22 2013 *)

A226593 Largest period of a recurrence sequence of pairs of permutations of length n.

Original entry on oeis.org

1, 3, 8, 18, 96, 216, 2112, 9720, 39024, 194256, 1116240
Offset: 1

Views

Author

Russell Walsmith, Jun 13 2013

Keywords

Comments

The n! permutations (p) of the numbers 1,2,3..n may be paired (allowing duplication) in n!^2 ways. For a pair of permutations (p, p'), let p'' = p x p', p''' = p' x p'', and so on until the starting pair (p, p') is obtained. If p = p', this iterative process gives the Pisano periods. For most other pairs the periods have different lengths. The sequence gives the longest period that (p, p') generates for any p, p' of length n.
Period is invariant with respect to simultaneous conjugation of both p, p'. - Max Alekseyev, Feb 09 2024

Examples

			For n = 4: 3142 x 2341 = 1423; 2341 x 1423 = 2134... the sequence thus generated is of period = 18.
		

Crossrefs

Cf. A001175 (Pisano periods: period of Fibonacci numbers (A000045) mod n).
Cf. A106291 (period of the Lucas sequence (A000032) mod n).

Programs

  • PARI
    period(a,b)=my(n=matsize(a)[2], v=vector(n), aa=vector(n,i,a[i]), bb=vector(n,i,b[i]), id, nsteps); while(id!=n, for(i=1,n, v[i]=a[b[i]]); id=sum(i=1,n, b[i]==aa[i] && v[i]==bb[i]); for(i=1,n, a[i]=b[i]; b[i]=v[i]); nsteps++); nsteps
    a(n)=my(a,b,m,p); for(k=1,n!, a=numtoperm(n,k); for(l=1,n!, b=numtoperm(n,l); p=period(a,b); if(p>m,m=p))); m \\ Ralf Stephan, Aug 13 2013

Extensions

a(6) from Ralf Stephan, Aug 13 2013
Edited and a(7)-a(11) added by Max Alekseyev, Feb 13 2024

A336684 Irregular triangle in which row n lists residues k found in the sequence Lucas(i) mod n.

Original entry on oeis.org

0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 6, 7, 8, 9, 0, 1, 2, 3, 4, 7, 10, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 0, 1, 2, 3, 4, 5
Offset: 1

Views

Author

Michael De Vlieger, Oct 07 2020

Keywords

Comments

For row n, it is sufficient to take the union of A000032(i) mod n for 0 <= i <= A106291(n - 1), since the Lucas numbers are cyclical mod n.
Row n contains the Lucas number k < n, and k such that (n + k) is a Lucas number.
Row n for n in A224482 is complete, i.e., it contains all residues k (mod n). This includes n that is a perfect power of 3.

Examples

			Row 1 contains 0 by convention.
Row 2 contains (0, 1) since the Lucas sequence contains both even and odd numbers.
Row 5 contains (1, 2, 3, 4) since the Lucas numbers mod 5 is {2,1,3,4,2,1} repeated; we are missing the residue 0.
Table begins as shown below, with residue k shown arranged in columns.
n    k (mod n)
--------------
1:   0
2:   0  1
3:   0  1  2
4:   0  1  2  3
5:      1  2  3  4
6:   0  1  2  3  4  5
7:   0  1  2  3  4  5  6
8:      1  2  3  4  5     7
9:   0  1  2  3  4  5  6  7  8
10:     1  2  3  4     6  7  8  9
11:  0  1  2  3  4        7       10
12:     1  2  3  4  5  6  7  8    10 11
13:     1  2  3  4  5  6  7  8  9 10 11 12
14:  0  1  2  3  4  5  6  7  8  9 10 11 12 13
15:     1  2  3  4        7          11       14
16:     1  2  3  4  5     7     9    11 12 13    15
...
		

Crossrefs

Cf. A000032, A066981, A106291, A223487. Analogous to A189768.

Programs

  • Mathematica
    {Most@ #, #} &[Range[0, 1]]~Join~Array[Block[{w = {2, 1}}, Do[If[SequenceCount[w, {2, 1}] == 1, AppendTo[w, Mod[Total@ w[[-2 ;; -1]], #]], Break[]], {i, 2, Infinity}]; Union@ w] &, 12, 3] // Flatten

Formula

A066981(n) = length of row n.
A223487(n) = n - A066981(n) = number of residues missing from row n.
A224482(n) = rows n that have complete residue coverage, i.e., A066981(n) = n and A223487(n) = 0.

A106292 Period of the Lucas sequence A000032 mod prime(n).

Original entry on oeis.org

3, 8, 4, 16, 10, 28, 36, 18, 48, 14, 30, 76, 40, 88, 32, 108, 58, 60, 136, 70, 148, 78, 168, 44, 196, 50, 208, 72, 108, 76, 256, 130, 276, 46, 148, 50, 316, 328, 336, 348, 178, 90, 190, 388, 396, 22, 42, 448, 456, 114, 52, 238, 240, 250, 516, 176, 268, 270, 556, 56
Offset: 1

Views

Author

T. D. Noe, May 02 2005

Keywords

Comments

This sequence differs from A060305 at only one position: 3, which corresponds to the prime 5, which is the discriminant of the characteristic polynomial x^2-x-1. We have a(n) < prime(n) for the primes in A038872.

Crossrefs

Cf. A060305 (period of Fibonacci numbers mod prime(n)), A106273 (discriminant of the polynomial x^n-x^(n-1)-...-x-1), A106291.

Programs

  • Mathematica
    n=2; 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, 70}]

Formula

a(n) = A106291(prime(n)).

A336685 Sum of 2^k for residue k in among Lucas numbers mod n.

Original entry on oeis.org

1, 3, 7, 15, 30, 63, 127, 190, 511, 990, 1183, 3582, 8190, 16383, 18590, 47806, 131070, 247967, 298911, 854686, 1453502, 2423967, 8362495, 10366142, 31738014, 67100670, 134217727, 262073758, 302254239, 609175710, 1779923167, 3133061822, 4962151582, 16855148990
Offset: 1

Views

Author

Michael De Vlieger, Oct 07 2020

Keywords

Comments

Row n of A336684 compactified as a binary number.
a(n) contains even numbers whereas A336683 (pertaining to the Fibonacci sequence) is strictly odd, since 0 is a Fibonacci number but not a Lucas number.

Examples

			a(1) = 1 by convention.
a(2) = 3 = 2^0 + 2^1, since the Lucas sequence contains both even and odd numbers.
a(5) = 30 = 2^1 + 2^2 + 2^3 + 2^4, since the Lucas numbers mod 5 is {2,1,3,4,2,1} repeated, and we are missing 0, leaving the exponents of 2 as shown.
Binary equivalents of first terms:
   n    a(n)   a(n) in binary
   --------------------------
    1      1                 1
    2      3                11
    3      7               111
    4     15              1111
    5     30             11110
    6     63            111111
    7    127           1111111
    8    190          10111110
    9    511         111111111
   10    990        1111011110
   11   1183       10010011111
   12   3582      110111111110
   13   8190     1111111111110
   14  16383    11111111111111
   15  18590   100100010011110
   16  47806  1011101010111110
   ...
		

Crossrefs

Cf. A000032, A066981, A106291, A223487, A336684. Analogous to A336683.

Programs

  • Mathematica
    Total /@ {Most@ #, #} &[2^Range[0, 1]]~Join~Array[Block[{w = {2, 1}}, Do[If[SequenceCount[w, {2, 1}] == 1, AppendTo[w, Mod[Total@ w[[-2 ;; -1]], #]], Break[]], {i, 2, Infinity}]; Total[2^Union@ w]] &, 32, 3]

Formula

a(3^j) = 2^(3^j+1) - 1 for all j.
A066981(n) = binary weight of a(n).
A223487(n) = n - A066981(n) = number of zeros in the binary expansion of a(n).
a(m) = 2^(m+1) - 1 for m = A224482(n).
Previous Showing 11-17 of 17 results.