login
A377270
Smallest index k such that the k-th prime number in base-2 contains the n-th Fibonacci number in base-2 as a contiguous substring.
1
1, 1, 1, 2, 3, 7, 6, 14, 33, 48, 24, 106, 51, 240, 362, 305, 251, 1269, 1047, 1752, 2456, 3773, 3121, 8959, 39089, 62223, 33299, 177305, 42613, 238782, 373418, 699763, 916051, 2715933, 2256419, 13103923, 7100513, 16902825, 13833549, 11323041, 66402079, 54299882
OFFSET
1,4
COMMENTS
The intersections between this sequence and similar sequences in base-B occur at values of n that are the indices of prime Fibonacci numbers, and values of a(n) such that the a(n)-th prime number is a Fibonacci number.
LINKS
Charles Marsden, Python program
FORMULA
a(n) = A377483(A000045(n)). - Pontus von Brömssen, Nov 29 2024
EXAMPLE
For n=1, fib(1)=1 -> 1 in base-2. The first prime containing 1 in its base-2 form is P(1)=2 -> 10. Therefore, a(1)=1.
For n=4, fib(4)=3 -> 11 in base-2. The first prime containing 11 in its base-2 form is P(2)=3 -> 11. Therefore, a(4)=2.
For n=6, fib(6)=8 -> 1000 in base-2. The first prime containing 1000 in its base-2 form is P(7)=17 -> 10001. Therefore, a(6)=7.
MATHEMATICA
s={}; Do[k=0; Until[SequenceCount[IntegerDigits[Prime[k], 2], IntegerDigits[Fibonacci[n], 2]]>0, k++]; AppendTo[s, k], {n, 31}]; s (* James C. McMahon, Nov 21 2024 *)
PROG
(Python) # See links.
(Python)
from sympy import fibonacci, nextprime, primepi
def A377270(n):
f = fibonacci(n)
p, k, a = nextprime(f-1), primepi(f-1)+1, bin(f)[2:]
while True:
if a in bin(p)[2:]:
return k
p = nextprime(p)
k += 1 # Chai Wah Wu, Nov 20 2024
(Sidef)
for n in (1..35) {
var bin = n.fib.as_bin
var min = Inf
for k in (0..Inf) {
['0', '1'].variations_with_repetition(k, {|*a|
[a..., bin].variations(a.len+1, {|*t|
var m = Num(t.join, 2)
if (m.is_prime && m.as_bin.contains(bin)) {
min = m if (m < min)
}
})
})
break if (min < Inf)
}
print(min.primepi, ", ")
} # Daniel Suteu, Nov 02 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Charles Marsden, Oct 22 2024
EXTENSIONS
a(36)-a(42) from Daniel Suteu, Nov 02 2024
STATUS
approved