OFFSET
1,1
MAPLE
with(numtheory):
a:= proc(n) local k;
for k from 2 while (tau(k-1)+tau(k+1)) /tau(k)<>n do od; k
end:
seq(a(n), n=1..50); # Alois P. Heinz, May 19 2011
MATHEMATICA
tau = DivisorSigma[0, #]&;
a[n_] := For[k=2, True, k++, If[(tau[k-1]+tau[k+1])/tau[k]==n, Return[k]]];
Array[a, 50] (* Jean-François Alcover, Mar 27 2017 *)
Module[{nn=300000, tau}, tau=(#[[1]]+#[[3]])/#[[2]]&/@Partition[DivisorSigma[ 0, Range[nn]], 3, 1]; Flatten[Table[Position[tau, n, 1, 1], {n, 50}]]+1] (* Harvey P. Dale, Nov 24 2022 *)
PROG
(Sage)
def A190644(n):
tau = number_of_divisors
return next((k for k in IntegerRange(2, infinity) if tau(k-1)+tau(k+1) == n*tau(k))) # D. S. McNeil, May 19 2011
CROSSREFS
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, May 15 2011
STATUS
approved