cp's OEIS Frontend

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.

A100073 Number of representations of n as the difference of two positive squares.

This page as a plain text file.
%I A100073 #32 Jan 05 2025 19:51:37
%S A100073 0,0,1,0,1,0,1,1,1,0,1,1,1,0,2,1,1,0,1,1,2,0,1,2,1,0,2,1,1,0,1,2,2,0,
%T A100073 2,1,1,0,2,2,1,0,1,1,3,0,1,3,1,0,2,1,1,0,2,2,2,0,1,2,1,0,3,2,2,0,1,1,
%U A100073 2,0,1,3,1,0,3,1,2,0,1,3,2,0,1,2,2,0,2,2,1,0,2,1,2,0,2,4,1,0,3,1,1,0,1,2,4
%N A100073 Number of representations of n as the difference of two positive squares.
%C A100073 Note that for odd n, a(n) = 1 iff n is a prime, or a prime squared.
%C A100073 A decomposition n = a^2 - b^2 = (a-b)(a+b) = d*(n/d) is given for each divisor d less than (as to exclude b = 0) but having the same parity as n/d. For even n this implies that d and n/d must be even, i.e., 4 | n. This leads to the given formula, a(n) = floor(numdiv(n)/2) for odd n, floor(numdiv(n/4)/2) for n = 4k, 0 else. - _M. F. Hasler_, Jul 10 2018
%C A100073 a(n) is the number of self-conjugate partitions of n into parts of 2 different sizes, i.e., the order of the set of partitions obtained by the intersection of the partitions in A000700 and A002133. See A270060. - _R. J. Mathar_, Jun 15 2022
%H A100073 Robert Israel, <a href="/A100073/b100073.txt">Table of n, a(n) for n = 1..10000</a>
%H A100073 A. Tripathi, <a href="https://web.archive.org/web/2024*/https://www.fq.math.ca/Papers1/46_47-4/Tripathi.pdf">On Pythagorean triples containing a fixed integer</a>, Fib. Q., 46/47 (2008/2009), 331-340. See Theorem 5.
%H A100073 Christian Aebi and Grant Cairns, <a href="http://math.colgate.edu/~integers/x48/x48.pdf">Lattice equable quadrilaterals III: tangential and extangential cases</a>, Integers (2023) Vol. 23, #A48.
%F A100073 a(n) = A056924(n) for odd n, a(n) = A056924(n/4) if 4|n, otherwise a(n) = 0.
%e A100073 a(15) = 2 because 15 = 16 - 1 = 64 - 49.
%p A100073 A100073:= proc(n)
%p A100073   if n::odd then floor(numtheory:-tau(n)/2)
%p A100073   elif (n/2)::odd then 0
%p A100073   else floor(numtheory:-tau(n/4)/2)
%p A100073   fi
%p A100073 end proc:
%p A100073 map(A100073, [$1..200]); # _Robert Israel_, Jul 10 2018
%t A100073 nn=150; a=Table[0, {nn}]; Do[y=x-1; While[d=x^2-y^2; d<=nn&&y>0, a[[d]]++; y-- ], {x, 1+nn/2}]; a
%o A100073 (PARI) a(n) = if (n % 2, ceil((numdiv(n)-1)/2), if (!(n%4),  ceil((numdiv(n/4)-1)/2), 0)); \\ _Michel Marcus_, Mar 07 2016
%o A100073 (PARI) A100073(n)=if(bittest(n,0),numdiv(n)\2,!bittest(n,1),numdiv(n\4)\2) \\ or shorter: a(n)=if(n%4!=2,numdiv(n\4^!(n%2))\2) \\ - _M. F. Hasler_, Jul 10 2018
%Y A100073 Cf. A056924 (number of divisors of n that are less than sqrt(n)), A016825 (numbers not the difference of two squares), A034178 (number of representations of n as the difference of two squares).
%Y A100073 Cf. A000700, A002133.
%K A100073 easy,nonn
%O A100073 1,15
%A A100073 _T. D. Noe_, Nov 02 2004