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.

This page as a plain text file.
%I A072438 #25 Jan 10 2025 01:17:57
%S A072438 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,
%T A072438 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,
%U A072438 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
%N A072438 Remove prime factors of form 4*k+1.
%C A072438 a(n) <= n; a(a(n)) = a(n).
%C A072438 All factors p^m of a(n) are of the form p=2 or p=4*k+3.
%H A072438 Alois P. Heinz, <a href="/A072438/b072438.txt">Table of n, a(n) for n = 1..10000</a>
%F A072438 Multiplicative with a(p)=(if p==1 (mod 4) then 1 else p).
%e A072438 a(90) = a(2*3*3*5) = a(2*(4*0+3)^2*(4*1+1)^1) = 2*3^2*1 = 18.
%p A072438 a:= n-> mul(`if`(irem(i[1], 4)=1, 1, i[1]^i[2]), i=ifactors(n)[2]):
%p A072438 seq(a(n), n=1..100);  # _Alois P. Heinz_, Jun 09 2014
%t A072438 a[n_] := n/Product[{p, e} = pe; If[Mod[p, 4] == 1, p^e, 1], {pe, FactorInteger[n]}];
%t A072438 Array[a, 100] (* _Jean-François Alcover_, May 29 2019 *)
%o A072438 (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
%o A072438 (Python)
%o A072438 from sympy import factorint, prod
%o A072438 def a(n):
%o A072438     f = factorint(n)
%o A072438     return 1 if n == 1 else prod(i**f[i] for i in f if i%4 != 1) # _Indranil Ghosh_, May 08 2017
%Y A072438 Cf. A072436, A004144, A002144, A002145.
%K A072438 nonn,mult,easy
%O A072438 1,2
%A A072438 _Reinhard Zumkeller_, Jun 17 2002