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.

A361233 Numbers k such that the "Pisano cycle modulo k shape" is bounded.

Original entry on oeis.org

1, 2, 4, 5, 6, 8, 10, 11, 12, 14, 16, 18, 19, 20, 22, 24, 28, 29, 30, 31, 32, 36, 37, 38, 40, 42, 44, 46, 48, 50, 52, 53, 54, 55, 56, 58, 59, 60, 62, 64, 66, 68, 70, 71, 72, 76, 78, 79, 80, 82, 84, 86, 88, 89, 90, 92, 94, 95, 96, 98, 100, 101, 102, 104, 106, 108, 109, 110, 112
Offset: 1

Views

Author

Luca Onnis, Mar 05 2023

Keywords

Comments

Let k be a positive integer and consider the Pisano cycle of Fibonacci numbers modulo k. We define the "Pisano cycle modulo k shape" to be the 2-dimensional shape obtained by applying the following process:
Step 1: Start from the origin of a 2-dimensional grid.
Step 2: Consider the first number of the Pisano cycle: if it's 0, then stay still in the position you were before; otherwise, if it's even, then turn 90 degrees counterclockwise and take a 1-unit step; if it's odd, then turn 90 degrees clockwise and take a 1-unit step.
Step 3: Continue this process for all the numbers in the Pisano cycle modulo n.
Step 4: When you have applied the above rules to all the numbers, repeat the entire process again and again, each time starting from the position where the previous iteration ended.
Some shapes seem to repeat; for example, the shapes associated with k = 6, 12, 14 are the same.
The condition for being bounded is that after processing one iteration of the Pisano cycle then either current direction must be different from the initial direction or the current position must be the origin.

Examples

			For k = 2 the Pisano Cycle modulo 2 of the Fibonacci numbers is (1,1,0) and the shape obtained by iterating the process described above is a 1-unit square, which is bounded, so a(2) = 2.
		

Crossrefs

Programs

  • PARI
    \\ P(n) gives n-th row of A161553.
    P(n)={my(L=List([0]), X=Mod([1,1;1,0],n), I=Mod([1,0;0,1],n), M=X, k=1); while(M<>I, k++; M*=X; listput(L, lift(M[2,2]))); Vec(L)}
    isok(n)={my(s=P(n), x=0, y=0, dx=1, dy=0, t); for(i=1, #s, if(s[i], [dx,dy]=if(s[i]%2, [dy, -dx], [-dy, dx]); x+=dx; y+=dy)); (x==0&&y==0) || dx!=1}
    select(isok, [1..100]) \\ Andrew Howroyd, Mar 05 2023