OFFSET
1,2
COMMENTS
Is it known that a(n) always exists? - Franklin T. Adams-Watters, Dec 18 2006
A002635(a(n)) = n. - Reinhard Zumkeller, Jul 13 2014
LINKS
EXAMPLE
a(4)=34 because 34 is smallest number which has 4 partitions 34=4^2+3^2+3^2+0^2 = 4^2+4^2+1^2+1^2 = 5^2+2^2+2^2+1^2 = 5^2+3^2+0^2+0^2
a(3)=18 which has 3 partitions 18=0^2+0^2+3^2+3^2=0^2+1^2+1^2+4^2=1^2+2^2+2^2+3^2.
MATHEMATICA
kmin[n_] := If[n<5, 1, 10n](* empirical, should be lowered in case of doubt *);
a[n_] := a[n] = For[k=kmin[n], True, k++, If[Length[PowersRepresentations[ k, 4, 2]] == n, Return[k]]];
Table[Print[n, " ", a[n]]; a[n], {n, 1, 1000}] (* Jean-François Alcover, Mar 11 2019 *)
PROG
(PARI) cnt4sqr(n)={ local(cnt=0, t2) ; for(x=0, floor(sqrt(n)), for(y=x, floor(sqrt(n-x^2)), for(z=y, floor(n-x^2-y^2), t2=n-x^2-y^2-z^2 ; if( t2>=z^2 && issquare(n-x^2-y^2-z^2), cnt++ ; ) ; ) ; ) ; ) ; return(cnt) ; } A124978(n)= { local(a=1) ; while(1, if( cnt4sqr(a)==n, return(a) ; ) ; a++ ; ) ; } { for(n=1, 100, print(n, " ", A124978(n)) ; ) ; } \\ R. J. Mathar, Nov 29 2006
(Haskell)
import Data.List (elemIndex); import Data.Maybe (fromJust)
a124978 = (+ 1) . fromJust . (`elemIndex` (tail a002635_list))
-- Reinhard Zumkeller, Jul 13 2014
CROSSREFS
KEYWORD
nonn,changed
AUTHOR
Artur Jasinski, Nov 14 2006
EXTENSIONS
Corrected and extended by R. J. Mathar, Nov 29 2006
More terms from Franklin T. Adams-Watters, Dec 18 2006
STATUS
approved