[go: up one dir, main page]

login
A275167
Pisano periods of A275124.
0
20, 60, 60, 40, 40, 60, 60, 60, 120, 140, 80, 120, 60, 120, 120, 100, 220, 60, 40, 60, 260, 120, 420, 140, 100, 240, 120, 120, 180, 120, 120, 180, 380, 120, 300, 180, 280, 240, 80, 240, 660, 60, 120, 60, 500, 240, 780, 120, 540, 120, 420, 420, 80, 360, 300, 200, 240, 620, 140, 120, 220, 60, 240, 180, 440, 120, 120, 120, 180, 1140, 520, 120
OFFSET
1,1
FORMULA
a(n) = A001175(A275124(n)).
EXAMPLE
A275124(1) = 55, and PisanoPeriod(55) = 20, etc.
PROG
(JavaScript)
let bases = [],
Fs = [],
Ls = [],
agrees = [],
baselimit = 2000;
for (let base = 2; base <= baselimit; base++) {
let fibs = [1 % base, 1 % base],
lucas = [2 % base, 1 % base],
repeatingf = false,
repeatingl = false;
while (!repeatingf) {
fibs.push((fibs[fibs.length - 2] + fibs[fibs.length - 1]) % base);
if (1 == fibs[fibs.length - 2] &&
0 == fibs[fibs.length - 1])
repeatingf = true;
}
while (!repeatingl) {
lucas.push((lucas[lucas.length - 2] + lucas[lucas.length - 1]) % base);
if ((lucas[0] == (lucas[lucas.length - 2] + lucas[lucas.length - 1]) % base) &&
(lucas[1] == (lucas[lucas.length - 2] + 2 *lucas[lucas.length - 1]) % base))
repeatingl = true;
}
Fs[base] = fibs.length;
Ls[base] = lucas.length;
if (fibs.length != lucas.length)
bases.push(base);
//console.log('F', fibs.join(', '), 'L:', lucas.join(', '));
}
for (let i = 1; i <= baselimit/5; i++) {
if (!bases.includes(i * 5)) {
agrees.push(Fs[i * 5]);
}
}
console.log(agrees.join(', '));
CROSSREFS
Sequence in context: A229536 A220013 A220046 * A344200 A163761 A154072
KEYWORD
nonn
AUTHOR
Dan Dart, Jul 18 2016
STATUS
approved