[go: up one dir, main page]

login
Search: a001481 -id:a001481
     Sort: relevance | references | number | modified | created      Format: long | short | data
a(n) is the number of positive integers <= 10^n that can be expressed as a sum of two squares.
+0
2
7, 43, 330, 2749, 24028, 216341, 1985459, 18457847, 173229058, 1637624156, 15570512744, 148736628858, 1426306930865, 13722217893214, 132387263219058, 1280309691127436
OFFSET
1,1
LINKS
Peter Shiu, Counting Sums of Two Squares: The Meissel-Lehmer Method, Mathematics of Computation 47:175 (July 1986), pp. 351-360. [Beware errors.]
Eric Weisstein's World of Mathematics, Landau-Ramanujan Constant
FORMULA
a(n) = A180416(n) + ceiling(sqrt(10^n)). - Hiroaki Yamanouchi, Jul 14 2014
EXAMPLE
a(1)=7 since 1 = 0^2 + 1^2, 2 = 1^2 + 1^2, 4 = 0^2 + 2^2, 5 = 1^2 + 2^2, 8 = 2^2 + 2^2, 9 = 0^2 + 3^2, 10 = 1^2 + 3^3.
KEYWORD
nonn,hard,more
AUTHOR
Eric W. Weisstein, Aug 26 2009
EXTENSIONS
Offset changed from 0 to 1 by Robert G. Wilson v, Aug 29 2009
a(9) from Eric W. Weisstein, Aug 29 2009
a(10) from Donovan Johnson, Sep 16 2009
a(11)-a(12) from Ant King, May 02 2010
a(11)-a(12) corrected and a(13)-a(16) added by Hiroaki Yamanouchi, Jul 14 2014
STATUS
approved
Number of ways to write n as x^2 + y^2 + z*(3*z-1)/2 with x,y,z integers such that x + 2*y is a square.
+0
6
1, 2, 3, 2, 2, 5, 5, 5, 1, 2, 4, 2, 5, 3, 3, 4, 3, 7, 5, 3, 8, 3, 5, 3, 2, 6, 3, 7, 5, 3, 4, 7, 5, 3, 4, 6, 5, 3, 3, 7, 5, 5, 5, 1, 6, 7, 6, 4, 3, 2, 5, 5, 9, 6, 3, 7, 5, 7, 5, 4, 8, 5, 6, 4, 6, 5, 5, 8, 5, 6, 6, 7, 5, 5, 5, 7, 5, 6, 2, 4, 12
OFFSET
0,2
COMMENTS
Conjecture: (i) a(n) > 0 for all n = 0,1,2,..., and a(n) = 1 only for n = 0, 8, 43, 84, 133, 253, 399, 488, 523, 803, 7369.
(ii) Any integer n > 1 can be written as p + x^2 + y^2 with p prime and x + 2*y (or x + 3*y) a square, where x is an integer and y is a nonnegative integer.
Note that those numbers z*(3*z-1)/2 with z integral are called generalized pentagonal numbers (A001318). By Theorem 1.7(ii) of the linked paper in Sci. China Math., each n = 0,1,2,... can be written as the sum of two squares and a generalized pentagonal number.
Ju. V. Linnik proved in 1960 that any sufficiently large integer can be expressed as the sum of a prime and two squares.
LINKS
Ju. V. Linnik, An asymptotic formula in an additive problem of Hardy-Littlewood, Izv. Akad. Nauk SSSR Ser. Mat., 24 (1960), 629-706 (Russian).
Zhi-Wei Sun, On universal sums of polygonal numbers, Sci. China Math. 58 (2015), no. 7, 1367-1396.
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.
EXAMPLE
a(8) = 1 since 8 = 1^2 + 0^2 + (-2)*(3*(-2)-1)/2 with 1 + 2*0 = 1^2.
a(43) = 1 since 43 = 1^2 + 4^2 + (-4)*(3*(-4)-1)/2 with 1 + 2*4 = 3^2.
a(84) = 1 since 84 = 7^2 + (-3)^2 + (-4)*(3*(-4)-1)/2 with 7 + 2*(-3) = 1^2.
a(133) = 1 since 133 = 4^2 + 0^2 + 9*(3*9-1)/2 with 4 + 2*0 = 2^2.
a(253) = 1 since 253 = (-13)^2 + 7^2 + 5*(3*5-1)/2 with (-13) + 2*7 = 1^2.
a(399) = 1 since 399 = 18^2 + (-7)^2 + (-4)*(3*(-4)-1)/2 with 18 + 2*(-7) = 2^2.
a(488) = 1 since 488 = 9^2 + 20^2 + (-2)*(3*(-2)-1)/2 with 9 + 2*20 = 7^2.
a(523) = 1 since 523 = 9^2 + 0^2 + (-17)*(3*(-17)-1)/2 with 9 + 2*0 = 3^2.
a(803) = 1 since 803 = (-17)^2 + 13^2 + (-15)*(3*(-15)-1)/2 with (-17) + 2*13 = 3^2.
a(7369) = 1 since 7369 = 0^2 + 72^2 + (-38)*(3*(-38)-1)/2 with 0 + 2*72 = 12^2.
MATHEMATICA
SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
PenQ[n_]:=PenQ[n]=SQ[24n+1];
Do[r=0; Do[If[PenQ[n-x^2-y^2], Do[If[SQ[(-1)^i*x+2(-1)^j*y], r=r+1], {i, 0, Min[x, 1]}, {j, 0, Min[y, 1]}]], {x, 0, Sqrt[n]}, {y, 0, Sqrt[n-x^2]}]; Print[n, " ", r]; Continue, {n, 0, 80}]
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Mar 03 2017
STATUS
approved
Numbers k for which A363763(k) = -1.
+0
7
46, 55, 62, 71, 80, 86, 107, 130, 172, 187, 195, 208, 222, 247, 259, 263, 268, 272, 280, 297, 314, 330, 358, 363, 370, 372, 379, 394, 400, 405, 429, 449, 450, 462, 489, 500, 529, 534, 587, 629, 641, 646, 652, 667, 668, 672, 704, 715, 733, 736, 749, 769, 775, 776, 778, 785, 793, 799
OFFSET
1,1
LINKS
PROG
(Python)
from itertools import count, islice
from sympy import factorint
def A363762_gen(startvalue=1): # generator of terms >= startvalue
for n in count(max(startvalue, 1)):
for k in range(n>>1, ((n+1)**2<<1)+1):
c = 0
for m in range(k**2+1, (k+1)**2):
if all(p==2 or p&3==1 or e&1^1 for p, e in factorint(m).items()):
c += 1
if c>n:
break
if c==n:
break
else:
yield n
A363762_list = list(islice(A363762_gen(), 20)) # Chai Wah Wu, Jun 22 2023
CROSSREFS
Numbers not occurring as terms of A077773.
KEYWORD
nonn
AUTHOR
Hugo Pfoertner, Jun 20 2023
STATUS
approved
Minimum numbers of squares needed to write n! as a sum of nonzero squares.
+0
1
1, 2, 3, 3, 3, 2, 3, 3, 3, 4, 3, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 3, 3, 3, 3, 4, 3, 3, 3, 3, 3, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, 3, 3, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3
OFFSET
1,2
EXAMPLE
a(2)=2 because 2!=1^2+1^2; a(3)=3: 3!=6=2^2+1+1; a(6)=2: 6!=720=24^2+12^2
PROG
See link.
CROSSREFS
KEYWORD
nonn
AUTHOR
Hugo Pfoertner, Jun 15 2003
STATUS
approved
Integers k that are the sum of two nonzero squares while k*(k+1) is not.
+0
1
2, 5, 10, 13, 18, 20, 26, 29, 32, 34, 37, 41, 45, 50, 53, 58, 61, 65, 68, 74, 82, 85, 90, 98, 101, 104, 106, 109, 113, 117, 122, 125, 128, 130, 137, 146, 149, 153, 157, 160, 162, 164, 170, 173, 178, 181, 185, 194, 197, 200, 202, 205, 208, 212, 218, 221, 226, 229, 234, 242, 245, 250, 257, 261
OFFSET
1,1
COMMENTS
Values of a^2 + b^2 such that (a^2 + b^2)^2 + a^2 + b^2 is not of the form x^2 + y^2 where a, b, x, y are nonzero integers.
Terms k of A001481 such that k+1 is not a term of A001481. - Hugo Pfoertner, Jul 07 2023
LINKS
EXAMPLE
5 is a term because 5 = 1^2 + 2^2 and 5^2 + 5 = 30 is not a term of A000404.
MATHEMATICA
Select[Range@ 270, Length@ First@ # >= 1 && Last@ # == {} &[PowersRepresentations[#, 2, 2] /. {0, _} -> Nothing & /@ {#, # (# + 1)} &@ #] &] (* Michael De Vlieger, Apr 14 2016 *)
PROG
(PARI) isA000404(n) = {for( i=1, #n=factor(n)~%4, n[1, i]==3 && n[2, i]%2 && return); n && ( vecmin(n[1, ])==1 || (n[1, 1]==2 && n[2, 1]%2))}
for(n=1, 1e3, if(!isA000404(n*(n+1)) && isA000404(n), print1(n, ", ")));
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Altug Alkan, Apr 14 2016
STATUS
approved
a(n) is the least k < 3*n such that there are exactly n distinct numbers j that can be expressed as sum of two squares with k^2 < j < (k+1)^2, or -1 if such a k does not exist.
+0
5
0, 1, 2, 4, 5, 7, 8, 10, 13, 12, 15, 17, 19, 23, 21, 24, 25, 28, 32, 31, 34, 37, 39, 44, 41, 43, 45, 50, 51, 48, 57, 55, 56, 59, 64, 63, 68, 69, 74, 77, 78, 75, 72, 80, 88, 84, -1, 94, 89, 96, 93, 99, 97, 102, 108, -1, 106, 111, 110, 113, 117, 120, -1, 123, 133, 127, 130, 137, 142, 138, 139, -1, 135
OFFSET
0,3
LINKS
FORMULA
If a(n) != -1, then a(n) >= n/2. - Chai Wah Wu, Jun 22 2023
a(n) = A363763(n) for n <= 11459.
a(n) = -1 for n > 15898.
PROG
(PARI) a363761(upto) = {for (n=0, upto, my(kfound=-1);
for (k=0, 3*n, my(k1=k^2+1, k2=k*(k+2), m=0);
for (j=k1, k2, m+= (sumdiv(j, d, (d%4==1)-(d%4==3))>0); if (m>n, break));
if (m==n, kfound=k; break); if (m==n, kfound=k; break)); print1(kfound, ", "))};
a363761(75)
(Python)
from sympy import factorint
def A363761(n):
for k in range(n>>1, 3*n):
c = 0
for m in range(k**2+1, (k+1)**2):
if all(p==2 or p&3==1 or e&1^1 for p, e in factorint(m).items()):
c += 1
if c>n:
break
if c==n:
return k
return -1 # Chai Wah Wu, Jun 22 2023
CROSSREFS
Identical with A363763 for n <= 11459, but increasingly different afterwards, i.e., a(11460) = -1, whereas A363763(11460) = 34451.
KEYWORD
sign
AUTHOR
Hugo Pfoertner, Jun 22 2023
STATUS
approved
Positive integers which can be expressed as the sum of three or fewer squares, no more than two of which are greater than 1.
+0
2
1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 13, 14, 16, 17, 18, 19, 20, 21, 25, 26, 27, 29, 30, 32, 33, 34, 35, 36, 37, 38, 40, 41, 42, 45, 46, 49, 50, 51, 52, 53, 54, 58, 59, 61, 62, 64, 65, 66, 68, 69, 72, 73, 74, 75, 80, 81, 82, 83, 85, 86, 89, 90, 91, 97, 98, 99, 100
OFFSET
1,2
COMMENTS
These are the numbers which can be a clue in a Tasquare puzzle.
Tasquare also known as Tasukuea.
LINKS
Nikoli, Tasukuea rules [broken link]
EXAMPLE
A 9 clue can be satisfied in multiple ways:
OOO OO OO
OOO OO9OO
OOO9 O
MAPLE
q:= proc(n) local i; for i to isqrt(n) do if ormap(issqr,
[n-i^2, n-i^2-1]) then return true fi od: false
end:
select(q, [$1..100])[]; # Alois P. Heinz, Apr 30 2022
MATHEMATICA
q[n_] := Module[{i}, For[i = 1, i <= Sqrt[n], i++, If[AnyTrue[ {n-i^2, n-i^2-1}, IntegerQ@Sqrt[#]&], Return[True]]]; False];
Select[Range[100], q] (* Jean-François Alcover, Dec 28 2022, after Alois P. Heinz *)
CROSSREFS
Complement of A353219.
Cf. A001481.
KEYWORD
nonn
AUTHOR
Eric Fox, Apr 30 2022
STATUS
approved
a(n) = Sum_{b=0..floor(sqrt(n)), n-b^2 is square} b.
+0
2
1, 1, 0, 2, 3, 0, 0, 2, 3, 4, 0, 0, 5, 0, 0, 4, 5, 3, 0, 6, 0, 0, 0, 0, 12, 6, 0, 0, 7, 0, 0, 4, 0, 8, 0, 6, 7, 0, 0, 8, 9, 0, 0, 0, 9, 0, 0, 0, 7, 13, 0, 10, 9, 0, 0, 0, 0, 10, 0, 0, 11, 0, 0, 8, 20, 0, 0, 10, 0, 0, 0, 6, 11, 12, 0, 0, 0, 0, 0, 12, 9, 10, 0
OFFSET
1,4
COMMENTS
a(n) = 0 if n in A022544.
a(n) > 0 if n in A001481.
LINKS
MATHEMATICA
a[n_]:=Sum[b Boole[IntegerQ[Sqrt[n-b^2]]], {b, 0, Floor[Sqrt[n]]}]; Array[a, 83] (* Stefano Spezia, May 15 2023 *)
PROG
(Python)
from gmpy2 import *
a = lambda n: sum([b for b in range(0, isqrt(n) + 1) if is_square(n - (b*b))])
print([a(n) for n in range(1, 84)])
(Python)
from sympy import divisors
from sympy.solvers.diophantine.diophantine import cornacchia
def A362961(n):
c = 0
for d in divisors(n):
if (k:=d**2)>n:
break
q, r = divmod(n, k)
if not r:
c += sum(d*(a[0]+(a[1] if a[0]!=a[1] else 0)) for a in cornacchia(1, 1, q) or [])
return c # Chai Wah Wu, May 15 2023
(PARI) a(n) = sum(b=0, sqrtint(n), if (issquare(n-b^2), b)); \\ Michel Marcus, May 16 2023
CROSSREFS
Cf. A143574 (sum of b^2), A000925.
KEYWORD
nonn,look
AUTHOR
Darío Clavijo, May 10 2023
STATUS
approved
Positive integers n such that Fibonacci(n) = a^2 + b^2, where a, b are integers.
+0
3
1, 2, 3, 5, 6, 7, 9, 11, 12, 13, 14, 15, 17, 19, 21, 23, 25, 26, 27, 29, 31, 33, 35, 37, 38, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 62, 63, 65, 67, 69, 71, 73, 74, 75, 77, 79, 81, 83, 85, 86, 87, 89, 91, 93, 95, 97, 98, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 121, 122, 123, 125, 127
OFFSET
1,2
COMMENTS
All odd numbers are in this sequence, since the Fibonacci number with index 2m+1 is the sum of the squares of the two Fibonacci numbers with indices m and m+1. Those with even indices ultimately depend on certain Lucas numbers being the sum of two squares (see A124132). Joint work with Kevin O'Bryant and Dennis Eichhorn.
Numbers n such that Fibonacci(n) or Fibonacci(n)/2 is a square are only 0, 1, 2, 3, 6, 12. So a and b must be distinct and nonzero for all values of this sequence except 1, 2, 3, 6, 12. - Altug Alkan, May 04 2016
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..1322 (terms 1..210 from Joerg Arndt)
FORMULA
Intersection of A000045 and A001481.
A000161(A000045(a(n))) > 0. - Reinhard Zumkeller, Oct 10 2013
EXAMPLE
14 is in the sequence because F_14=377=11^2+16^2.
16 is not in the sequence because F_16=987 is congruent to 3 (mod 4).
MATHEMATICA
Select[Range@ 128, SquaresR[2, Fibonacci@ #] > 0 &] (* Michael De Vlieger, May 04 2016 *)
PROG
(PARI) for(n=1, 10^6, t=fibonacci(n); s=sqrtint(t); forstep(i=s, 1, -1, if(issquare(t-i*i), print1(n, ", "); break))) \\ Ralf Stephan, Sep 15 2013
(PARI) is2s(n)={my(f=factor(n)); for(i=1, #f[, 1], if(f[i, 2]%2 && f[i, 1]%4==3, return(0))); 1; } \\ see A001481
for(n=1, 10^6, if(is2s(fibonacci(n)), print1(n, ", "))); \\ Joerg Arndt, Sep 15 2013
(Haskell)
a124134 n = a124134_list !! (n-1)
a124134_list = filter ((> 0) . a000161 . a000045) [1..]
-- Reinhard Zumkeller, Oct 10 2013
(Python)
from itertools import count, islice
from sympy import factorint, fibonacci
def A124134_gen(): # generator of terms
return filter(lambda n:n & 1 or all(p & 3 != 3 or e & 1 == 0 for p, e in factorint(fibonacci(n)).items()), count(1))
A124134_list = list(islice(A124134_gen(), 30)) # Chai Wah Wu, Jun 27 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Melvin J. Knight (melknightdr(AT)verizon.net), Nov 30 2006
EXTENSIONS
More terms from Ralf Stephan, Sep 15 2013
STATUS
approved
Numbers that are not the sum of two squares and two fourth powers.
+0
4
23, 44, 71, 79, 184, 368, 519, 599, 704, 1136, 1264, 2944, 4024, 5888, 8304, 9584, 11264, 18176, 20224, 47104, 64384, 94208, 132864, 153344, 180224, 290816, 323584, 753664, 1030144, 1507328, 2125824, 2453504, 2883584, 4653056, 5177344, 12058624, 16482304
OFFSET
1,1
COMMENTS
From XU Pingya, Feb 07 2018: (Start)
When n is a term, 16n is also. This can be proved as follows:
(1) If w is odd, then 16n - w^4 == 7 (mod 8), and it follows from Legendre's three-square theorem that the equation x^2 + y^2 + z^4 + w^4 = 16n has no solution (it is the same when x, y or z are odd numbers).
(2) If x, y, z and w are even numbers (x = 2a, y = 2b, z = 2c, w = 2d) such that x^2 + y^2 + z^4 + w^4 = 16n, then a^2 + b^2 = 4(n - c^4 - d^4). So there are integers u and v satisfying u^2 + v^2 = n - c^4 - d^4. i.e. u^2 + v^2 + c^4 + d^4 = n, which is a contradiction.
(End)
Conjecture: The set {a(n): n > 0} coincides with {16^k*m: k = 0, 1, 2, ... and m = 23, 44, 71, 79, 184, 519, 599, 4024}. - Zhi-Wei Sun, Jan 27 2022
LINKS
Donovan Johnson, Table of n, a(n) for n = 1..52 (terms <= 4*10^9)
Zhi-Wei Sun, On w^4+x^4+y^2+z^2 over a number field, Question 414791 at MathOverflow, Jan. 27, 2022.
PROG
(PARI)
N=10^6; x='x+O('x^N);
S(e)=sum(j=0, ceil(N^(1/e)), x^(j^e));
v=Vec( S(4)^2 * S(2)^2 );
for(n=1, #v, if(!v[n], print1(n-1, ", ")));
KEYWORD
nonn
AUTHOR
Joerg Arndt, Jul 29 2012
EXTENSIONS
a(29)-a(37) from Donovan Johnson, Jul 29 2012
STATUS
approved

Search completed in 0.122 seconds