A353987 Numbers k such that F(k), F(k+1) and F(k+2) have the same binary weight (A000120), where F(k) is the k-th Fibonacci number (A000045).
1, 51, 130, 996, 3224, 4287, 9951, 12676, 72004, 53812945, 141422620
Offset: 1
Examples
1 is a term since A011373(1) = A011373(2) = A011373(3) = 1. 51 is a term since A011373(51) = A011373(52) = A011373(53) = 17.
Programs
-
Mathematica
s[n_] := s[n] = DigitCount[Fibonacci[n], 2, 1]; Select[Range[10^4], s[#] == s[# + 1] == s[# + 2] &]
-
PARI
hf(k) = hammingweight(fibonacci(k)); \\ A011373 isok(k) = my(h=hf(k)); (h == hf(k+1)) && (h == hf(k+2)); \\ Michel Marcus, May 13 2022
-
Python
# if Python version < 3.10, replace c.bit_count() with bin(c).count('1') from itertools import islice def A353987_gen(): # generator of terms b, c, k, ah, bh = 1, 2, 1, 1, 1 while True: if ah == (ch := c.bit_count()) == bh: yield k b, c, ah, bh = c, b+c, bh, ch k += 1 A353987_list = list(islice(A353987_gen(),7)) # Chai Wah Wu, May 14 2022
Extensions
a(11) from Dennis Yurichev, Jul 10 2024
Comments