OFFSET
1,8
COMMENTS
The sequence of numbers that never appear in a(n) begins: 1, 2, 3, 11, 27, 35, 51, 53, 79, 83, 89, 93, 117, 123, 125, 135, 143, 145.
The indices n at which a(n)=0 are in A254636. - Vincenzo Librandi, Jul 16 2015
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = Sum({d: d | n+1 and 3 <= d <= sqrt(n+1)}, d + (n+1)/d - 2). - Robert Israel, Aug 05 2015
EXAMPLE
11 = 3*2 + 3 + 2, so a(11)=5.
MAPLE
f:= proc(n) local D, d;
D:= select(t -> (t >= 3 and t^2 <= n+1), numtheory:-divisors(n+1));
add(d + (n+1)/d - 2, d = D);
end proc:
map(f, [$1..100]); # Robert Israel, Aug 05 2015
MATHEMATICA
a[n_] := Sum[Boole[3 <= d <= Sqrt[n+1]] (d+(n+1)/d-2), {d, Divisors[n+1]}];
Array[a, 100] (* Jean-François Alcover, Jun 08 2020, after Maple *)
PROG
(Python)
TOP = 100
a = [0]*TOP
for y in range(2, TOP//2):
for x in range(y, TOP//2):
n = x*y + x + y
if n>=TOP: break
a[n] += x+y
print(a[1:])
(Python)
from sympy import divisors
def A259124(n):
m, c = n+1, 0
for d in divisors(m):
if d**2>m:
break
if d>=3:
c += d+m//d-2
return c # Chai Wah Wu, Oct 15 2024
(PARI) a(n)=sum(y=2, sqrtint(n+1)-1, my(x=(n-y)/(y+1)); if(denominator(x)==1, x+y)) \\ Charles R Greathouse IV, Jun 29 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Alex Ratushnyak, Jun 18 2015
STATUS
approved