login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A297167 a(1) = 0, for n > 1, a(n) = -1 + the excess of n (A046660) + the index of the largest prime factor (A061395). 26

%I #23 Jul 29 2023 20:18:17

%S 0,0,1,1,2,1,3,2,2,2,4,2,5,3,2,3,6,2,7,3,3,4,8,3,3,5,3,4,9,2,10,4,4,6,

%T 3,3,11,7,5,4,12,3,13,5,3,8,14,4,4,3,6,6,15,3,4,5,7,9,16,3,17,10,4,5,

%U 5,4,18,7,8,3,19,4,20,11,3,8,4,5,21,5,4,12,22,4,6,13,9,6,23,3,5,9,10,14,7,5,24,4,5,4,25,6,26,7,3

%N a(1) = 0, for n > 1, a(n) = -1 + the excess of n (A046660) + the index of the largest prime factor (A061395).

%H Antti Karttunen, <a href="/A297167/b297167.txt">Table of n, a(n) for n = 1..10000</a>

%H <a href="/index/Pri#prime_indices">Index entries for sequences computed from indices in prime factorization</a>

%F a(n) = A252464(n) - A001221(n).

%F For n > 1, a(n) = A033265(A156552(n)) = A297113(n) - 1.

%F For n > 1, a(n) = A046660(n) + A061395(n) - 1. - _Antti Karttunen_, Mar 13 2018

%t Array[-1 + PrimeOmega@ # - PrimeNu@ # + PrimePi[FactorInteger[#][[-1, 1]]] /. k_ /; k < 0 -> 0 &, 105] (* or, slightly faster *)

%t Array[-1 + Length@ # - Length@ Union@ # + PrimePi@ Last@ # /. k_ /; k < 0 -> 0 &@ Flatten@ Map[ConstantArray[#1, #2] & @@ # &, #] &@ FactorInteger[#] &, 105] (* _Michael De Vlieger_, Mar 13 2018 *)

%o (PARI)

%o A061395(n) = if(1==n, 0, primepi(vecmax(factor(n)[, 1]))); \\ After _M. F. Hasler_'s code for A006530.

%o A252464(n) = if(1==n, 0, (bigomega(n) + A061395(n) - 1));

%o A297167(n) = (A252464(n) - omega(n));

%o \\ Or just as:

%o A297167(n) = if(1==n, 0, (A061395(n) + (bigomega(n)-omega(n)) - 1));

%o \\ _Antti Karttunen_, Mar 13 2018

%o (Scheme) (define (A297167 n) (- (A252464 n) (A001221 n)))

%o (Python)

%o from sympy import factorint, primepi

%o def A297167(n): return primepi(max(f:=factorint(n)))+sum(e-1 for e in f.values())-1 if n>1 else 0 # _Chai Wah Wu_, Jul 29 2023

%Y Cf. A001221, A033265, A046660, A061395, A156552, A252464, A297113, A297168, A300827.

%K nonn

%O 1,5

%A _Antti Karttunen_, Feb 27 2018

%E Name changed, original equivalent definition is the first entry in the Formula section - _Antti Karttunen_, Mar 13 2018

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 10:31 EDT 2024. Contains 371791 sequences. (Running on oeis4.)