A109886 Index of first occurrence of n in A109883, or -1 if n does not occur in A109883.
1, 2, 3, 30, 5, 9, 7, 50, 20, 42, 11, 36, 13, 6510, 27, 54, 17, 70620, 19, 25, 46, 66, 23, 168630, 124, 98, 58, 78, 29
Offset: 0
Examples
a(7) = 50: divisors of 50 are 1,2,5,10,25,50; 50 - (1 + 2 + 5 + 10 + 25) = 7 and 50 is the smallest such number.
Programs
-
Maple
with(numtheory); pdef := proc(n) local k, d, divd; d:=n; divd:=sort([op(divisors(n))]); for k in divd while d>=k do d:=d-k; od; end: PDL:=[]; for z from 1 to 1 do for pd from 0 to 60 do for n from 1 to 200000 do missed:=true; if pdef(n)=pd then PDL:=[op(PDL),n]; missed:=false; break fi od; if missed then PDL:=[op(PDL),-1] fi od od; PDL; # Walter Kehowski, Sep 13 2005
-
Mathematica
subtract = If[ #1 < #2, Throw[ #1], #1 - #2]&; f[n_] := Catch @ Fold[subtract, n, Divisors @ n] (* Bobby R. Treat, (DrBob(AT)bigfoot.com), Jul 14 2005 *) t = Table[0, {60}]; Do[ a = f[n]; If[a < 60 && t[[a + 1]] == 0, t[[a + 1]] = n], {n, 10^8}] (* Robert G. Wilson v, Jul 14 2005 *)
Extensions
Corrected and extended by Jason Earls, Jul 12 2005
More terms from Walter Kehowski, Sep 13 2005
Comments