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.

A124980 Smallest strictly positive number decomposable in n different ways as a sum of two squares.

This page as a plain text file.
%I A124980 #36 Jul 16 2024 12:46:59
%S A124980 1,25,325,1105,4225,5525,203125,27625,71825,138125,2640625,160225,
%T A124980 17850625,1221025,1795625,801125,1650390625,2082925,49591064453125,
%U A124980 4005625,44890625,2158203125,30525625,5928325,303460625,53955078125,35409725,100140625
%N A124980 Smallest strictly positive number decomposable in n different ways as a sum of two squares.
%C A124980 The number must be strictly positive, but one of the squares may be zero, as we see from a(1) = 1 = 1^2 + 0^2 and a(2) = 25 = 3^2 + 4^2 = 5^0 + 0^2. - _M. F. Hasler_, Jul 07 2024
%H A124980 Ray Chandler, <a href="/A124980/b124980.txt">Table of n, a(n) for n = 1..1458</a> (a(1459) exceeds 1000 digits).
%F A124980 a(n) = A000446(n), n > 1. - _R. J. Mathar_, Jun 15 2008
%F A124980 a(n) = min(A018782(2n-1), A018782(2n)).
%F A124980 a(n) = min { k > 0 | A000161(k) = n }. - _M. F. Hasler_, Jul 07 2024
%e A124980 a(3) = 325 is decomposable in 3 ways: 15^2 + 10^2 = 17^2 + 6^2 = 18^2 + 1^2.
%o A124980 (PARI) A124980(n)={for(a=1, oo, A000161(a)==n && return(a))} \\ _R. J. Mathar_, Nov 29 2006, edited by _M. F. Hasler_, Jul 07 2024
%o A124980 (PARI)
%o A124980 PD(n, L=n, D=Vecrev(divisors(n)[^1])) = { if(n>1, concat(vector(#D, i, if(D[i] > L, [], D[i] < n, [concat(D[i], P) | P <- PD(n/D[i], D[i])], [[n]]))), [[]])}
%o A124980 apply( {A124980(n)=vecmin([prod(i=1, #a, A002144(i)^(a[i]-1)) | a<-concat([PD(n*2,n), PD(n*2-1)])])}, [1..44]) \\ _M. F. Hasler_, Jul 07 2024
%o A124980 (Python)
%o A124980 from sympy import divisors, isprime, prod
%o A124980 def PD(n, L=None): return [[]] if n==1 else [
%o A124980     [d]+P for d in divisors(n)[:0:-1] if d <= (L or n) for P in PD(n//d, d)]
%o A124980 A2144=lambda upto=999: filter(isprime, range(5, upto, 4))
%o A124980 def A124980(n):
%o A124980     return min(prod(a**(f-1) for a,f in zip(A2144(), P))
%o A124980                for P in PD(n*2, n)+PD(n*2-1)) # _M. F. Hasler_, Jul 07 2024
%Y A124980 Cf. A002144, A018782, A054994, A118882.
%Y A124980 See A016032, A000446 and A093195 for other versions.
%K A124980 nonn
%O A124980 1,2
%A A124980 _Artur Jasinski_, Nov 15 2006
%E A124980 More terms from _R. J. Mathar_, Nov 29 2006
%E A124980 Edited and extended by _Ray Chandler_, Jan 07 2012