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.

A374026 a(n) = the smallest k such that Fibonacci(k) begins and ends with n, where Fibonacci(k) > n, or -1 if there are none.

This page as a plain text file.
%I A374026 #32 Aug 12 2024 09:35:46
%S A374026 22,114,124,72,10,39,116,207,169,5715,2428,5634,2366,189,2620,4668,
%T A374026 3137,2673,5812,12090,721,11583,20086,3798,1975,999,10636,846,2071,
%U A374026 9105,1162,2076,8287,11091,2770,2928,12943,8493,172,2220,5359,4737,28126,11838,10460,7479,10996
%N A374026 a(n) = the smallest k such that Fibonacci(k) begins and ends with n, where Fibonacci(k) > n, or -1 if there are none.
%C A374026 Since the smallest number beginning and ending with n is the same n, the condition that Fibonacci(k) > n is imposed. Partial overlap of the start and end is allowed, but not full overlap.
%F A374026 a(n) >= max{A023183(n), A020344(n)} except that a(n) = -1 when A023183(n) = -1. - _Michael S. Branicky_, Jun 27 2024
%e A374026 As Fibonacci(22) = 17711 is the smallest Fibonacci number greater than 1 that begins and ends with 1, a(1) = 22.
%e A374026 As Fibonacci(10) = 55 is the smallest Fibonacci number greater than 5 that begins and ends with 5, a(5) = 10.
%o A374026 (PARI) isok(s,t) = my(ss=strsplit(s, t)); (#ss >= 3) && (ss[1]=="") && (ss[#ss]=="");
%o A374026 a(n) = my(k=7); while(!isok(Str(fibonacci(k)), Str(n)), k++); k; \\ _Michel Marcus_, Jun 26 2024
%o A374026 (Python) # uses A023183() in A023183
%o A374026 from itertools import count
%o A374026 def a(n):
%o A374026     if A023183(n) == -1:
%o A374026         return -1
%o A374026     f, g, s = 1, 2, str(n)
%o A374026     pow10 = 10**len(s)
%o A374026     for k in count(3):
%o A374026         if g%pow10 == n:
%o A374026             sfib = str(g)
%o A374026             if g > n and sfib.startswith(s):
%o A374026                 return k
%o A374026         f, g = g, f+g
%o A374026 print([a(n) for n in range(1, 51)]) # _Michael S. Branicky_, Jul 03 2024
%Y A374026 Cf. A000045, A272623, A023183, A020344.
%K A374026 nonn,base
%O A374026 1,1
%A A374026 _Gonzalo Martínez_, Jun 26 2024
%E A374026 More terms from _Michel Marcus_, Jun 26 2024