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

 

Logo

Please make a donation to keep the OEIS running. We are now in our 55th year. In the past year we added 12000 new sequences and reached 8000 citations (which often say "discovered thanks to the OEIS"). We need to raise money to hire someone to manage submissions, which would reduce the load on our editors and speed up editing.
Other ways to donate

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A301640 Largest 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. 5
-1, 0, 1, 2, 3, 3, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 6, 7, 7, 7, 6, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 8, 9, 9, 9, 9, 8, 9, 9, 7, 9, 7, 9, 9, 8, 9, 10, 10, 10, 10, 10, 10, 10, 9, 10, 10, 10, 9, 10, 10, 10 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,4

COMMENTS

Conjecture: a(n) > 0.6*log_2(log_2 n) for all n > 2, and also lim inf_{n->infinity} a(n)/(log n) = 0.

The author's Square Conjecture in A301471 would imply that a(n) >= 0 for all n > 1. We have verified that a(n) > 0.6*log_2(log_2 n) for all n = 3..4*10^9. For n = 2857932461, we have a(n) = 3 and 0.603 < a(n)/log_2(log_2 n) < 0.604.

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

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(2) = 0 since 2^2 - 3*2^0 = 1^2 + 2*0^2.

a(3) = 1 since 3^2 - 3*2^1 = 2^2 + 2*1^2.

a(5) = 3 since 5^2 - 3*2^3 = 1^2 + 2*0^2.

a(6434567) = 10 since 6434567^2 - 3*2^10 = 5921293^2 + 2*1780722^2.

MAPLE

f:= proc(n) local k, t;

    for k from floor(log[2](n^2/3)) by -1 to 0 do

       if g(n^2 - 3*2^k) then return k fi

    od;

    -1

end proc:

map(f, [$1..100]); # Robert Israel, Mar 26 2018

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^(Floor[Log[2, n^2/3]]-k)], tab=Append[tab, Floor[Log[2, n^2/3]]-k]; Goto[aa]], {k, 0, Log[2, n^2/3]}]; tab=Append[tab, -1]; Label[aa], {n, 1, 70}]; Print[tab]

CROSSREFS

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

Sequence in context: A039836 A083398 A221671 * A061420 A003057 A239308

Adjacent sequences:  A301637 A301638 A301639 * A301641 A301642 A301643

KEYWORD

sign

AUTHOR

Zhi-Wei Sun, Mar 25 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 December 11 07:41 EST 2019. Contains 329914 sequences. (Running on oeis4.)