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.

A072438 Remove prime factors of form 4*k+1.

Original entry on oeis.org

1, 2, 3, 4, 1, 6, 7, 8, 9, 2, 11, 12, 1, 14, 3, 16, 1, 18, 19, 4, 21, 22, 23, 24, 1, 2, 27, 28, 1, 6, 31, 32, 33, 2, 7, 36, 1, 38, 3, 8, 1, 42, 43, 44, 9, 46, 47, 48, 49, 2, 3, 4, 1, 54, 11, 56, 57, 2, 59, 12, 1, 62, 63, 64, 1, 66, 67, 4, 69, 14, 71, 72, 1, 2, 3, 76, 77, 6, 79, 16, 81, 2
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 17 2002

Keywords

Comments

a(n) <= n; a(a(n)) = a(n).
All factors p^m of a(n) are of the form p=2 or p=4*k+3.

Examples

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

Crossrefs

Programs

  • Maple
    a:= n-> mul(`if`(irem(i[1], 4)=1, 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] == 1, p^e, 1], {pe, FactorInteger[n]}];
    Array[a, 100] (* Jean-François Alcover, May 29 2019 *)
  • PARI
    a(n) = my(f=factor(n)); for (i=1, #f~, if ((f[i,1] % 4) == 1, f[i,1] = 1)); factorback(f); \\ Michel Marcus, Jun 09 2014
    
  • Python
    from sympy import factorint, prod
    def a(n):
        f = factorint(n)
        return 1 if n == 1 else prod(i**f[i] for i in f if i%4 != 1) # Indranil Ghosh, May 08 2017

Formula

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