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.

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

This page as a plain text file.
%I A214412 #20 Jun 06 2025 00:28:41
%S A214412 0,8,13,15,20,23,31,32,34,40,42,45,47,48,53,55,58,60,61,63,68,73,74,
%T A214412 75,76,78,79,87,88,92,95,96,97,99,106,107,109,110,111,112,116,117,118,
%U A214412 120,127,128,130,131,132,133,135,137,139,140,141,143,150,151,154,156
%N A214412 Numbers that can't be expressed as the sum of a Fibonacci number and a square of a positive integer.
%C A214412 0 is considered to be a Fibonacci number.
%H A214412 David Radcliffe, <a href="/A214412/b214412.txt">Table of n, a(n) for n = 1..1000</a>
%p A214412 q:= proc(n) local f,g; f,g:= 0,1;
%p A214412       do if f>=n       then return true
%p A214412        elif issqr(n-f) then return false
%p A214412        else f,g:= g,f+g
%p A214412       fi od
%p A214412     end:
%p A214412 select(q, [$0..200])[];  # _Alois P. Heinz_, May 22 2021
%t A214412 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 *)
%o A214412 (Python)
%o A214412 prpr = 0
%o A214412 prev = 1
%o A214412 fib = [0]*100
%o A214412 for n in range(100):
%o A214412     fib[n] = prpr
%o A214412     curr = prpr+prev
%o A214412     prpr = prev
%o A214412     prev = curr
%o A214412 #print fib[n]
%o A214412 for n in range(777):
%o A214412     i = 1
%o A214412     yes = 0
%o A214412     while i*i<=n:
%o A214412         r = n - i*i
%o A214412         if r in fib:
%o A214412             yes = 1
%o A214412             break
%o A214412         i += 1
%o A214412     if yes==0:
%o A214412         print(n, end=', ')
%Y A214412 Cf. A000045, A132144, A214410.
%K A214412 nonn,easy
%O A214412 1,2
%A A214412 _Alex Ratushnyak_, Jul 16 2012