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.

A363533 Least k such that n*F(k)+1 is prime, where F = A000045 is the Fibonacci sequence, or -1 if no such k exists.

This page as a plain text file.
%I A363533 #15 Jun 22 2023 10:41:04
%S A363533 1,1,3,1,3,1,9,3,3,1,3,1,9,3,3,1,6,1,9,3,3,1,3,4,18,3,9,1,3,1,15,4,3,
%T A363533 4,3,1,9,5,3,1,3,1,48,3,9,1,24,3,9,3,3,1,3,3,9,3,6,1,24,1,36,5,3,4,3,
%U A363533 1,12,3,3,1,6,1,12,3,3,4,6,1,9,4,3,1,3,5
%N A363533 Least k such that n*F(k)+1 is prime, where F = A000045 is the Fibonacci sequence, or -1 if no such k exists.
%C A363533 2 does not appear because F(1) = F(2).
%C A363533 a(n) is divisible by 3 if n >= 3 is odd (unless a(n) = -1), because F(k) is odd (so n*F(k)+1 > 2 is even) when k is not divisible by 3.
%F A363533 a(n) = 1 if and only if n+1 is prime.
%e A363533 For n = 17, the least k such that 17*F(k)+1 is prime is k = 6, with 17*F(6)+1 = 17*8+1 = 137, so a(17) = 6.
%t A363533 Array[(k = 1; While[! PrimeQ[# Fibonacci[k] + 1], k++]; k) &, 85] (* _Michael De Vlieger_, Jun 10 2023 *)
%o A363533 (Python)
%o A363533 from sympy import isprime, fibonacci
%o A363533 from itertools import count
%o A363533 def A363533(n):
%o A363533     # Note: the function hangs if a(n) = -1.
%o A363533     return next(k for k in count(1) if isprime(n*fibonacci(k)+1))
%o A363533 (PARI) a(n) = my(k=1); while(!isprime(n*fibonacci(k)+1), k++); k; \\ _Michel Marcus_, Jun 10 2023
%Y A363533 Cf. A000045, A034693, A124067, A361902, A362376, A363534 (records), A363535 (indices of records), A363536 (first occurrences).
%K A363533 nonn
%O A363533 1,3
%A A363533 _Pontus von Brömssen_, Jun 09 2023