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.

A072436 Remove prime factors of form 4*k+3.

Original entry on oeis.org

1, 2, 1, 4, 5, 2, 1, 8, 1, 10, 1, 4, 13, 2, 5, 16, 17, 2, 1, 20, 1, 2, 1, 8, 25, 26, 1, 4, 29, 10, 1, 32, 1, 34, 5, 4, 37, 2, 13, 40, 41, 2, 1, 4, 5, 2, 1, 16, 1, 50, 17, 52, 53, 2, 5, 8, 1, 58, 1, 20, 61, 2, 1, 64, 65, 2, 1, 68, 1, 10, 1, 8, 73, 74, 25, 4, 1, 26, 1, 80, 1, 82, 1, 4, 85, 2, 29
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 17 2002

Keywords

Comments

a(n) <= n; a(a(n)) = a(n); for all factors p^m of a(n): p=2 or p=4*k+1.

Examples

			a(90) = a(2*3*3*5) = a(2*(4*0+3)^2*(4*1+1)^1) = 2*1^2*5 = 10.
		

Crossrefs

Equals n / A097706(n).

Programs

  • Maple
    a:= n-> mul(`if`(irem(i[1], 4)=3, 1, i[1]^i[2]), i=ifactors(n)[2]):
    seq(a(n), n=1..100);  # Alois P. Heinz, Jun 09 2014
  • Mathematica
    a[n_] := n/Product[{p, e} = pe; If[Mod[p, 4] == 3, p^e, 1], {pe, FactorInteger[n]}];
    Array[a, 100] (* Jean-François Alcover, May 29 2019 *)
  • PARI
    a(n) = my(f=factor(n)); for (k=1, #f~, if ((f[k,1] % 4) == 3, f[k,1]=1)); factorback(f); \\ Michel Marcus, May 08 2017
  • Python
    from sympy import factorint
    from operator import mul
    def a(n):
        f = factorint(n)
        return 1 if n == 1 else reduce(mul, [1 if i%4==3 else i**f[i] for i in f])# Indranil Ghosh, May 08 2017
    

Formula

Multiplicative with a(p) = (if p==3 (mod 4) then 1 else p).