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-2 of 2 results.

A002708 a(n) = Fibonacci(n) mod n.

Original entry on oeis.org

0, 1, 2, 3, 0, 2, 6, 5, 7, 5, 1, 0, 12, 13, 10, 11, 16, 10, 1, 5, 5, 1, 22, 0, 0, 25, 20, 11, 1, 20, 1, 5, 13, 33, 30, 0, 36, 1, 37, 35, 1, 34, 42, 25, 20, 45, 46, 0, 36, 25, 32, 23, 52, 8, 5, 21, 40, 1, 1, 0, 1, 1, 43, 59, 60, 52, 66, 65, 44, 15, 1, 0, 72, 73, 50, 3, 2, 44, 1, 5, 7, 1, 82, 24
Offset: 1

Views

Author

John C. Hallyburton, Jr. (hallyb(AT)evms.ENET.dec.com)

Keywords

References

  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002, p. 891.

Crossrefs

Cf. A002726, A002752, A023172 (indices of 0's), A023173 (indices of 1's), A023174-A023182.
Cf. A263101.
Main diagonal of A161553.

Programs

  • Magma
    [Fibonacci(n) mod n : n in [1..120]]; // Vincenzo Librandi, Nov 19 2015
    
  • Maple
    with(combinat): [ seq( fibonacci(n) mod n, n=1..80) ];
    # second Maple program:
    a:= proc(n) local r, M, p; r, M, p:=
          <<1|0>, <0|1>>, <<0|1>, <1|1>>, n;
          do if irem(p, 2, 'p')=1 then r:= r.M mod n fi;
             if p=0 then break fi; M:= M.M mod n
          od; r[1, 2]
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Nov 26 2016
  • Mathematica
    Table[Mod[Fibonacci[n], n], {n, 1, 100}] (* Stefan Steinerberger, Apr 18 2006 *)
  • PARI
    a(n) = fibonacci(n) % n; \\ Michel Marcus, May 11 2016
  • Python
    A002708_list, a, b, = [], 1, 1
    for n in range(1,10**4+1):
        A002708_list.append(a%n)
        a, b = b, a+b # Chai Wah Wu, Nov 26 2015
    

Extensions

More terms from Stefan Steinerberger, Apr 18 2006

A352747 Array read by ascending antidiagonals. A(n, k) = F(k, n) mod n for n >= 1 and k >= 0, where F(n, k) = A352744(n, k) are the Fibonacci numbers, A(0, k) = 1 for k >= 0.

Original entry on oeis.org

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

Views

Author

Peter Luschny, Apr 08 2022

Keywords

Comments

This array aims the study of the divisibility properties of the Fibonacci numbers A352744. The identity F(n, k) = (-1)^k*F(1 - n, -k) from A352744 shows that negative indices do not add to the divisibility properties of F(n, k).
All rows A(n, .) are pure periodic sequences. The length of the periods is given by (1, A270313). For n > 0 the length of the period of row A(n, .) is <= n.
The period length is 1 for n in (1, A023172) and n for n in (1, A074215), as observed by Robert Israel in A270313. In particular, if n is a power of 2 or a prime (A174090), then the period length is n.
The indices of the zero-free rows are in A353280. A zero-free row A(n, .) means that n will not divide F(k, n) whatever value k takes. For that it is sufficient to check that period(A(n, .)) is zero-free.
If period(A(n, .)) = [k | 0 <= k < n] we call n a 'Fibonacci friend'. In other words, in this case F(k, n) mod n = k for 0 <= k < n. A Fibonacci friend does not have to be prime (since 1 is a Fibonacci friend), but if it is prime then it is congruent to {1, 4} mod 5 (A045468), and all such primes are Fibonacci friends.
To say that n is a Fibonacci friend is equivalent to saying that A(n, n) = 0 and that n divides F(n, n). Fibonacci friends are the indices of the zeros in A002752.
Integers n > 0 that divide Sum{k=0..n-1} (F(k, n) mod n) are congruent to {0, 1, 3, 5} mod 6 (A301729).

Examples

			Array starts (periods are indicated with () ):
[n\k] 0   1   2   3   4  5  6   7   8   9  10  11  12
----------------------------------------------------------
[ 0] (1), 1,  1,  1,  1, 1, 1,  1,  1,  1,  1,  1,  1, ...
[ 1] (0), 0,  0,  0,  0, 0, 0,  0,  0,  0,  0,  0,  0, ...
[ 2] (1,  0), 1,  0,  1, 0, 1,  0,  1,  0,  1,  0,  1, ...
[ 3] (1,  0,  2), 1,  0, 2, 1,  0,  2,  1,  0,  2,  1, ...
[ 4] (2,  1,  0,  3), 2, 1, 0,  3,  2,  1,  0,  3,  2, ...
[ 5] (3), 3,  3,  3,  3, 3, 3,  3,  3,  3,  3,  3,  3, ...
[ 6] (5,  1,  3), 5,  1, 3, 5,  1,  3,  5,  1,  3,  5, ...
[ 7] (1,  0,  6,  5,  4, 3, 2), 1,  0,  6,  5,  4,  3, ...
[ 8] (5,  2,  7,  4,  1, 6, 3,  0), 5,  2,  7,  4,  1, ...
[ 9] (3,  1,  8,  6,  4, 2, 0,  7,  5), 3,  1,  8,  6, ...
[10] (4,  9), 4,  9,  4, 9, 4,  9,  4,  9,  4,  9,  4, ...
[11] (0,  1,  2,  3,  4, 5, 6,  7,  8,  9, 10), 0,  1, ...
[12] (5), 5,  5,  5,  5, 5, 5,  5,  5,  5,  5,  5,  5, ...
		

Crossrefs

Programs

  • Maple
    f := n -> combinat:-fibonacci(n + 1):
    F := proc(n, k) option remember; (n-1)*f(k-1) + f(k) end:
    A := (n, k) -> ifelse(n = 0, 1, modp(F(k, n), n)):
    for n from 0 to 12 do seq(A(n, k), k = 0..10) od;
  • Mathematica
    F[n_, k_] := (n - 1)*Fibonacci[k] + Fibonacci[k + 1];
    A[n_, k_] := If[n == 0, 1, Mod[F[k, n], n]];
    Table[A[n, k], {n, 0, 12}, {k, 0, 10}] // TableForm
  • SageMath
    def F(n, k): return (n - 1)*fibonacci(k) + fibonacci(k + 1)
    def A(n,k): return mod(F(k, n), n)
    for n in range(13): print([A(n,k) for k in range(13)])

Formula

A(n, 0) = A(n, n) = A002752(n).
Clearly 0 <= A(n, k) < n for all k and n > 0.
Showing 1-2 of 2 results.