login
A082284
a(n) = smallest number k such that k - tau(k) = n, or 0 if no such number exists, where tau(n) = the number of divisors of n (A000005).
22
1, 3, 6, 5, 8, 7, 9, 0, 0, 11, 14, 13, 18, 0, 20, 17, 24, 19, 22, 0, 0, 23, 25, 27, 0, 0, 32, 29, 0, 31, 34, 35, 40, 0, 38, 37, 0, 0, 44, 41, 0, 43, 46, 0, 50, 47, 49, 51, 56, 0, 0, 53, 0, 57, 58, 0, 0, 59, 62, 61, 72, 65, 68, 0, 0, 67, 0, 0, 0, 71, 74, 73, 84, 77, 0, 0, 81, 79, 82, 0, 88
OFFSET
0,2
COMMENTS
a(p-2) = p for odd primes p.
LINKS
FORMULA
Other identities and observations. For all n >= 0:
a(n) <= A262686(n).
MAPLE
N:= 1000: # to get a(0) .. a(N)
V:= Array(0..N):
for k from 1 to 2*(N+1) do
v:= k - numtheory:-tau(k);
if v <= N and V[v] = 0 then V[v]:= k fi
od:
seq(V[n], n=0..N); # Robert Israel, Dec 21 2015
MATHEMATICA
Table[k = 1; While[k - DivisorSigma[0, k] != n && k <= 2 (n + 1), k++]; If[k > 2 (n + 1), 0, k], {n, 0, 80}]] (* Michael De Vlieger, Dec 22 2015 *)
PROG
(PARI)
allocatemem(123456789);
uplim1 = 2162160 + 320; \\ = A002182(41) + A002183(41).
uplim2 = 2162160;
v082284 = vector(uplim1);
A082284 = n -> if(!n, 1, v082284[n]);
for(n=1, uplim1, k = n-numdiv(n); if((0 == A082284(k)), v082284[k] = n));
for(n=0, 124340, write("b082284.txt", n, " ", A082284(n)));
\\ Antti Karttunen, Dec 21 2015
(Scheme)
(define (A082284 n) (if (zero? n) 1 (let ((u (+ n (A002183 (+ 2 (A261100 n)))))) (let loop ((k n)) (cond ((= (A049820 k) n) k) ((> k u) 0) (else (loop (+ 1 k))))))))
;; Antti Karttunen, Dec 21 2015
CROSSREFS
Column 1 of A265751.
Cf. A262686 (the largest such number), A262511 (positions where these are equal and nonzero).
Cf. A266114 (same sequence sorted into ascending order, with zeros removed).
Cf. A266115 (positive numbers missing from this sequence).
Cf. A266110 (number of iterations before zero is reached), A266116 (final nonzero value reached).
Cf. also tree A263267 and its illustration.
Sequence in context: A330525 A201418 A123688 * A241474 A259556 A063520
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Apr 14 2003
EXTENSIONS
More terms from David Wasserman, Aug 31 2004
STATUS
approved