login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A223545 a(n+1) = Sum_{i=1..a(n)} floor(a(n)/i); a(1) = 2. 0

%I #32 Mar 31 2022 03:24:14

%S 2,3,5,10,27,95,447,2795,22616,230244,2878355,43253538,767188892,

%T 15813815440,373816159742,10018819334375,301465449259275,

%U 10097316273301640,373656009129456297,15176615488012528682,672638507261177844871,32362098917994667460975,1682366567474947423409203

%N a(n+1) = Sum_{i=1..a(n)} floor(a(n)/i); a(1) = 2.

%C The corresponding sequence with a(1) = 0 or 1 is a constant sequence. This is also true with a(1) = -1 for a(n+1) = Sum_{i=1..|a(n)|} floor(a(n)/i), but when a(1) = -2 that sequence begins -2, -3, -6, -16, -61, -322, -2227, .... The PARI program below uses the fact mentioned in the example; it calculates the first 15 terms over 16000 times faster than a brute force program simply using s = sum(i = 1, s, s\i). In particular, for any positive integer j, j is a summand exactly floor(a(n)/j) - floor(a(n)/(j+1)) times when calculating a(n+1).

%F From _Anthony Saint-Criq_, Feb 09 2022: (Start)

%F a(n+1) = Sum_{i>=1} floor(a(n)/i).

%F a(n+1) = A006218(a(n)), since the area covered by overlapping partitions of n yields a partition of another integer.

%F (End)

%e a(5) = 10 + 5 + 3 + 2 + 2 + 1 + 1 + 1 + 1 + 1 = 27 since a(4) = 10. In general, this preponderance of relatively large numbers of each of the smallest summands simplifies these calculations. (This pattern is somewhat different when the terms are negative.)

%o (PARI)

%o {a(n, s = 2) =

%o local(j, ss, t);

%o if(s < 0,

%o print("This function only accepts nonnegative starting");

%o print("terms, for which it is (partially) optimized.");

%o return());

%o for(k = 1, n, print1(s, ", ");

%o if(k == n, return(s));

%o ss = s; j = 1;

%o while((t = s\j - s\(j+1)) > 1,

%o ss += t*j;

%o j++);

%o s = ss + sum(i = 2, s\j, s\i))}

%o a(21)

%o (Python)

%o from math import isqrt

%o def A006218(n):

%o r = isqrt(n)

%o return 2*sum(n//k for k in range(1, r+1)) - r**2

%o def afind(an=2):

%o while True:

%o print(an:=A006218(an), end=", ")

%o afind() # _Michael S. Branicky_, Feb 20 2022

%Y Cf. A006218.

%K nonn

%O 1,1

%A _Rick L. Shepherd_, Jul 19 2013

%E a(22)-a(23) from _Michael S. Branicky_, Feb 20 2022

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 15 07:05 EDT 2024. Contains 375172 sequences. (Running on oeis4.)