login
Numbers k such that the k-th Fibonacci number contains a pandigital substring.
6

%I #12 Jul 15 2021 10:17:35

%S 130,190,309,348,374,381,382,387,394,431,447,482,496,513,516,522,540,

%T 543,562,573,590,600,603,667,672,738,761,768,827,843,849,856,873,888,

%U 907,912,923,937,958,963,982,990,993,1009,1021,1027,1054,1087,1090

%N Numbers k such that the k-th Fibonacci number contains a pandigital substring.

%H Harvey P. Dale, <a href="/A115937/b115937.txt">Table of n, a(n) for n = 1..10000</a>

%e Fibonacci(130) = 65(9034621587)630041982498215.

%t pandQ[n_]:=AnyTrue[Partition[IntegerDigits[Fibonacci[n]],10,1],Sort[#] == Range[ 0,9]&]; Select[Range[1100],pandQ] (* The program uses the AnyTrue function from Mathematica version 10 *) (* _Harvey P. Dale_, Apr 24 2016 *)

%o (Python)

%o from functools import lru_cache

%o @lru_cache(maxsize=None)

%o def fib(n): return n if n < 2 else fib(n-1) + fib(n-2)

%o def haspan(s): return any(len(set(s[i:i+10]))==10 for i in range(len(s)-9))

%o print([m for m in range(1111) if haspan(str(fib(m)))]) # _Michael S. Branicky_, Feb 28 2021

%Y Cf. A115933, A115934, A115935, A115936, A115938.

%K nonn,base

%O 1,1

%A _Giovanni Resta_, Feb 06 2006