# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a069157 Showing 1-1 of 1 %I A069157 #35 May 06 2020 05:10:43 %S A069157 0,1,1,2,1,2,1,3,2,2,1,4,1,2,2,4,1,3,1,4,2,2,1,6,2,2,3,4,1,4,1,5,2,2, %T A069157 2,6,1,2,2,6,1,4,1,4,4,2,1,8,2,3,2,4,1,4,2,6,2,2,1,8,1,2,4,6,2,4,1,4, %U A069157 2,4,1,9,1,2,3,4,2,4,1,8,4,2,1,8,2,2,2,6,1,6,2,4,2,2,2,10,1,3,4,6 %N A069157 Number of positive divisors of n that are divisible by the smallest prime that divides n. %H A069157 Antti Karttunen, Table of n, a(n) for n = 1..10000 %F A069157 a(n) = A000005(n) * A067029(n)/(1+A067029(n)) = d(n) * e_n/(e_n + 1), where d(n) is the number of positive divisors of n and e_n is the exponent of the smallest prime to divide n in the prime factorization of n. %F A069157 a(p) = 1 iff p is prime. - _Bernard Schott_, May 06 2020 %F A069157 a(n) = A000005(n/p) where p is the smallest prime dividing n. - _David A. Corneth_, May 06 2020 %e A069157 The divisors of 12 which are themselves divisible by 2 (the smallest prime dividing 12) are 2, 4, 6 and 12. So the 12th term is 4. %t A069157 a[1] = 0; a[n_] := DivisorSigma[0, n] * (e = FactorInteger[n][[1, 2]])/(e + 1); Array[a, 100] (* _Amiram Eldar_, May 06 2020 *) %o A069157 (Scheme) (define (A069157 n) (let ((e_n (A067029 n))) (* (/ e_n (+ 1 e_n)) (A000005 n)))) ;; (After the formula given by the author of the sequence) - _Antti Karttunen_, Aug 12 2017 %o A069157 (Python) %o A069157 from sympy import divisor_count, factorint %o A069157 def a067029(n): return 0 if n==1 else next(iter(factorint(n).values())) %o A069157 def a(n): return divisor_count(n)*a067029(n)//(1 + a067029(n)) %o A069157 print([a(n) for n in range(1, 51)]) # _Indranil Ghosh_, Aug 12 2017 %o A069157 (PARI) a(n) = if (n==1, 0, my(p=vecmin(factor(n)[,1])); sumdiv(n, d, ((d % p) == 0))); \\ _Michel Marcus_, May 06 2020 %Y A069157 Cf. A000005, A020639, A067029. %K A069157 nonn,easy %O A069157 1,4 %A A069157 _Leroy Quet_, Apr 08 2002 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE