login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

n read modulo (number of divisors of n).
5

%I #35 Oct 27 2023 22:00:45

%S 0,0,1,1,1,2,1,0,0,2,1,0,1,2,3,1,1,0,1,2,1,2,1,0,1,2,3,4,1,6,1,2,1,2,

%T 3,0,1,2,3,0,1,2,1,2,3,2,1,8,1,2,3,4,1,6,3,0,1,2,1,0,1,2,3,1,1,2,1,2,

%U 1,6,1,0,1,2,3,4,1,6,1,0,1,2,1,0,1,2,3,0,1,6,3,2,1,2,3,0,1,2,3,1,1,6,1,0,1

%N n read modulo (number of divisors of n).

%C a(n)=0 iff n is a refactorable number (cf. A033950). - _Franz Vrabec_, Oct 16 2005

%C a(A066708(n)) = n and a(m) < n for m < A066708(n). - _Reinhard Zumkeller_, Sep 17 2014

%H Reinhard Zumkeller, <a href="/A054008/b054008.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = n mod tau(n).

%p [ seq( i mod tau(i), i=1..130) ];

%t a[n_] := Mod[n, DivisorSigma[0, n]]; Array[a, 105] (* _Jean-François Alcover_, Sep 19 2017 *)

%o (Haskell)

%o a054008 n = n `mod` a000005 n -- _Reinhard Zumkeller_, Sep 17 2014

%o (PARI) a(n) = n % numdiv(n); \\ _Michel Marcus_, Sep 19 2017

%o (Python)

%o from sympy import divisor_count

%o def A054008(n): return n%divisor_count(n) # _Chai Wah Wu_, Mar 14 2023

%Y Cf. A000005, A054009, A033950, A066708.

%K nonn

%O 1,6

%A _Asher Auel_, Jan 12 2000