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.

A281945 Number of ways to write n as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers such that both x and x + y - z are powers of two (including 2^0 = 1).

Original entry on oeis.org

1, 2, 2, 2, 3, 4, 3, 2, 4, 6, 2, 3, 4, 4, 4, 2, 4, 8, 5, 4, 4, 5, 4, 4, 6, 7, 5, 5, 4, 7, 4, 2, 8, 9, 5, 4, 6, 5, 5, 6, 5, 10, 5, 3, 8, 7, 3, 3, 8, 8, 8, 6, 2, 11, 8, 4, 5, 9, 4, 5, 7, 5, 6, 2, 9, 11, 10, 5, 6, 12, 3, 8, 9, 6, 9, 6, 4, 8, 4, 4
Offset: 1

Views

Author

Zhi-Wei Sun, Feb 02 2017

Keywords

Comments

65213 is the first positive integer which cannot be written as x^2 + y^2 + z^2 + w^2 with x,y,z,w integers such that both x and x + y + z are powers of two. Though a(44997) = 0, we have
44997 = 128^2 + (-28)^2 + (-98)^2 + 1^2 with 128 = 2^7 and 128 + (-28) + (-98) = 2^1.

Examples

			a(1) = 1 since 1 = 1^2 + 0^2 + 0^2 + 0^2 with 1 = 2^0 and 1 + 0 - 0 = 2^0.
a(2237) = 1 since 2237 = 8^2 + 29^2 + 36^2 + 6^2 with 8 = 2^3 and 8 + 29 - 36 = 2^0.
a(4397) = 1 since 4397 = 4^2 + 21^2 + 24^2 + 58^2 with 4 = 2^2 and 4 + 21 - 24 = 2^0.
a(5853) = 1 since 5853 = 2^2 + 52^2 + 52^2 + 21^2 with 2 = 2^1 and 2 + 52 - 52 = 2^1.
a(14711) = 1 since 14711 = 1^2 + 18^2 + 15^2 + 119^2 with 1 = 2^0 and 1 + 18 - 15 = 2^2.
a(16797) = 1 since 16797 = 64^2 + 42^2 + 104^2 + 11^2 with 64 = 2^6 and 64 + 42 - 104 = 2^1.
a(17861) = 1 since 17861 = 32^2 + 0^2 + 31^2 + 126^2 with 32 = 2^5 and 32 + 0 - 31 = 2^0.
a(20959) = 1 since 20959 = 2^2 + 109^2 + 95^2 + 7^2 with 2 = 2^1 and 2 + 109 - 95 = 2^4.
a(21799) = 1 since 21799 = 1^2 + 146^2 + 19^2 + 11^2 with 1 = 2^0 and 1 + 146 - 19 = 2^7.
a(24757) = 1 since 24757 = 64^2 + 56^2 + 119^2 + 58^2 with 64 = 2^6 and 64 + 56 - 119 = 2^0.
a(28253) = 1 since 28253 = 2^2 + 3^2 + 4^2 + 168^2 with 2 = 2^1 and 2 + 3 - 4 = 2^0.
		

Crossrefs

Programs

  • Mathematica
    SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
    Pow[n_]:=Pow[n]=n>0&&IntegerQ[Log[2,n]];
    Do[r=0;Do[If[SQ[n-4^x-y^2-z^2]&&Pow[2^x+y-z],r=r+1],{x,0,Log[4,n]},{y,0,Sqrt[n-4^x]},{z,0,Sqrt[n-4^x-y^2]}];Print[n," ",r];Continue,{n,1,80}]