OFFSET
0,5
LINKS
Alois P. Heinz, Antidiagonals n = 0..20, flattened
FORMULA
EXAMPLE
A(5,3) = 29 -> 10 -> 11 -> 5.
A(5,4) = 78 -> 127 -> 31 -> 11 -> 5.
Square array A(n,k) begins:
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
1, 2, 3, 5, 11, 10, 29, 78, 141, 266, ...
2, 3, 5, 11, 10, 29, 78, 141, 266, 147, ...
3, 5, 11, 10, 29, 78, 141, 266, 147, 194, ...
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, ...
5, 11, 10, 29, 78, 141, 266, 147, 194, 1181, ...
6, 13, 41, 35, 38, 163, 138, 253, 346, 1383, ...
7, 6, 13, 41, 35, 38, 163, 138, 253, 346, ...
8, 19, 15, 14, 43, 191, 201, 217, 1113, 1239, ...
9, 23, 83, 431, 3001, 27457, 10626, 112087, 87306, 172810, ...
MAPLE
with(numtheory):
d:= n-> n*add(i[2]*pi(i[1])/i[1], i=ifactors(n)[2]):
A:= proc() local t, A; t, A:= proc()-1 end, proc()-1 end;
proc(n, k) local h;
while A(n, k) = -1 do
t(k):= t(k)+1; h:= (d@@k)(t(k));
if A(h, k) = -1 then A(h, k):= t(k) fi
od; A(n, k)
end
end():
seq(seq(A(n, h-n), n=0..h), h=0..12);
MATHEMATICA
d[n_] := If[n == 0, 0, n*Total[Last[#]*PrimePi[First[#]]/First[#]& /@ FactorInteger[n]]];
A[n_, k_] := For[m = 0, True, m++, If[Nest[d, m, k] == n, Return[m]]];
Table[A[n, k-n], {k, 0, 12}, {n, 0, k}] // Flatten (* Jean-François Alcover, Mar 20 2017 *)
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Alois P. Heinz, Jun 16 2015
STATUS
approved