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

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 *)

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]);
Showing 1-2 of 2 results.