login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Sums of two Fibonacci numbers that are also sums of two squares.
1

%I #22 Sep 29 2024 06:24:04

%S 0,1,2,4,5,8,9,10,13,16,18,26,29,34,36,37,58,68,89,90,97,144,145,146,

%T 149,157,178,233,234,241,288,377,466,521,610,612,613,754,1000,1021,

%U 1042,1076,1220,1597,1600,1602,1618,1741,2592,2597,2605,2817,3194,4181,4194,4325,6770,6773,6778,6786

%N Sums of two Fibonacci numbers that are also sums of two squares.

%C Intersection of A001481 and A084176.

%H Robert Israel, <a href="/A362295/b362295.txt">Table of n, a(n) for n = 1..2500</a>

%e a(5) = 5 is a term because 5 = 2 + 3 = A000045(3) + A000045(4) = 2^2 + 1^2.

%p ss:= proc(n) local F,t;

%p F:= ifactors(n)[2];

%p andmap(t -> t[1] mod 4 <> 3 or t[2]::even, F)

%p end proc:

%p fibs:= map(combinat:-fibonacci, {$0..25}):

%p N:= max(fibs):

%p fib2:= {seq(seq(fibs[i]+fibs[j],i=1..j),j=1..nops(fibs))}:

%p sort(convert(select(t -> t <= N and ss(t), fib2),list));

%t max = 150; (* max = 150 gives 1670 terms *)

%t Join[{0, 1}, Select[Union[Total /@ Tuples[Fibonacci[Range[2, max]], {2}]], # <= Fibonacci[max] && SquaresR[2, #] != 0&]] (* _Jean-François Alcover_, Sep 29 2024, after _Harvey P. Dale_ in A059389 *)

%o (Python)

%o from itertools import islice

%o from sympy import factorint

%o def A362295_gen(): # generator of terms

%o yield from (0,1,2)

%o a = [1,2]

%o while True:

%o b = a[-1]+a[-2]

%o c = a[-1]<<1

%o flag = True

%o for d in a:

%o n = b+d

%o if flag and n>=c:

%o if n>c:

%o f = factorint(c)

%o if all(d & 3 != 3 or f[d] & 1 == 0 for d in f):

%o yield c

%o flag = False

%o f = factorint(n)

%o if all(d & 3 != 3 or f[d] & 1 == 0 for d in f):

%o yield n

%o a.append(b)

%o A362295_list = list(islice(A362295_gen(),60)) # _Chai Wah Wu_, Apr 16 2023

%Y Cf. A000045, A001481, A059389, A084176, A111378.

%K nonn

%O 1,3

%A _Robert Israel_, Apr 14 2023