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

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=', ')
Showing 1-1 of 1 results.