cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-4 of 4 results.

A277885 a(n) = index of the least non-unitary prime divisor of n or 0 if no such prime-divisor exists.

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 0, 1, 2, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0, 1, 0, 0, 0, 1, 3, 0, 2, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 0, 0, 1, 4, 3, 0, 1, 0, 2, 0, 1, 0, 0, 0, 1, 0, 0, 2, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 3, 1, 0, 0, 0, 1, 2, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0, 1, 0, 0, 0, 1, 0, 4, 2, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 0, 0, 1
Offset: 1

Views

Author

Antti Karttunen, Nov 08 2016

Keywords

Crossrefs

Cf. A277697.
Cf. A005117 (gives the positions of zeros).

Programs

  • Mathematica
    Table[PrimePi@ Min[Select[FactorInteger[n][[All, 1]], ! CoprimeQ[#, n/#] &] /. {} -> 0], {n, 120}] (* Michael De Vlieger, Nov 15 2016 *)
  • PARI
    a(n) = {my(f = factor(n)); for(i = 1, #f~, if(f[i, 2] > 1, return(primepi(f[i, 1])))); 0;} \\ Amiram Eldar, Jul 28 2024
  • Python
    from sympy import factorint, primepi, isprime, primefactors
    def a049084(n): return primepi(n)*(1*isprime(n))
    def a055396(n): return 0 if n==1 else a049084(min(primefactors(n)))
    def a028234(n):
        f = factorint(n)
        return 1 if n==1 else n/(min(f)**f[min(f)])
    def a067029(n):
        f=factorint(n)
        return 0 if n==1 else f[min(f)]
    def a(n): return 0 if n==1 else a055396(n) if a067029(n)>1 else a(a028234(n)) # Indranil Ghosh, May 15 2017
    
  • Scheme
    (definec (A277885 n) (cond ((= 1 n) 0) ((< 1 (A067029 n)) (A055396 n)) (else (A277885 (A028234 n)))))
    

Formula

a(1) = 0; for n > 1, if A067029(n) > 1, a(n) = A055396(n), otherwise a(n) = a(A028234(n)). [One may use A032742 instead of A028234 for recursing.]
A008578(1+a(n)) = A249739(n).
For n > 1, a(n) + A277697(n) > 0.

A277698 a(n) = least unitary prime divisor of n or 1 if no such prime-divisor exists.

Original entry on oeis.org

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, 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, 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
Offset: 1

Views

Author

Antti Karttunen, Oct 28 2016

Keywords

Crossrefs

Cf. A001694 (positions of ones).
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).
Differs from A134194 for the first time at n=18, where a(18) = 2, while A134194(18) = 3.

Programs

  • Mathematica
    Table[If[Length@ # == 0, 1, First@ #] &@ Select[FactorInteger[n][[All, 1]], GCD[#, n/#] == 1 &], {n, 105}] (* Michael De Vlieger, Oct 30 2016 *)
  • PARI
    a(n) = {my(f = factor(n)); for(i = 1, #f~, if(f[i, 2] == 1, return(f[i, 1]))); 1;} \\ Amiram Eldar, Jul 28 2024
  • Python
    from sympy import factorint, prime, primepi, isprime, primefactors
    def a049084(n): return primepi(n)*(1*isprime(n))
    def a055396(n): return 0 if n==1 else a049084(min(primefactors(n)))
    def a028234(n):
        f = factorint(n)
        return 1 if n==1 else n/(min(f)**f[min(f)])
    def a067029(n):
        f=factorint(n)
        return 0 if n==1 else f[min(f)]
    def a277697(n): return 0 if n==1 else a055396(n) if a067029(n)==1 else a277697(a028234(n))
    def a008578(n): return 1 if n==1 else prime(n - 1)
    def a(n): return a008578(1 + a277697(n)) # Indranil Ghosh, May 16 2017
    
  • Scheme
    (define (A277698 n) (A008578 (+ 1 (A277697 n))))
    

Formula

a(n) = A008578(1+A277697(n)).
a(n) = A020639(A055231(n)). - Amiram Eldar, Jul 28 2024

A080368 a(n) is the least unitary prime divisor of n, or 0 if no such prime divisor exists.

Original entry on oeis.org

0, 2, 3, 0, 5, 2, 7, 0, 0, 2, 11, 3, 13, 2, 3, 0, 17, 2, 19, 5, 3, 2, 23, 3, 0, 2, 0, 7, 29, 2, 31, 0, 3, 2, 5, 0, 37, 2, 3, 5, 41, 2, 43, 11, 5, 2, 47, 3, 0, 2, 3, 13, 53, 2, 5, 7, 3, 2, 59, 3, 61, 2, 7, 0, 5, 2, 67, 17, 3, 2, 71, 0, 73, 2, 3, 19, 7, 2, 79, 5, 0, 2, 83, 3, 5, 2, 3, 11, 89, 2, 7, 23, 3, 2
Offset: 1

Views

Author

Labos Elemer, Feb 21 2003

Keywords

Examples

			For n = 252100 = 2*2*3*5*5*7*11*11, the unitary prime divisors are {3,7}, the smallest is 3, so a(252100) = 3.
		

Crossrefs

Cf. A001694 (positions of zeros).
Cf. A277698 for a variant which gives 1's instead of 0's for numbers with no unitary prime divisors (A001694).

Programs

  • Haskell
    a080368 n = if null us then 0 else fst $ head us
      where us = filter ((== 1) . snd) $ zip (a027748_row n) (a124010_row n)
    -- Reinhard Zumkeller, Jul 23 2014
    
  • Mathematica
    ffi[x_] := Flatten[FactorInteger[x]]; lf[x_] := Length[FactorInteger[x]]; ba[x_] := Table[Part[ffi[x], 2*w-1], {w, 1, lf[x]}]; gb[x_] := GCD[ba[x], x/ba[x]]; fpg[x_] := Flatten[Position[gb[x], 1]]; upd[x_] := Part[ba[x], fpg[x]]; mxu[x_] := Max[upd[x]]; miu[x_] := Min[upd[x]]; Do[If[Equal[upd[n], {}], Print[0]]; If[ !Equal[upd[n], {}], Print[miu[n]]], {n, 2, 256}]
    Table[If[Or[n == 1, Length@ # == 0], 0, First@ #] &@ Select[FactorInteger[n][[All, 1]], GCD[#, n/#] == 1 &], {n, 94}] (* Michael De Vlieger, Oct 30 2016 *)
    a[n_] := If[(p = Select[FactorInteger[n], Last[#] == 1 &][[;; , 1]]) == {}, 0, Min[p]]; a[1] = 0; Array[a, 100] (* Amiram Eldar, Aug 17 2024 *)
  • PARI
    a(n) = {my(f = factor(n), pmin = 0); for(i = 1, #f~, if(f[i, 2] == 1, if(pmin == 0, pmin = f[i, 1], if(f[i, 1] < pmin, pmin = f[i, 1])))); pmin;} \\ Amiram Eldar, Aug 17 2024
  • Python
    from sympy import factorint, prime, primepi, isprime, primefactors
    def a049084(n): return primepi(n)*(1*isprime(n))
    def a055396(n): return 0 if n==1 else a049084(min(primefactors(n)))
    def a028234(n):
        f = factorint(n)
        return 1 if n==1 else n/(min(f)**f[min(f)])
    def a067029(n):
        f=factorint(n)
        return 0 if n==1 else f[min(f)]
    def a277697(n): return 0 if n==1 else a055396(n) if a067029(n)==1 else a277697(a028234(n))
    def a(n): return 0 if a277697(n)==0 else prime(a277697(n)) # Indranil Ghosh, May 16 2017
    
  • Scheme
    (define (A080368 n) (if (zero? (A277697 n)) 0 (A000040 (A277697 n)))) ;; Antti Karttunen, Oct 28 2016
    

Formula

If A277697(n) = 0, then a(n) = 0, otherwise a(n) = A000040(A277697(n)). - Antti Karttunen, Oct 28 2016
from Amiram Eldar, Aug 17 2024: (Start)
a(n) = 0 if and only of n is powerful (A001694).
a(n) = A020639(A055231(n)) if n is not powerful. (End)

Extensions

a(1)=0 inserted by Reinhard Zumkeller, Jul 23 2014

A277707 a(n) = index of the least prime divisor of n which has an odd exponent, or 0 if n is a perfect square.

Original entry on oeis.org

0, 1, 2, 0, 3, 1, 4, 1, 0, 1, 5, 2, 6, 1, 2, 0, 7, 1, 8, 3, 2, 1, 9, 1, 0, 1, 2, 4, 10, 1, 11, 1, 2, 1, 3, 0, 12, 1, 2, 1, 13, 1, 14, 5, 3, 1, 15, 2, 0, 1, 2, 6, 16, 1, 3, 1, 2, 1, 17, 2, 18, 1, 4, 0, 3, 1, 19, 7, 2, 1, 20, 1, 21, 1, 2, 8, 4, 1, 22, 3, 0, 1, 23, 2, 3, 1, 2, 1, 24, 1, 4, 9, 2, 1, 3, 1, 25, 1, 5, 0, 26, 1, 27, 1, 2
Offset: 1

Views

Author

Antti Karttunen, Oct 28 2016

Keywords

Examples

			For n = 8 = 2*2*2 = prime(1)^3, the exponent of the least (and the only) prime factor 2 is 3, an odd number, thus a(8) = 1 as 2 = prime(1).
		

Crossrefs

Cf. A000290 (after its initial zero-term gives the positions of zeros in this sequence).
Cf. also A277708, A277697.

Programs

  • PARI
    a(n) = my(f = factor(core(n))); if (!#f~, 0, primepi(vecmin(f[,1]))); \\ Michel Marcus, Oct 30 2016
    
  • Python
    from sympy import primepi, isprime, primefactors
    from sympy.ntheory.factor_ import core
    def a049084(n): return primepi(n)*(1*isprime(n))
    def a055396(n): return 0 if n==1 else a049084(min(primefactors(n)))
    def a(n): return a055396(core(n)) # Indranil Ghosh, May 17 2017

Formula

a(1) = 0; for n > 1, if A067029(n) is odd, then a(n) = A055396(n), otherwise a(n) = a(A028234(n)).
a(n) = A055396(A007913(n)).
Showing 1-4 of 4 results.