A050795 Numbers n such that n^2 - 1 is expressible as the sum of two nonzero squares in at least one way.
3, 9, 17, 19, 33, 35, 51, 73, 81, 99, 105, 129, 145, 147, 161, 163, 179, 195, 201, 233, 243, 273, 289, 291, 297, 339, 361, 387, 393, 451, 465, 467, 483, 489, 513, 521, 577, 579, 585, 611, 627, 649, 675, 721, 723, 739, 777, 801, 809, 819, 849, 883, 899, 915
Offset: 1
Keywords
Examples
E.g. 51^2 - 1 = 10^2 + 50^2 = 22^2 + 46^2 = 34^2 + 38^2.
Links
- Chai Wah Wu, Table of n, a(n) for n = 1..10000
- E.-B. Escott, Query 2521, L'Intermédiaire des Mathématiciens, 10 (1903), 285. [Contains errors]
- Index entries for sequences related to sums of squares
Programs
-
Mathematica
t={}; Do[i=c=1; While[i
Jayanta Basu, Jun 01 2013 *) Select[Range@ 1000, Length[PowersRepresentations[#^2 - 1, 2, 2] /. {0, } -> Nothing] > 0 &] (* _Michael De Vlieger, Apr 13 2016 *) -
PARI
select( {is_A050795(n)=#qfbsolve(Qfb(1,0,1),n^2-1,2)}, [1..999]) \\ M. F. Hasler, Mar 07 2022
-
Python
from itertools import islice, count from sympy import factorint def A050795_gen(startvalue=2): # generator of terms >= startvalue for k in count(max(startvalue,2)): if all(map(lambda d: d[0] % 4 != 3 or d[1] % 2 == 0, factorint(k**2-1).items())): yield k A050795_list = list(islice(A050795_gen(),20)) # Chai Wah Wu, Mar 07 2022
Formula
a(n) = 2*A140612(n) + 1. - Franklin T. Adams-Watters, May 19 2008
{k : A025426(k^2-1)>0}. - R. J. Mathar, Mar 07 2022
Comments