login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A262123 a(1) + a(2) + ... + a(n) is the representation as a sum of n squares of the smallest integer needing n squares (using the greedy algorithm). 0
1, 1, 1, 4, 16, 144, 7056, 13046544, 42600214749456, 453694852221644777216198544 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,4

LINKS

Table of n, a(n) for n=1..10.

E. Lemoine, Décomposition d'un nombre entier N en ses puissances nièmes maxima, C. R. Acad. Sci. Paris, Vol. 95, pp. 719-722, 1882.

FORMULA

a(1)=1; for n>1, if s = a(1)+a(2)+...+a(n-1) then a(n+1) = floor((s+1)/2)^2.

a(1)+...+a(n) = A006892(n).

a(1)=a(2)=a(3)=1, a(4)=4; for n>=4, a(n+1) = ( a(n)/2+sqrt(a(n)) )^2.

EXAMPLE

23 =16+4+1+1+1 is the first number to need 5 squares for its greedy decomposition, so a(1)=1,a(2)=1,a(3)=1,a(4)=4,a(5)=16.

MAPLE

a:=n->if n=1 then 1 else s:=add(a(k), k=1..n-1); floor((s+1)/2)^2 fi;

MATHEMATICA

a[1] = 1; a[n_] := a[n] = Floor[(Total[Array[a, n-1]]+1)/2]^2; Array[a, 11] (* Jean-François Alcover, Oct 05 2015 *)

PROG

(Python)

def list_a(n):

....list=[1, 1, 1, 4]; root=2; length=4

....while length<n:

........root=root**2//2+root

........list.append(root**2)

........length+=1

....return list

list_a(12)

(PARI) a(n) = if(n<4, 1, if(n==4, 4, (a(n-1)/2 + sqrtint(a(n-1)))^2));

vector(12, n, a(n)) \\ Altug Alkan, Oct 04 2015

CROSSREFS

Cf. A006892.

Sequence in context: A304193 A208661 A334746 * A005749 A005739 A279887

Adjacent sequences:  A262120 A262121 A262122 * A262124 A262125 A262126

KEYWORD

nonn

AUTHOR

Robert FERREOL, Sep 11 2015

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 12 08:50 EDT 2021. Contains 342912 sequences. (Running on oeis4.)