

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 padic order of n is even for any prime p == 5 or 7 (mod 8).


LINKS

ZhiWei Sun, Table of n, a(n) for n = 1..10000
ZhiWei Sun, Refining Lagrange's foursquare theorem, J. Number Theory 175(2017), 167190.
ZhiWei Sun, Restricted sums of four squares, arXiv:1701.05868 [math.NT], 20172018.


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]==5Mod[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^23*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

ZhiWei Sun, Mar 25 2018


STATUS

approved



