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!)
A277698 a(n) = Least unitary prime divisor of n or 1 if no such prime-divisor exists. 5

%I #15 May 17 2017 03:19:53

%S 1,2,3,1,5,2,7,1,1,2,11,3,13,2,3,1,17,2,19,5,3,2,23,3,1,2,1,7,29,2,31,

%T 1,3,2,5,1,37,2,3,5,41,2,43,11,5,2,47,3,1,2,3,13,53,2,5,7,3,2,59,3,61,

%U 2,7,1,5,2,67,17,3,2,71,1,73,2,3,19,7,2,79,5,1,2,83,3,5,2,3,11,89,2,7,23,3,2,5,3,97,2,11,1,101,2,103,13,3

%N a(n) = Least unitary prime divisor of n or 1 if no such prime-divisor exists.

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

%F a(n) = A008578(1+A277697(n)).

%t Table[If[Length@ # == 0, 1, First@ #] &@ Select[FactorInteger[n][[All, 1]], GCD[#, n/#] == 1 &], {n, 105}] (* _Michael De Vlieger_, Oct 30 2016 *)

%o (Scheme) (define (A277698 n) (A008578 (+ 1 (A277697 n))))

%o (Python)

%o from sympy import factorint, prime, primepi, isprime, primefactors

%o def a049084(n): return primepi(n)*(1*isprime(n))

%o def a055396(n): return 0 if n==1 else a049084(min(primefactors(n)))

%o def a028234(n):

%o f = factorint(n)

%o return 1 if n==1 else n/(min(f)**f[min(f)])

%o def a067029(n):

%o f=factorint(n)

%o return 0 if n==1 else f[min(f)]

%o def a277697(n): return 0 if n==1 else a055396(n) if a067029(n)==1 else a277697(a028234(n))

%o def a008578(n): return 1 if n==1 else prime(n - 1)

%o def a(n): return a008578(1 + a277697(n)) # _Indranil Ghosh_, May 16 2017

%Y Cf. A008578, A277697.

%Y Cf. A001694 (positions of ones).

%Y Cf. A080368 for a variant which gives 0's instead of 1's for numbers with no unitary prime divisors and also A277708 (the least prime factor with an odd exponent).

%Y Differs from A134194 for the first time at n=18, where a(18) = 2, while A134194(18) = 3.

%K nonn

%O 1,2

%A _Antti Karttunen_, Oct 28 2016

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 19:02 EDT 2024. Contains 371798 sequences. (Running on oeis4.)