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.

Showing 1-6 of 6 results.

A124134 Positive integers n such that Fibonacci(n) = a^2 + b^2, where a, b are integers.

Original entry on oeis.org

1, 2, 3, 5, 6, 7, 9, 11, 12, 13, 14, 15, 17, 19, 21, 23, 25, 26, 27, 29, 31, 33, 35, 37, 38, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 62, 63, 65, 67, 69, 71, 73, 74, 75, 77, 79, 81, 83, 85, 86, 87, 89, 91, 93, 95, 97, 98, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 121, 122, 123, 125, 127
Offset: 1

Views

Author

Melvin J. Knight (melknightdr(AT)verizon.net), Nov 30 2006

Keywords

Comments

All odd numbers are in this sequence, since the Fibonacci number with index 2m+1 is the sum of the squares of the two Fibonacci numbers with indices m and m+1. Those with even indices ultimately depend on certain Lucas numbers being the sum of two squares (see A124132). Joint work with Kevin O'Bryant and Dennis Eichhorn.
Numbers n such that Fibonacci(n) or Fibonacci(n)/2 is a square are only 0, 1, 2, 3, 6, 12. So a and b must be distinct and nonzero for all values of this sequence except 1, 2, 3, 6, 12. - Altug Alkan, May 04 2016

Examples

			14 is in the sequence because F_14=377=11^2+16^2.
16 is not in the sequence because F_16=987 is congruent to 3 (mod 4).
		

Crossrefs

Programs

  • Haskell
    a124134 n = a124134_list !! (n-1)
    a124134_list = filter ((> 0) . a000161 . a000045) [1..]
    -- Reinhard Zumkeller, Oct 10 2013
    
  • Mathematica
    Select[Range@ 128, SquaresR[2, Fibonacci@ #] > 0 &] (* Michael De Vlieger, May 04 2016 *)
  • PARI
    for(n=1, 10^6, t=fibonacci(n); s=sqrtint(t); forstep(i=s, 1, -1, if(issquare(t-i*i), print1(n, ", "); break))) \\ Ralf Stephan, Sep 15 2013
    
  • PARI
    is2s(n)={my(f=factor(n)); for(i=1, #f[, 1], if(f[i, 2]%2 && f[i, 1]%4==3, return(0))); 1; } \\ see A001481
    for(n=1, 10^6, if(is2s(fibonacci(n)), print1(n, ", "))); \\ Joerg Arndt, Sep 15 2013
    
  • Python
    from itertools import count, islice
    from sympy import factorint, fibonacci
    def A124134_gen(): # generator of terms
        return filter(lambda n:n & 1 or all(p & 3 != 3 or e & 1 == 0 for p, e in factorint(fibonacci(n)).items()),count(1))
    A124134_list = list(islice(A124134_gen(),30)) # Chai Wah Wu, Jun 27 2022

Formula

Intersection of A000045 and A001481.
A000161(A000045(a(n))) > 0. - Reinhard Zumkeller, Oct 10 2013

Extensions

More terms from Ralf Stephan, Sep 15 2013

A215907 Odd numbers n such that the Lucas number L(n) is the sum of two squares.

Original entry on oeis.org

1, 3, 7, 13, 19, 31, 37, 43, 49, 61, 67, 73, 79, 91, 111, 127, 163, 169, 183, 199, 223, 307, 313, 349, 361, 397, 433, 511, 523, 541, 613, 619, 709, 823, 907, 1087, 1123, 1129, 1147, 1213, 1279, 1434
Offset: 1

Views

Author

V. Raman, Aug 26 2012

Keywords

Comments

These Lucas numbers L(n) have no prime factor congruent to 3 mod 4 to an odd power.
Also, numbers n such that L(n) can be written in the form a^2 + 5*b^2.
Subsequence of A124132.
Is this A124132 without the 6? - Joerg Arndt, Sep 07 2012
Any prime factor of Lucas(n) for the prime values of n is always of the form 1 (mod 10) or 9 (mod 10).
A number n can be written in the form a^2 + 5*b^2 if and only if n is 0, or of the form 2^(2i) 5^j Product_{p==1 or 9 mod 20} p^k Product_{q==3 or 7 mod 20) q^(2m) or of the form 2^(2i+1) 5^j Product_{p==1 or 9 mod 20} p^k Product_{q==3 or 7 mod 20) q^(2m+1), for integers i,j,k,m, for primes p,q.
1501 <= a(42) <= 1531. 1531, 1651, 1747, 1849, 1951, 2053, 2413, 2449, 2467, 4069, 5107, 5419, 5851, 7243, 7741, 8467, 13963, 14449, 14887, 15511, 15907, 35449, 51169, 193201, 344293, 387433, 574219, 901657, 1051849 are terms. - Chai Wah Wu, Jul 22 2020

Examples

			Lucas(19) = 9349 = 95^2 + 18^2.
Lucas(19) = 9349 = 23^2 + 5*42^2.
		

Crossrefs

Cf. A180363.
Cf. A020669, A033205 (numbers and primes of the form x^2 + 5*y^2).

Programs

  • PARI
    for(i=2, 500, a=factorint(fibonacci(i-1)+fibonacci(i+1))~; has=0; for(j=1, #a, if(a[1, j]%4==3&&a[2, j]%2==1, has=1; break)); if(has==0&&i%2==1, print(i", "))) \\ a^2 + b^2 form.
    
  • PARI
    for(i=2, 500, a=factorint(fibonacci(i-1)+fibonacci(i+1))~; flag=0; flip=0; for(j=1, #a, if(((a[1, j]%20>10))&&a[2, j]%2==1, flag=1); if(((a[1, j]%20==2)||(a[1, j]%20==3)||(a[1, j]%20==7))&&a[2, j]%2==1, flip=flip+1)); if(flag==0&&flip%2==0, print(i", "))) \\ a^2 + 5*b^2 form.

Extensions

17 more terms from V. Raman, Aug 28 2012
A215940 merged into this sequence by T. D. Noe, Sep 21 2012
a(38)-a(41) from Chai Wah Wu, Jul 22 2020

A356809 Fibonacci numbers which are not the sum of two squares.

Original entry on oeis.org

3, 21, 55, 987, 2584, 6765, 17711, 46368, 317811, 832040, 2178309, 5702887, 14930352, 102334155, 267914296, 701408733, 1836311903, 4807526976, 12586269025, 32951280099, 86267571272, 225851433717, 591286729879, 1548008755920, 10610209857723
Offset: 1

Views

Author

Ctibor O. Zizka, Aug 29 2022

Keywords

Examples

			F(4) = 3; 3 != x^2 + y^2 as no positive integers x, y >= 0 are the solution of this Diophantine equation.
		

Crossrefs

Intersection of A000045 and A022544.

Programs

  • Mathematica
    Select[Fibonacci[Range[65]], SquaresR[2, #] == 0 &] (* Amiram Eldar, Aug 29 2022 *)
  • PARI
    is(n)=if(n%4==3, return(1)); my(f=factor(n)); for(i=1, #f~, if(f[i, 1]%4==3 && f[i, 2]%2, return(1))); 0; \\ A022544
    lista(nn) = select(is, apply(fibonacci, [1..nn])); \\ Michel Marcus, Sep 04 2022
    
  • Python
    from itertools import islice
    from sympy import factorint
    def A356809_gen(): # generator of terms
        a, b = 1, 2
        while True:
            if any(p&3==3 and e&1 for p, e in factorint(a).items()):
                yield a
            a, b = b, a+b
    A356809_list = list(islice(A356809_gen(),30)) # Chai Wah Wu, Jan 10 2023

A215938 Numbers n such that the Fibonacci number F(n) can be written in the form a^2 + 5*b^2.

Original entry on oeis.org

1, 2, 5, 8, 11, 12, 25, 29, 32, 41, 48, 55, 89, 121, 125, 128, 131, 145, 179, 192, 205, 275, 331, 359, 401, 421, 431, 445, 449, 509, 512, 569, 571, 601, 605, 625, 631, 655, 659, 691, 725, 768, 895, 911, 1025, 1375
Offset: 1

Views

Author

V. Raman, Aug 27 2012

Keywords

Comments

A number n can be written in the form a^2+5*b^2 if and only if n is 0, or of the form 2^(2i) 5^j Prod_{p==1 or 9 mod 20} p^k Prod_{q==3 or 7 mod 20) q^(2m) or of the form 2^(2i+1) 5^j Prod_{p==1 or 9 mod 20} p^k Prod_{q==3 or 7 mod 20) q^(2m+1), for integers i,j,k,m, for primes p,q.

Crossrefs

Cf. A020669, A033205 (numbers and primes of the form x^2 + 5*y^2).

Programs

  • PARI
    for(i=2, 500, a=factorint(fibonacci(i))~; flag=0; flip=0; for(j=1, #a, if(((a[1, j]%20>10))&&a[2, j]%2==1, flag=1); if(((a[1, j]%20==2)||(a[1, j]%20==3)||(a[1, j]%20==7))&&a[2, j]%2==1, flip=flip+1)); if(flag==0&&flip%2==0, print(i", ")))

Extensions

Terms corrected by V. Raman, Sep 20 2012
a(46) from Amiram Eldar, Oct 14 2019

A215939 Prime numbers n such that the Fibonacci number F(n) can be written in the form a^2 + 5*b^2.

Original entry on oeis.org

2, 5, 11, 29, 41, 89, 131, 179, 331, 359, 401, 421, 431, 449, 509, 569, 571, 601, 631, 659, 691, 911
Offset: 1

Views

Author

V. Raman, Aug 27 2012

Keywords

Comments

A number n can be written in the form a^2+5*b^2 if and only if n is 0, or of the form 2^(2i) 5^j Prod_{p==1 or 9 mod 20} p^k Prod_{q==3 or 7 mod 20) q^(2m) or of the form 2^(2i+1) 5^j Prod_{p==1 or 9 mod 20} p^k Prod_{q==3 or 7 mod 20) q^(2m+1), for integers i,j,k,m, for primes p,q.

Crossrefs

Cf. A020669, A033205 (numbers and primes of the form x^2 + 5*y^2).

Programs

  • PARI
    forprime(i=2, 500, a=factorint(fibonacci(i))~; flag=0; flip=0; for(j=1, #a, if(((a[1, j]%20>10))&&a[2, j]%2==1, flag=1); if(((a[1, j]%20==2)||(a[1, j]%20==3)||(a[1, j]%20==7))&&a[2, j]%2==1, flip=flip+1)); if(flag==0&&flip%2==0, print(i", ")))

Extensions

Terms corrected by V. Raman, Sep 20 2012

A236264 Even indices of Fibonacci numbers which are the sum of two squares.

Original entry on oeis.org

0, 2, 6, 12, 14, 26, 38, 62, 74, 86, 98, 122, 134, 146, 158, 182, 222, 254, 326, 338, 366, 398, 446, 614, 626, 698, 722, 794, 866, 1022, 1046, 1082, 1226, 1238, 1418, 1646, 1814, 2174, 2246, 2258, 2294, 2426, 2558
Offset: 1

Views

Author

Jean-François Alcover, Jan 21 2014

Keywords

Comments

The first 10 such Fibonacci numbers are 0, 1, 8, 144, 377, 121393, 39088169, 4052739537881, 1304969544928657, 420196140727489673.
Ballot & Luca (Proposition 1) show that this sequence has asymptotic density 0. - Charles R Greathouse IV, Jan 21 2014
a(43) >= 2558. Determining this term requires factoring the Lucas number L_1279. - Charles R Greathouse IV, Jan 21 2014
3002 <= a(44) <= 3302. 3302, 3698, 4898 are terms. - Chai Wah Wu, Jul 23 2020

Examples

			Fibonacci(14) = 377 = 19^2 + 4^2, so 14 is in the sequence.
		

Crossrefs

Programs

  • Mathematica
    Reap[For[n = 0, n <= 400, n = n+2, If[Reduce[Fibonacci[n] == x^2 + y^2, {x, y}, Integers] =!= False, Print[n]; Sow[n]]]][[2, 1]]
  • PARI
    is(n)=if(n%2, return(0)); my(f=factor(fibonacci(n))); for(i=1,#f~, if(f[i,1]%4==3 && f[i,2]%2, return(0))); 1 \\ Charles R Greathouse IV, Jan 21 2014
    
  • PARI
    default(factor_add_primes, 1);
    is(n)={
        if(n%2,return(0));
        my(f=fibonacci(n),t);
        if(f%4==3,return(0));
        forprime(p=2,min(log(f)^2,1e5),
            if(f%p==0,
                t=valuation(f,p);
                if(p%4==3&&t%2,return(0));
                f/=p^t;
                if(f%4==3,return(0))
            )
        );
        fordiv(n,d,
            if(d==n, break);
            t=factor(fibonacci(d))[,1];
            for(i=1,#t,
                if(t[i]%4==3 && valuation(f,t[i])%2, return(0));
                f/=t[i]^valuation(f,t[i]);
                if(f%4==3,return(0))
            )
        );
        f=factor(f);
        for(i=1,#f[,1],
            if(f[i,2]%2&&f[i,1]%4==3,return(0))
        );
        1
    }; \\ Charles R Greathouse IV, Jan 21 2014
    
  • Python
    from itertools import count, islice
    from sympy import factorint, fibonacci
    def A236264_gen(): # generator of terms
        return filter(lambda n:all(p & 3 != 3 or e & 1 == 0 for p, e in factorint(fibonacci(n)).items()),count(0,2))
    a236264_list = list(islice(A236264_gen(),10)) # Chai Wah Wu, Jun 27 2022

Formula

a(n) = 2*A124132(n-1).

Extensions

a(32)-a(42) from Charles R Greathouse IV, Jan 21 2014
a(43) from Chai Wah Wu, Jul 23 2020
Showing 1-6 of 6 results.