[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
login
Search: a058957 -id:a058957
     Sort: relevance | references | number | modified | created      Format: long | short | data
Number of solutions to n = a^2 - b^2, a > b >= 0.
+10
32
1, 0, 1, 1, 1, 0, 1, 1, 2, 0, 1, 1, 1, 0, 2, 2, 1, 0, 1, 1, 2, 0, 1, 2, 2, 0, 2, 1, 1, 0, 1, 2, 2, 0, 2, 2, 1, 0, 2, 2, 1, 0, 1, 1, 3, 0, 1, 3, 2, 0, 2, 1, 1, 0, 2, 2, 2, 0, 1, 2, 1, 0, 3, 3, 2, 0, 1, 1, 2, 0, 1, 3, 1, 0, 3, 1, 2, 0, 1, 3, 3, 0, 1, 2, 2, 0, 2, 2, 1, 0, 2, 1, 2, 0, 2, 4, 1, 0, 3
OFFSET
1,9
COMMENTS
Also, number of ways n can be expressed as the sum of one or more consecutive odd numbers. (E.g., 45 = 45 = 13+15+17 = 5+7+9+11+13, so a(45)=3.) - Naohiro Nomoto, Feb 26 2002
a(A042965(n))>0, a(A016825(n))=0; also number of occurrences of n in A094728. - Reinhard Zumkeller, May 24 2004
It appears a(n) can be found by adding together the divisor pairs of n and finding the number of even results. For example: n=9 has the divisor pairs (1,9) and (3,3); adding the pairs: 1+9=10 is even and 3+3=6 is even, so a(9)=2. Another example: n=96 has the divisor pairs (1,96) (2,48) (3,32) (4,24) (6,16) (8,12); when each pair is added there are 4 even results, so a(96)=4. - Gregory Bryant, Dec 06 2016
It appears a(n) is the number of nonnegative integers k for which sqrt(k) + sqrt(k + n) is an integer. For example: a(2015) = 4 since there are only four nonnegative integers k for which sqrt(k) + sqrt(k + 2015) is an integer, namely k = 289, 5041, 39601, 1014049. - Joseph Barrera, Nov 29 2020
LINKS
M. A. Nyblom, On the Representation of the Integers as a Difference of Squares, Fibonacci Quart., vol. 40 (2002), no. 3, 243-246.
Edward T. H. Wang, Problem 1717, Crux Mathematicorum, page 30, Vol. 19, Jan. 93.
FORMULA
From Naohiro Nomoto, Feb 26 2002: (Start)
a(2k) = A038548(2k) - A001227(k).
a(2k+1) = A038548(2k+1). (End)
From Bernard Schott, Apr 11 2019: (Start) (see Crux link)
a(n) = 0 if n == 2 (mod 4)
a(n) = floor((A000005(n) + 1)/2) if n == 1 or n == 3 (mod 4)
a(n) = floor((A000005(n/4) + 1)/2) if n == 0 (mod 4). (End)
G.f.: Sum_{i>=1} Sum_{j>=i} Product_{k=i..j} x^(2*k-1). - Ilya Gutkovskiy, Apr 18 2019
G.f.: Sum_{n>=1} x^(n^2)/(1-x^(2*n)) (conjecture). - Joerg Arndt, Jan 04 2024
EXAMPLE
G.f. = x + x^3 + x^4 + x^5 + x^7 + x^8 + 2*x^9 + x^11 + x^12 + x^13 + 2*x^15 + ...
From Bernard Schott, Apr 19 2019: (Start)
a(8) = floor((A000005(2) + 1)/2) = floor(3/2) = 1 and 8 = 3^2 - 1^2.
a(9) = floor((A000005(9) + 1)/2) = floor(4/2) = 2 and 9 = 3^2 - 0^2 = 5^2 - 4^2.
a(10) = 0 and a^2 - b^2 = 10 has no solution.
a(11) = floor(A000005(11) + 1)/2 = floor(3/2) = 1 and 11 = 6^2 - 5^2. (End)
MATHEMATICA
nn = 100; t = Table[0, {nn}]; Do[n = a^2 - b^2; If[n <= nn, t[[n]]++], {a, nn}, {b, 0, a - 1}]; t (* T. D. Noe, May 04 2011 *)
Table[Length[FindInstance[a^2-b^2==n&&a>b>=0, {a, b}, Integers, 10]], {n, 100}] (* Harvey P. Dale, Jul 28 2021 *)
PROG
(PARI) a(n)=sum(k=1, sqrtint(n), (n-k^2)%(2*k)==0) \\ Charles R Greathouse IV, Sep 27 2012
(PARI) a(n)=sumdiv(n, d, n>=d^2 && (n-d^2)%(2*d)==0) \\ Charles R Greathouse IV, Sep 27 2012
(Python)
from sympy import divisor_count as d
def a(n): return (d(n)+1)//2 if n%2==1 else ((d(n//4)+1)//2 if n%4==0 else 0)
# Ely Golden, Jan 26 2025
CROSSREFS
KEYWORD
easy,nonn,nice
STATUS
approved
Values of n such that there are exactly 2 solutions to x^2 - y^2 = n, with x > y >= 0.
+10
10
9, 15, 16, 21, 24, 25, 27, 32, 33, 35, 36, 39, 40, 49, 51, 55, 56, 57, 60, 65, 69, 77, 84, 85, 87, 88, 91, 93, 95, 100, 104, 108, 111, 115, 119, 121, 123, 125, 129, 132, 133, 136, 140, 141, 143, 145, 152, 155, 156, 159, 161, 169, 177, 183, 184, 185, 187, 196
OFFSET
1,1
COMMENTS
A subsequence of A058957. Terms in the latter but not here are 45, 48, 63, 64, 72, 75, 80, 81, 96, 99, ... - M. F. Hasler, Apr 22 2015
LINKS
EXAMPLE
9 is in the sequence because there are 2 solutions to x^2 - y^2 = 9, namely (x,y) = (3,0), (5,4).
MATHEMATICA
r[n_] := Reduce[x^2 - y^2 == n && x > y >= 0, {x, y}, Integers]; Reap[For[n = 1, n < 200, n++, rn = r[n]; If[rn[[0]] === Or && Length[rn] == 2, Print[n]; Sow[n]]]][[2, 1]] (* Jean-François Alcover, Apr 22 2015 *)
PROG
(PARI) is_A257409(n)={A034178(n)==2} \\ M. F. Hasler, Apr 22 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Colin Barker, Apr 22 2015
STATUS
approved
Numbers that are the difference of two positive squares in at least two ways.
+10
4
15, 21, 24, 27, 32, 33, 35, 39, 40, 45, 48, 51, 55, 56, 57, 60, 63, 64, 65, 69, 72, 75, 77, 80, 81, 84, 85, 87, 88, 91, 93, 95, 96, 99, 104, 105, 108, 111, 112, 115, 117, 119, 120, 123, 125, 128, 129, 132, 133, 135, 136, 140, 141, 143, 144, 145, 147, 152, 153, 155, 156
OFFSET
1,1
COMMENTS
Numbers n such that A100073(n) >= 2; see there for more information and formulas.
In sequence A058957 the smaller square is allowed to be zero, therefore it lists all squares > 4 (m^2 - 0^2 = ((m^2+1)/2)^2 - ((m^2-1)/2)^2 if odd, = (m^2/4+1)^2 - (m^2/4-1)^2 if even) in addition to the terms given here, which already comprise squares (64, 144, ...) having more representations than these "trivial" ones. - M. F. Hasler, Jul 11 2018
LINKS
Geoffrey Campbell, Numbers that are the difference of two squares in two or more ways, Number Theory group on LinkedIn, July 8, 2018.
FORMULA
A306102 = { n = 2k+1 | A056924(n) > 1 } U { n = 4k | A056924(n/4) > 1 }. - M. F. Hasler, Jul 10 2018
MATHEMATICA
Select[Range@156, Length@ FindInstance[x^2 - y^2 == # && x>y>0, {x, y}, Integers, 2] == 2 &] (* Giovanni Resta, Jul 10 2018 *)
PROG
(PARI) select( is(n)=A100073(n)>1, [1..200]) \\ M. F. Hasler, Jul 10 2018
CROSSREFS
Contains A306103 and A306104 as subsequences.
KEYWORD
nonn
AUTHOR
Geoffrey B. Campbell (Geoffrey.Campbell(AT)anu.edu.au), Jul 10 2018
STATUS
approved
Numbers that are the difference of two positive squares in at least three ways.
+10
3
45, 48, 63, 72, 75, 80, 96, 99, 105, 112, 117, 120, 128, 135, 144, 147, 153, 160, 165, 168, 171, 175, 176, 180, 189, 192, 195, 200, 207, 208, 216, 224, 225, 231, 240, 243, 245, 252, 255, 256, 261, 264, 272, 273, 275, 279, 280, 285, 288, 297, 300
OFFSET
1,1
COMMENTS
Numbers n such that A100073(n) >= 3; see there for more information & formulas.
LINKS
Geoffrey Campbell, Numbers that are the difference of two squares in two or more ways, Number Theory Group on LinkedIn, July 8, 2018.
FORMULA
A306103 = { n = 2k+1 | A056924(n) > 2 } U { n = 4k | A056924(n/4) > 2 }.
EXAMPLE
48 = 7^2 - 1^2 = 8^2 - 4^2 = 13^2 - 11^2.
MATHEMATICA
Select[Range[300], Length[FindInstance[x^2 - y^2 == # && x>y>0, {x, y}, Integers, 3 ]] == 3 &] (* Giovanni Resta, Jul 10 2018 *)
PROG
(PARI) select( is(n)=A100073(n)>2, [1..300])
CROSSREFS
Subsequence of A306102. Contains A306104 as a subsequence.
KEYWORD
nonn
AUTHOR
Geoffrey B. Campbell and M. F. Hasler, Jul 10 2018
STATUS
approved
Numbers that are the difference of two positive squares in at least four ways.
+10
3
96, 105, 120, 135, 144, 160, 165, 168, 189, 192, 195, 216, 224, 225, 231, 240, 255, 264, 273, 280, 285, 288, 297, 312, 315, 320, 336, 345, 351, 352, 357, 360, 375, 384, 385, 399, 400, 405, 408, 416, 420, 429, 432, 435, 440, 441, 448, 455, 456, 459, 465, 480, 483, 495
OFFSET
1,1
COMMENTS
Numbers n such that A100073(n) >= 4; see there for more information & formulas.
LINKS
Geoffrey Campbell, Numbers that are the difference of two squares in two or more ways, Number Theory Group on LinkedIn, July 8, 2018.
FORMULA
A306104 = { n = 2k+1 | A056924(n) > 3 } U { n = 4k | A056924(n/4) > 3 }.
EXAMPLE
96 = 10^2 - 2^2 = 11^2 - 5^2 = 14^2 - 10^2 = 25^2 - 23^2.
MATHEMATICA
Select[Range@495, Length@ FindInstance[x^2 - y^2 == # && x>y>0, {x, y}, Integers, 4] == 4 &] (* Giovanni Resta, Jul 10 2018 *)
PROG
(PARI) select( is(n)=A100073(n)>3, [1..500])
CROSSREFS
Subsequence of A306103, A306102 and A058957.
KEYWORD
nonn
AUTHOR
Geoffrey B. Campbell and M. F. Hasler, Jul 10 2018
STATUS
approved

Search completed in 0.008 seconds