A108548 Fully multiplicative with a(prime(j)) = A108546(j), where A108546 is the lexicographically earliest permutation of primes such that after 2 the forms 4*k+1 and 4*k+3 alternate, and prime(j) is the j-th prime in A000040.
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 13, 12, 11, 14, 15, 16, 17, 18, 19, 20, 21, 26, 29, 24, 25, 22, 27, 28, 23, 30, 37, 32, 39, 34, 35, 36, 31, 38, 33, 40, 41, 42, 43, 52, 45, 58, 53, 48, 49, 50, 51, 44, 47, 54, 65, 56, 57, 46, 61, 60, 59, 74, 63, 64, 55, 78, 73, 68, 87, 70, 67, 72
Offset: 1
Links
Crossrefs
Programs
-
Mathematica
terms = 72; A111745 = Module[{prs = Prime[Range[2 terms]], m3, m1, min}, m3 = Select[prs, Mod[#, 4] == 3&]; m1 = Select[prs, Mod[#, 4] == 1&]; min = Min[Length[m1], Length[m3]]; Riffle[Take[m3, min], Take[m1, min]]]; A108546[n_] := If[n == 1, 2, A111745[[n - 1]]]; A049084[n_] := PrimePi[n]*Boole[PrimeQ[n]]; a[n_] := If[n == 1, 1, Module[{p, e}, Product[{p, e} = pe; A108546[A049084[p]]^e, {pe, FactorInteger[n]}]]]; Array[a, terms] (* Jean-François Alcover, Nov 19 2021, using Harvey P. Dale's code for A111745 *)
-
PARI
up_to = 26927; \\ One of the prime fixed points. A108546list(up_to) = { my(v=vector(up_to), p,q); v[1] = 2; v[2] = 3; v[3] = 5; for(n=4,up_to, p = v[n-2]; q = nextprime(1+p); while(q%4 != p%4, q=nextprime(1+q)); v[n] = q); (v); }; v108546 = A108546list(up_to); A108546(n) = v108546[n]; A108548(n) = { my(f=factor(n)); f[,1] = apply(A108546,apply(primepi,f[,1])); factorback(f); }; \\ Antti Karttunen, Apr 25 2022
Extensions
Name edited by Antti Karttunen, Apr 25 2022
Comments