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
2, 3, 5, 10, 27, 95, 447, 2795, 22616, 230244, 2878355, 43253538, 767188892, 15813815440, 373816159742, 10018819334375, 301465449259275, 10097316273301640, 373656009129456297, 15176615488012528682, 672638507261177844871, 32362098917994667460975, 1682366567474947423409203 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
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).
LINKS
FORMULA
From Anthony Saint-Criq, Feb 09 2022: (Start)
a(n+1) = Sum_{i>=1} floor(a(n)/i).
a(n+1) = A006218(a(n)), since the area covered by overlapping partitions of n yields a partition of another integer.
(End)
EXAMPLE
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.)
PROG
(PARI)
{a(n, s = 2) =
local(j, ss, t);
if(s < 0,
print("This function only accepts nonnegative starting");
print("terms, for which it is (partially) optimized.");
return());
for(k = 1, n, print1(s, ", ");
if(k == n, return(s));
ss = s; j = 1;
while((t = s\j - s\(j+1)) > 1,
ss += t*j;
j++);
s = ss + sum(i = 2, s\j, s\i))}
a(21)
(Python)
from math import isqrt
def A006218(n):
r = isqrt(n)
return 2*sum(n//k for k in range(1, r+1)) - r**2
def afind(an=2):
while True:
print(an:=A006218(an), end=", ")
afind() # Michael S. Branicky, Feb 20 2022
CROSSREFS
Cf. A006218.
Sequence in context: A133662 A204518 A336991 * A088938 A000617 A132183
KEYWORD
nonn
AUTHOR
Rick L. Shepherd, Jul 19 2013
EXTENSIONS
a(22)-a(23) from Michael S. Branicky, Feb 20 2022
STATUS
approved

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 April 25 16:38 EDT 2024. Contains 371989 sequences. (Running on oeis4.)