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.

A247503 Completely multiplicative with a(prime(n)) = prime(n)^(n mod 2).

This page as a plain text file.
%I A247503 #45 Dec 26 2022 15:48:30
%S A247503 1,2,1,4,5,2,1,8,1,10,11,4,1,2,5,16,17,2,1,20,1,22,23,8,25,2,1,4,1,10,
%T A247503 31,32,11,34,5,4,1,2,1,40,41,2,1,44,5,46,47,16,1,50,17,4,1,2,55,8,1,2,
%U A247503 59,20,1,62,1,64,5,22,67,68,23,10,1,8,73,2,25,4
%N A247503 Completely multiplicative with a(prime(n)) = prime(n)^(n mod 2).
%C A247503 To compute a(n) replace even-indexed primes in the prime factorization of n by 1.
%C A247503 a(p) = p if p is in A031368.
%C A247503 a(p) = 1 if p is in A031215.
%H A247503 Reinhard Zumkeller, <a href="/A247503/b247503.txt">Table of n, a(n) for n = 1..10000</a>
%H A247503 <a href="/index/Di#divseq">Index to divisibility sequences</a>
%F A247503 When n = Product_{k>=1} prime(k)^r_k, a(n) = Product_{k>=1} prime(k)^(r_k*(k mod 2)).
%F A247503 a(n) = n/A248101(n).
%F A247503 a(n) = Product_{k = 1..A001222(n)} A027746(n,k) and A049084(A027746(n,k)) is odd). - _Reinhard Zumkeller_, Mar 06 2015
%e A247503 Since 10 = 2*5, 2 = prime(1), and 5 = prime(3), a(10) = 2*5 = 10.
%e A247503 Since 9 = 3^2 and 3 is an even-indexed prime, 3 = prime(2), then a(9) = 1^2 = 1.
%e A247503 Since 30 = 2*3*5, 2 = prime(1), 3 = prime(2), and 5 = prime(3), we see that a(30) = 2*1*5 = 10.
%t A247503 f[n_] := Block[{a, g, pf = FactorInteger@ n}, a = PrimePi[First /@ pf]; g[x_] := If[EvenQ@ x, 1, Prime@ x]; Times @@ Power @@@ Transpose@ {g /@ a, Last /@ pf}]; Array[f, 120] (* _Michael De Vlieger_, Mar 03 2015 *)
%t A247503 Array[Times @@ (FactorInteger[#] /. {p_, e_} /; e > 0 :> (p^Mod[PrimePi@ p, 2])^e) &, 76] (* _Michael De Vlieger_, Apr 05 2017 *)
%o A247503 (Sage)
%o A247503 n=100; oddIndexPrimes=[primes_first_n(2*n+1)[2*i] for i in [0..n]]
%o A247503 [prod([(x[0]^(x[0] in oddIndexPrimes))^x[1] for x in factor(n)]) for n in [1..n]]
%o A247503 (PARI) a(n) = {f = factor(n); for (i=1, #f~, f[i,2] *= (primepi(f[i,1]) % 2);); factorback(f);} \\ _Michel Marcus_, Mar 03 2015
%o A247503 (Haskell)
%o A247503 a247503 = product . filter (odd . a049084) . a027746_row
%o A247503 -- _Reinhard Zumkeller_, Mar 06 2015
%o A247503 (Python)
%o A247503 from math import prod
%o A247503 from sympy import factorint, primepi
%o A247503 def A247503(n): return prod(p**e for p, e in factorint(n).items() if primepi(p)&1) # _Chai Wah Wu_, Dec 26 2022
%Y A247503 Cf. A031368, A031215, A248101, A001222, A027746, A049084.
%Y A247503 First 28 terms are the same as A343430.
%K A247503 nonn,mult
%O A247503 1,2
%A A247503 _Tom Edgar_, Mar 03 2015