This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A034178 #75 Feb 07 2025 22:57:28 %S A034178 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, %T A034178 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, %U A034178 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 %N A034178 Number of solutions to n = a^2 - b^2, a > b >= 0. %C A034178 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 %C A034178 a(A042965(n))>0, a(A016825(n))=0; also number of occurrences of n in A094728. - _Reinhard Zumkeller_, May 24 2004 %C A034178 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 %C A034178 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 %H A034178 T. D. Noe, <a href="/A034178/b034178.txt">Table of n, a(n) for n = 1..2000</a> %H A034178 M. A. Nyblom, <a href="https://web.archive.org/web/2024*/https://www.fq.math.ca/Scanned/40-3/nyblom.pdf">On the Representation of the Integers as a Difference of Squares</a>, Fibonacci Quart., vol. 40 (2002), no. 3, 243-246. %H A034178 Edward T. H. Wang, <a href="https://cms.math.ca/crux/backfile/Crux_v19n01_Jan.pdf">Problem 1717</a>, Crux Mathematicorum, page 30, Vol. 19, Jan. 93. %F A034178 From _Naohiro Nomoto_, Feb 26 2002: (Start) %F A034178 a(2k) = A038548(2k) - A001227(k). %F A034178 a(2k+1) = A038548(2k+1). (End) %F A034178 From _Bernard Schott_, Apr 11 2019: (Start) (see Crux link) %F A034178 a(n) = 0 if n == 2 (mod 4) %F A034178 a(n) = floor((A000005(n) + 1)/2) if n == 1 or n == 3 (mod 4) %F A034178 a(n) = floor((A000005(n/4) + 1)/2) if n == 0 (mod 4). (End) %F A034178 G.f.: Sum_{i>=1} Sum_{j>=i} Product_{k=i..j} x^(2*k-1). - _Ilya Gutkovskiy_, Apr 18 2019 %F A034178 G.f.: Sum_{n>=1} x^(n^2)/(1-x^(2*n)) (conjecture). - _Joerg Arndt_, Jan 04 2024 %e A034178 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 + ... %e A034178 From _Bernard Schott_, Apr 19 2019: (Start) %e A034178 a(8) = floor((A000005(2) + 1)/2) = floor(3/2) = 1 and 8 = 3^2 - 1^2. %e A034178 a(9) = floor((A000005(9) + 1)/2) = floor(4/2) = 2 and 9 = 3^2 - 0^2 = 5^2 - 4^2. %e A034178 a(10) = 0 and a^2 - b^2 = 10 has no solution. %e A034178 a(11) = floor(A000005(11) + 1)/2 = floor(3/2) = 1 and 11 = 6^2 - 5^2. (End) %t A034178 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 *) %t A034178 Table[Length[FindInstance[a^2-b^2==n&&a>b>=0,{a,b},Integers,10]],{n,100}] (* _Harvey P. Dale_, Jul 28 2021 *) %o A034178 (PARI) a(n)=sum(k=1, sqrtint(n), (n-k^2)%(2*k)==0) \\ _Charles R Greathouse IV_, Sep 27 2012 %o A034178 (PARI) a(n)=sumdiv(n, d, n>=d^2 && (n-d^2)%(2*d)==0) \\ _Charles R Greathouse IV_, Sep 27 2012 %o A034178 (Python) %o A034178 from sympy import divisor_count as d %o A034178 def a(n): return (d(n)+1)//2 if n%2==1 else ((d(n//4)+1)//2 if n%4==0 else 0) %o A034178 # _Ely Golden_, Jan 26 2025 %Y A034178 Cf. A000005, A058957, A016825. %K A034178 easy,nonn,nice %O A034178 1,9 %A A034178 _Erich Friedman_