login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

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

%I #24 Dec 23 2015 14:02:37

%S 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,

%T 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,

%U 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

%N 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).

%C a(p-2) = p for odd primes p.

%H Antti Karttunen, <a href="/A082284/b082284.txt">Table of n, a(n) for n = 0..124340</a>

%F Other identities and observations. For all n >= 0:

%F a(n) <= A262686(n).

%p N:= 1000: # to get a(0) .. a(N)

%p V:= Array(0..N):

%p for k from 1 to 2*(N+1) do

%p v:= k - numtheory:-tau(k);

%p if v <= N and V[v] = 0 then V[v]:= k fi

%p od:

%p seq(V[n],n=0..N); # _Robert Israel_, Dec 21 2015

%t 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 *)

%o (PARI)

%o allocatemem(123456789);

%o uplim1 = 2162160 + 320; \\ = A002182(41) + A002183(41).

%o uplim2 = 2162160;

%o v082284 = vector(uplim1);

%o A082284 = n -> if(!n,1,v082284[n]);

%o for(n=1, uplim1, k = n-numdiv(n); if((0 == A082284(k)), v082284[k] = n));

%o for(n=0, 124340, write("b082284.txt", n, " ", A082284(n)));

%o \\ _Antti Karttunen_, Dec 21 2015

%o (Scheme)

%o (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))))))))

%o ;; _Antti Karttunen_, Dec 21 2015

%Y Column 1 of A265751.

%Y Cf. A000005, A002182, A002183, A049820, A060990, A261100.

%Y Cf. A262686 (the largest such number), A262511 (positions where these are equal and nonzero).

%Y Cf. A266114 (same sequence sorted into ascending order, with zeros removed).

%Y Cf. A266115 (positive numbers missing from this sequence).

%Y Cf. A266110 (number of iterations before zero is reached), A266116 (final nonzero value reached).

%Y Cf. also tree A263267 and its illustration.

%K nonn

%O 0,2

%A _Amarnath Murthy_, Apr 14 2003

%E More terms from _David Wasserman_, Aug 31 2004