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-8 of 8 results.

A132145 Numbers that can be presented as a sum of a prime number and a Fibonacci number (0 is considered to be a Fibonacci number).

Original entry on oeis.org

2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72
Offset: 1

Views

Author

Tanya Khovanova, Aug 12 2007

Keywords

Comments

This sequence is the union of prime numbers and sequence A132147. It is also the complement of A132144.
Lee shows that the set of the numbers that are the sum of a prime and a Fibonacci number has positive lower asymptotic density. [Jonathan Vos Post, Nov 02 2010]

Examples

			11 = 3+8, the sum of a prime number (3) and a Fibonacci number (8).
		

Crossrefs

Programs

  • Maple
    N:= 1000: # for all entries <= N
    Primes:= select(isprime,{$1..N}):
    phi:= (1+sqrt(5))/2:
    Fibs:= {seq(combinat:-fibonacci(i),i=0..floor(log[phi]((N+1)*sqrt(5))))}:
    sort(convert(select(`<=`,{seq(seq(f+p,f=Fibs),p=Primes)},N),list)); # Robert Israel, Aug 03 2015
  • Mathematica
    Take[Union[Flatten[Table[Fibonacci[n] + Prime[k], {n, 70}, {k, 70}]], Table[Prime[k], {k, 70}]], 70]

A132146 Numbers that can't be presented as a sum of a prime number and a Fibonacci number (0 is not considered to be a Fibonacci number).

Original entry on oeis.org

1, 2, 17, 29, 35, 59, 83, 89, 119, 125, 127, 177, 179, 208, 209, 221, 239, 255, 269, 287, 299, 329, 331, 353, 359, 363, 389, 416, 419, 449, 479, 485, 509, 515, 519, 535, 539, 547, 551, 561, 567, 569, 599, 637, 659, 673, 697, 705, 718, 733, 739, 755, 768, 779
Offset: 1

Views

Author

Tanya Khovanova, Aug 12 2007

Keywords

Comments

This sequence contains A132144 as a subsequence and is the complement of A132147.

Examples

			The smallest prime number is 2, the smallest Fibonacci number is 1; hence 1 and 2 can't be presented as a sum of a prime number and a Fibonacci number.
		

Programs

  • Mathematica
    Complement[Range[1000], Take[Union[Flatten[Table[Fibonacci[n] + Prime[k], {n, 700}, {k, 700}]]], 1000]]

A168383 Numbers expressible as the sum of a prime and a Fibonacci number in only one way, and such that the prime and Fibonacci number have the same number of decimal digits.

Original entry on oeis.org

2, 9, 65, 77, 93, 95, 123, 323, 335, 343, 377, 395, 415, 425, 437, 527, 545, 553, 583, 586, 670, 700, 715, 723, 726, 731, 749, 783, 801, 804, 833, 838, 849, 851, 901, 903, 905, 906, 923, 957, 959, 964, 965, 1003, 1078, 1081, 1113, 1115
Offset: 1

Views

Author

Jason Earls, Nov 24 2009

Keywords

Comments

1 = Fibonacci(1) = Fibonacci(2), so cases where the Fibonacci number is 1 are counted as two ways. Also, if Fibonacci(i) and Fibonacci(j) are both primes (with i <> j), Fibonacci(i) + Fibonacci(j) and Fibonacci(j) + Fibonacci(i) are counted as two ways. - Robert Israel, Aug 22 2024

Examples

			In the decomposition of 1081, the prime and Fibonacci both have three digits: 1081 = 144 + 937.
		

References

  • J. Earls, "Fibonacci Prime Decompositions," Mathematical Bliss, Pleroma Publications, 2009, pages 76-79. ASIN: B002ACVZ6O

Crossrefs

Cf. A000045, A132144, A375642. Contained in A375643.

Programs

  • Maple
    filter:= proc(n) local f,i,d,state;
      state:= 0;
      for i from 0 do
        f:= combinat:-fibonacci(i);
        if f >= n then return (state = 1) fi;
        if isprime(n-f) then
          state:= state+1;
          if state = 2 then return false fi;
          if f = 0 then d:= 1 else d:= 1+ilog10(f) fi;
          if 1+ilog10(n-f) <> d then return false fi;
        fi
      od;
    end proc:
    select(filter, [$1..2000]); # Robert Israel, Aug 22 2024

Extensions

Definition clarified by Robert Israel, Aug 22 2024

A375642 a(n) is the number of i for which n - Fibonacci(i) is prime.

Original entry on oeis.org

0, 1, 3, 3, 3, 3, 3, 4, 1, 3, 2, 3, 3, 3, 3, 3, 1, 4, 3, 4, 2, 2, 2, 5, 2, 3, 1, 2, 1, 3, 3, 5, 1, 3, 0, 3, 3, 3, 3, 2, 2, 4, 2, 5, 3, 2, 2, 3, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 1, 4, 3, 5, 2, 3, 1, 3, 2, 4, 2, 1, 2, 5, 2, 6, 3, 2, 1, 2, 2, 4, 3, 2, 1, 5, 1, 3, 2, 2, 1, 2, 3, 5, 1, 3, 1, 3, 2, 3, 1
Offset: 1

Views

Author

Robert Israel, Aug 22 2024

Keywords

Examples

			a(5) = 3 because 5 - Fibonacci(0) = 5, 5 - Fibonacci(3) = 3 and 5 - Fibonacci(4) = 2 are prime.
		

Crossrefs

Programs

  • Maple
    fcount:= proc(n) local f,i,d,c;
      c:= 0;
      for i from 0 do
        f:= combinat:-fibonacci(i);
        if f >= n then return c fi;
        if isprime(n-f) then
          c:= c+1;
        fi
      od;
    end proc:
    map(f, [$1..200]);
  • Mathematica
    a[n_]:=Sum[Boole[PrimeQ[n-Fibonacci[i]]],{i,Select[Range[0,n],n>Fibonacci[#]&]}]; Array[a,99] (* Stefano Spezia, Aug 23 2024 *)

A168382 Least number k having n distinct representations as the sum of a nonzero Fibonacci number and a prime.

Original entry on oeis.org

3, 4, 8, 24, 74, 444, 1600, 15684, 29400, 50124, 259224, 5332128, 11110428, 50395440, 451174728, 1296895890, 13314115434, 32868437466, 326585290794, 4788143252148
Offset: 1

Views

Author

Jason Earls, Nov 24 2009

Keywords

Comments

The meaning of "distinct" is the following: we count ordered index pairs (i,j) with k = Fibonacci(i) + prime(j), i > 1, j >= 1.
Fibonacci(1) + prime(4) = Fibonacci(2) + prime(4) = Fibonacci(4) + prime(3) = Fibonacci(5) + prime(2) = 8 are three "distinct" representations of k=8, because Fibonacci(1) = Fibonacci(2) is treated as indistinguishable, whereas Fibonacci(4) = prime(2) are distinguishable based on the ordering in the indices (ordering in the sum): k = 1+7 = 3+5 = 5+3.
a(17) > 10^10. [Donovan Johnson, May 17 2010]

Examples

			15684 is the least number having eight distinct representations due to the following sums: 1 + 15683 = 5 + 15679 = 13 + 15671 = 55 + 15629 = 233 + 15451 = 377 + 15307 = 1597 + 14087 = 4181 + 11503.
		

References

  • J. Earls, "Fibonacci Prime Decompositions," Mathematical Bliss, Pleroma Publications, 2009, pages 76-79. ASIN: B002ACVZ6O

Crossrefs

Extensions

Two more terms from R. J. Mathar, Feb 07 2010
a(7) corrected by Jon E. Schoenfield, May 14 2010
Edited by R. J. Mathar, May 14 2010
a(11)-a(14) from Max Alekseyev, May 15 2010
a(15)-a(16) from Donovan Johnson, May 17 2010
a(17) from Chai Wah Wu, Sep 04 2018
a(18)-a(20) from Giovanni Resta, Dec 10 2019

A214412 Numbers that can't be expressed as the sum of a Fibonacci number and a square of a positive integer.

Original entry on oeis.org

0, 8, 13, 15, 20, 23, 31, 32, 34, 40, 42, 45, 47, 48, 53, 55, 58, 60, 61, 63, 68, 73, 74, 75, 76, 78, 79, 87, 88, 92, 95, 96, 97, 99, 106, 107, 109, 110, 111, 112, 116, 117, 118, 120, 127, 128, 130, 131, 132, 133, 135, 137, 139, 140, 141, 143, 150, 151, 154, 156
Offset: 1

Views

Author

Alex Ratushnyak, Jul 16 2012

Keywords

Comments

0 is considered to be a Fibonacci number.

Crossrefs

Programs

  • Maple
    q:= proc(n) local f,g; f,g:= 0,1;
          do if f>=n       then return true
           elif issqr(n-f) then return false
           else f,g:= g,f+g
          fi od
        end:
    select(q, [$0..200])[];  # Alois P. Heinz, May 22 2021
  • Mathematica
    nn = 156; sq = Range[Sqrt[nn]]^2; fb = {}; i = 0; While[f = Fibonacci[i];  f < nn, i++; AppendTo[fb, f]]; fb = Union[fb]; Complement[Range[0, nn], Union[Flatten[Outer[Plus, sq, fb]]]] (* T. D. Noe, Jul 31 2012 *)
  • Python
    prpr = 0
    prev = 1
    fib = [0]*100
    for n in range(100):
        fib[n] = prpr
        curr = prpr+prev
        prpr = prev
        prev = curr
    #print fib[n]
    for n in range(777):
        i = 1
        yes = 0
        while i*i<=n:
            r = n - i*i
            if r in fib:
                yes = 1
                break
            i += 1
        if yes==0:
            print(n, end=', ')

A375643 Numbers that are the sum of a prime and a Fibonacci number in exactly one way.

Original entry on oeis.org

2, 9, 17, 27, 29, 33, 59, 65, 70, 77, 83, 85, 89, 90, 93, 95, 99, 121, 123, 124, 127, 129, 133, 143, 145, 146, 153, 155, 166, 169, 174, 179, 188, 189, 190, 195, 203, 210, 217, 219, 222, 237, 239, 243, 249, 258, 261, 267, 269, 289, 297, 302, 303, 305, 308, 309, 310, 321, 323, 327, 331, 333, 335
Offset: 1

Views

Author

Robert Israel, Aug 22 2024

Keywords

Comments

Numbers k such that k - A000045(i) is prime for exactly one i >= 0.
1 = Fibonacci(1) = Fibonacci(2), so cases where the Fibonacci number is 1 are counted as two ways. Also, if Fibonacci(i) and Fibonacci(j) are both primes (with i <> j), Fibonacci(i) + Fibonacci(j) and Fibonacci(j) + Fibonacci(i) are counted as two ways.

Examples

			a(5) = 29 is a term because 29 - Fibonacci(i) is prime only for i = 0.
		

Crossrefs

Cf. A000045, A132144, A375642. Contains A168383.

Programs

  • Maple
    filter:= proc(n) local f,i,d,state;
      state:= 0;
      for i from 0 do
        if i = 2 then next fi;
        f:= combinat:-fibonacci(i);
        if f >= n then return (state = 1) fi;
        if isprime(n-f) then
          state:= state+1;
          if state = 2 then return false fi;
        fi
      od;
    end proc:
    select(filter, [$1..1000]);

A214410 Numbers that can't be expressed as the sum of a square and a Fibonacci number.

Original entry on oeis.org

15, 20, 23, 31, 32, 40, 42, 45, 47, 48, 53, 58, 60, 61, 63, 68, 73, 74, 75, 76, 78, 79, 87, 88, 92, 95, 96, 97, 99, 106, 107, 109, 110, 111, 112, 116, 117, 118, 120, 127, 128, 130, 131, 132, 133, 135, 137, 139, 140, 141, 143, 150, 151, 154, 156, 158, 159, 161
Offset: 1

Views

Author

Alex Ratushnyak, Jul 16 2012

Keywords

Comments

0 is considered to be a Fibonacci number.

Examples

			17 = 16+1, 16 is a square and 1 is a Fibonacci number, so 17 is not in the sequence.
		

Crossrefs

Programs

  • Maple
    q:= proc(n) local f,g; f,g:= 0,1;
          do if f>n        then return true
           elif issqr(n-f) then return false
           else f,g:= g,f+g
          fi od
        end:
    select(q, [$0..200])[];  # Alois P. Heinz, May 22 2021
  • Mathematica
    nn = 161; sq = Range[0, Sqrt[nn]]^2; fb = {}; i = 0; While[f = Fibonacci[i];  f < nn, i++; AppendTo[fb, f]]; fb = Union[fb]; Complement[Range[0, nn], Union[Flatten[Outer[Plus, sq, fb]]]] (* T. D. Noe, Jul 31 2012 *)
  • Python
    prpr = 0
    prev = 1
    fib = [0]*100
    for n in range(100):
        fib[n] = prpr
        curr = prpr+prev
        prpr = prev
        prev = curr
    for n in range(1234):
        i = yes = 0
        while i*i<=n:
            r = n - i*i
            if r in fib:
                yes = 1
                break
            i += 1
        if yes==0:
            print(n, end=',')
    
  • Python
    from sympy import fibonacci
    from itertools import count, takewhile
    def aupto(lim):
      fbs = list(takewhile(lambda x: x<=lim, (fibonacci(i) for i in count(0))))
      sqs = list(takewhile(lambda x: x<=lim, (i*i for i in count(0))))
      return sorted(set(range(1, lim+1)) - set(f+s for f in fbs for s in sqs))
    print(aupto(161)) # Michael S. Branicky, May 22 2021
Showing 1-8 of 8 results.