OFFSET
1,1
COMMENTS
Also includes perfect numbers.
Are there numbers that contain multiple contiguous divisor sums?
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000 (first 1000 terms from Matthew Schuster)
Matthew Schuster, A236359.cpp; source file
EXAMPLE
The proper divisors of 132 are [1,2,3,4,6,11,12,22,33,44,66]; the contiguous divisor set 4,6,11,12,22,33,44 sums to 132.
MATHEMATICA
aQ[n_] := Catch@Block[{d = Most@Divisors@n, s, i=1}, s = Accumulate@d; While[s != {}, If[MemberQ[s, n], Throw@True, s = Rest[s - d[[i++]]]]]; False]; Select[ Range@ 726, aQ] (* Giovanni Resta, Jan 23 2014 *)
Select[Range[800], MemberQ[Flatten[Table[Total/@Partition[Most[Divisors[ #]], n, 1], {n, DivisorSigma[0, #]-1}]], #]&] (* Harvey P. Dale, Apr 25 2015 *)
PROG
(PARI) is(n)=my(d=divisors(n), i=1, j=1, s=1); while(i<#d, s+=d[i++]; while(s>n, s-=d[j]; j++); if(s==n, return(i<#d))); 0 \\ Charles R Greathouse IV, Jan 23 2014
(Python)
from sympy import divisors
A236359_list = []
for n in range(1, 10**3):
....d = divisors(n)
....d.pop()
....ld = len(d)
....if sum(d) >= n:
........s, j = d[0], 1
........for i in range(ld-1):
............while s < n and j < ld:
................s += d[j]
................j += 1
............if s == n:
................A236359_list.append(n)
................break
............j -= 1
............s -= d[i]+d[j] # Chai Wah Wu, Sep 16 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Matthew Schuster, Jan 23 2014
STATUS
approved