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.

A061898 Swap each prime in factorization of n with "neighbor" prime.

This page as a plain text file.
%I A061898 #28 Jan 07 2025 05:40:41
%S A061898 1,3,2,9,7,6,5,27,4,21,13,18,11,15,14,81,19,12,17,63,10,39,29,54,49,
%T A061898 33,8,45,23,42,37,243,26,57,35,36,31,51,22,189,43,30,41,117,28,87,53,
%U A061898 162,25,147,38,99,47,24,91,135,34,69,61,126,59,111,20,729,77,78,71,171,58
%N A061898 Swap each prime in factorization of n with "neighbor" prime.
%C A061898 Here "neighbor" primes are just paired in order: 2<->3, 5<->7, 11<->13, etc. Self-inverse permutation of the integers. Multiplicative.
%H A061898 Alois P. Heinz, <a href="/A061898/b061898.txt">Table of n, a(n) for n = 1..20000</a>
%H A061898 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>.
%F A061898 Sum_{k=1..n} a(k) ~ c * n^2, where c = (1/2) * Product_{p prime} (p^2-p)/(p^2-q(p)) = 0.9229142333..., where q(p) is the "neighbor" of p. - _Amiram Eldar_, Nov 29 2022
%e A061898 a(60) = 126 since 60 = 2^2*3*5, swapping 2<->3 and 5<->7 gives 3^2*2*7 = 126 (and of course then a(126) = 60).
%p A061898 p:= proc(n) option remember; `if`(numtheory[pi](n)::odd,
%p A061898        nextprime(n), prevprime(n))
%p A061898     end:
%p A061898 a:= n-> mul(p(i[1])^i[2], i=ifactors(n)[2]):
%p A061898 seq(a(n), n=1..80);  # _Alois P. Heinz_, Sep 13 2017
%t A061898 p[n_] := p[n] = If[OddQ[PrimePi[n]], NextPrime[n], NextPrime[n, -1]];
%t A061898 a[1] = 1; a[n_] := Product[p[i[[1]]]^i[[2]], {i, FactorInteger[n]}];
%t A061898 Array[a, 80] (* _Jean-François Alcover_, Jun 10 2018, after _Alois P. Heinz_ *)
%o A061898 (PARI) a(n) = my(f=factor(n)); for (i=1, #f~, ip = primepi(f[i,1]); if (ip % 2, f[i,1] = prime(ip+1), f[i,1] = prime(ip-1))); factorback(f); \\ _Michel Marcus_, Jun 09 2014
%Y A061898 Cf. A045965, A275407 (fixed points).
%K A061898 easy,nonn,look,mult
%O A061898 1,2
%A A061898 _Marc LeBrun_, May 14 2001