login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A301579 Least nonnegative integer k such that n^2 - 3*2^k can be written as x^2 + 2*y^2 with x and y integers, or -1 if no such k exists. 6
-1, 0, 0, 2, 0, 0, 1, 4, 1, 0, 0, 2, 0, 0, 1, 6, 1, 0, 0, 2, 0, 2, 1, 4, 1, 0, 0, 2, 0, 3, 3, 8, 1, 0, 3, 2, 0, 0, 3, 4, 1, 0, 1, 4, 0, 0, 1, 6, 3, 0, 0, 2, 1, 0, 1, 4, 3, 0, 1, 5, 0, 5, 1, 10, 1, 0, 0, 2, 3, 0, 4, 4, 1, 2, 0, 2, 0, 0, 3, 6 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,4

COMMENTS

The Square Conjecture in A301471 implies that a(n) >= 0 for all n > 1.

It is known that a positive integer n has the form x^2 + 2*y^2 with x and y integers if and only if the p-adic order of n is even for any prime p == 5 or 7 (mod 8).

Numbers t such that a(t) = 0 are 2, 3, 5, 6, 10, 11, 13, 14, 18, 19, 21, 26, 27, 29, 34, 37, ... - Altug Alkan, Mar 26 2018

LINKS

Zhi-Wei Sun, Table of n, a(n) for n = 1..10000

Zhi-Wei Sun, Refining Lagrange's four-square theorem, J. Number Theory 175(2017), 167-190.

Zhi-Wei Sun, Restricted sums of four squares, arXiv:1701.05868 [math.NT], 2017-2018.

EXAMPLE

a(1) = -1 since 1^2 - 3*2^k < 0 for all k = 0,1,2,....

a(31) = 3 since 31^2 - 3*2^3 = 17^2 + 2*18^2.

a(2^k) = 2*k - 2 for all k = 1,2,3,..., because (2^k)^2 - 3*2^(2*k-2) = (2^(k-1))^2 + 2*0^2, and (2^k)^2 - 3*2^j = 2^j*(2^(2*k-j) - 3) with 0 <= j < 2*k-2 cannot be written as x^2 + 2*y^2 with x and y integers.

MATHEMATICA

f[n_]:=f[n]=FactorInteger[n];

g[n_]:=g[n]=Sum[Boole[(Mod[Part[Part[f[n], i], 1], 8]==5||Mod[Part[Part[f[n], i], 1], 8]==7)&&Mod[Part[Part[f[n], i], 2], 2]==1], {i, 1, Length[f[n]]}]==0;

QQ[n_]:=QQ[n]=(n==0)||(n>0&&g[n]);

tab={}; Do[Do[If[QQ[n^2-3*2^k], tab=Append[tab, k]; Goto[aa]], {k, 0, Log[2, n^2/3]}]; tab=Append[tab, -1]; Label[aa], {n, 1, 80}]; Print[tab]

CROSSREFS

Cf. A000079, A000290, A002479, A299924, A299537, A299794, A300219, A300362, A300396, A300510, A301376, A301391, A301452, A301471, A301472, A301479.

Sequence in context: A109077 A137585 A301344 * A072458 A256282 A258256

Adjacent sequences:  A301576 A301577 A301578 * A301580 A301581 A301582

KEYWORD

sign

AUTHOR

Zhi-Wei Sun, Mar 23 2018

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 20 14:12 EDT 2019. Contains 325182 sequences. (Running on oeis4.)