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.

Showing 1-7 of 7 results.

A072026 Swap twin prime pairs >(3,5) in prime factorization of n.

Original entry on oeis.org

1, 2, 3, 4, 7, 6, 5, 8, 9, 14, 13, 12, 11, 10, 21, 16, 19, 18, 17, 28, 15, 26, 23, 24, 49, 22, 27, 20, 31, 42, 29, 32, 39, 38, 35, 36, 37, 34, 33, 56, 43, 30, 41, 52, 63, 46, 47, 48, 25, 98, 57, 44, 53, 54, 91, 40, 51, 62, 61, 84, 59, 58, 45, 64, 77, 78
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 07 2002

Keywords

Examples

			a(143)=a(11*13)=a(11)*a(13)=13*11=143; a(77)=a(7*11)=a(7)*a(11)=5*13=65.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Product[{p, e} = pe; If[p <= 3, p, If[PrimeQ[p+2], p+2, If[PrimeQ[p-2], p-2, p]]]^e, {pe, FactorInteger[n]}];
    Array[a, 100] (* Jean-François Alcover, Nov 20 2021 *)

Formula

a(a(n)) = n, a self-inverse permutation of natural numbers.
a(n) = n for single primes (A007510) and products of twin prime pairs (A037074).
Multiplicative with a(p) = (if p<=3 then p else (if p+2 is prime then p+2 else (if p-2 is prime then p-2 else p))), p prime.
Sum_{k=1..n} a(k) ~ c * n^2, where c = (1/2) * Product_{p, q primes > 3, p = q+2} ((p^2-p)*(q^2-q)/((p^2-q)*(q^2-p))) = 0.53439004468579249988... . - Amiram Eldar, Dec 24 2022

A072029 Swap twin prime pairs of form (4*k+3,4*(k+1)+1) in prime factorization of n.

Original entry on oeis.org

1, 2, 5, 4, 3, 10, 7, 8, 25, 6, 13, 20, 11, 14, 15, 16, 17, 50, 19, 12, 35, 26, 23, 40, 9, 22, 125, 28, 29, 30, 31, 32, 65, 34, 21, 100, 37, 38, 55, 24, 41, 70, 43, 52, 75, 46, 47, 80, 49, 18, 85, 44, 53, 250, 39, 56, 95, 58, 61, 60, 59, 62, 175, 64, 33
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 07 2002

Keywords

Examples

			a(42) = a(2*3*7) = a(2)*a(3)*a(7) = a(2)*a(4*0+3)*a(7) = 2*(4*1+1)*7 = 2*5*7 = 70.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Product[{p, e} = pe; Which[
         Mod[p, 4] == 3 && PrimeQ[p + 2], p + 2,
         Mod[p, 4] == 1 && PrimeQ[p - 2], p - 2,
         True, p]^e, {pe, FactorInteger[n]}];
    Array[a, 100] (* Jean-François Alcover, Nov 21 2021 *)
  • PARI
    a(n) = {my(f = factor(n)); prod(i = 1, #f~, p = f[i,1]; if(p == 2, p, if(p%4 == 3 && isprime(p+2), p+2, if(p%4 == 1 && isprime(p-2), p-2, p)))^f[i,2]);} \\ Amiram Eldar, Feb 26 2024

Formula

Multiplicative with a(p) = (if p mod 4 = 3 and p+2 is prime then p+2 else (if p mod 4 = 1 and p-2 is prime then p-2 else p)), p prime.
a(a(n))=n, a self-inverse permutation of natural numbers.
Sum_{k=1..n} a(k) ~ c * n^2 / 2, where c = Product_{(p < q) swapped pair} ((p^2-p)*(q^2-q)/((p^2-q)*(q^2-p))) = 1.37140598833326962... . - Amiram Eldar, Feb 26 2024

A072027 Swap (2,3) and all twin prime pairs >(3,5) in prime factorization of n.

Original entry on oeis.org

1, 3, 2, 9, 7, 6, 5, 27, 4, 21, 13, 18, 11, 15, 14, 81, 19, 12, 17, 63, 10, 39, 23, 54, 49, 33, 8, 45, 31, 42, 29, 243, 26, 57, 35, 36, 37, 51, 22, 189, 43, 30, 41, 117, 28, 69, 47, 162, 25, 147, 38, 99, 53, 24, 91, 135, 34, 93, 61, 126, 59, 87, 20, 729, 77
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 07 2002

Keywords

Examples

			a(143) = a(11*13) = a(11)*a(13) = 13*11 = 143.
a(77) = a(7*11) = a(7)*a(11) = 5*13 = 65.
		

Crossrefs

Programs

  • Mathematica
    f[p_, e_] := If[p < 5, 5 - p, If[PrimeQ[p + 2], p + 2, If[PrimeQ[p - 2], p - 2, p]]]^e; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Feb 26 2024 *)
  • PARI
    a(n) = {my(f = factor(n)); prod(i = 1, #f~, p = f[i,1]; if(p < 5, 5-p, if(isprime(p+2), p+2, if(isprime(p-2), p-2, p)))^f[i,2]);} \\ Amiram Eldar, Feb 26 2024

Formula

Multiplicative with a(p) = (if p<=3 then 5-p else (if p+2 is prime then p+2 else (if p-2 is prime then p-2 else p))), p prime.
a(a(n)) = n, self-inverse permutation of natural numbers.
a(n) = n for single primes (A007510) and products of twin prime pairs (A037074).
Sum_{k=1..n} a(k) ~ c * n^2 / 2, where c = Product_{(p < q) swapped pair} ((p^2-p)*(q^2-q)/((p^2-q)*(q^2-p))) = 1.832194438922717... . - Amiram Eldar, Feb 26 2024

A072028 Swap twin prime pairs of form (4*k+1,4*k+3) in prime factorization of n.

Original entry on oeis.org

1, 2, 3, 4, 7, 6, 5, 8, 9, 14, 11, 12, 13, 10, 21, 16, 19, 18, 17, 28, 15, 22, 23, 24, 49, 26, 27, 20, 31, 42, 29, 32, 33, 38, 35, 36, 37, 34, 39, 56, 43, 30, 41, 44, 63, 46, 47, 48, 25, 98, 57, 52, 53, 54, 77, 40, 51, 62, 59, 84, 61, 58, 45, 64, 91, 66
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 07 2002

Keywords

Examples

			a(65) = a(5*13) = a(5)*a(13) = a(4*1+1)*a(13) = (4*1+3)*13 = 7*13 = 91.
		

Crossrefs

Programs

  • Mathematica
    f[p_, e_] := If[p < 5, p, If[(m = Mod[p, 4]) == 1 && PrimeQ[p + 2], p + 2, If[m == 3 && PrimeQ[p - 2], p - 2, p]]]^e; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Feb 26 2024 *)
  • PARI
    a(n) = {my(f = factor(n)); prod(i = 1, #f~, p = f[i,1]; if(p < 5, p, if(p%4 == 1 && isprime(p+2), p+2, if(p%4 == 3 && isprime(p-2), p-2, p)))^f[i,2]);} \\ Amiram Eldar, Feb 26 2024

Formula

Multiplicative with a(p) = (if p mod 4 = 1 and p+2 is prime then p+2 else (if p mod 4 = 3 and p-2 is prime then p-2 else p)), p prime.
a(a(n)) = n, a self-inverse permutation of natural numbers.
Sum_{k=1..n} a(k) ~ c * n^2 / 2, where c = Product_{(p < q) swapped pair} ((p^2-p)*(q^2-q)/((p^2-q)*(q^2-p))) = 1.0627249749498993391... . - Amiram Eldar, Feb 26 2024

A275407 Let e_n(k)>=0 denote the exponent of prime(k) in the prime power representation of n. The sequence lists 1 followed by numbers n for which e_n(2*i-1)=e_n(2*i), for all i>=1.

Original entry on oeis.org

1, 6, 35, 36, 143, 210, 216, 323, 667, 858, 1147, 1225, 1260, 1296, 1763, 1938, 2491, 3599, 4002, 4757, 5005, 5148, 5767, 6882, 7350, 7387, 7560, 7776, 9797, 10578, 11021, 11305, 11628, 12317, 14946, 16637, 19043, 20449, 21594, 22499, 23345, 24012, 25591, 28542
Offset: 1

Views

Author

Vladimir Shevelev, Jul 26 2016

Keywords

Comments

There exists a permutation alpha of the sequence such that {alpha(a(n))} is a completely multiplicative function.
This sequence corresponds to the fixed points of A061898. - Rémy Sigrist, Feb 15 2023

Examples

			15 is not in the sequence, since 15 = 3*5 and the prime index of 5 is odd.
5148 is in the sequence, since 5148 = 2^2*3^2*11*13 and
(1) 3 is the next prime after 2,
(2) the exponents of 2 and 3 are equal,
(3) the prime index of 3 is even,
(4) 13 is the next prime after 11,
(5) the exponents of 11 and 13 are equal,
(6) the prime index of 13 is even.
		

Crossrefs

Programs

  • Mathematica
    inA275407Q:=If[EvenQ[Length[#]],Apply[And,Join[Map[#[[1]]+1==#[[2]]&&EvenQ[#[[2]]]&,PrimePi[#[[1]]]],Map[#[[1]]==#[[2]]&,#[[2]]]]]&[Map[Partition[#,2]&,Transpose[#]]],False]&[FactorInteger[#]]&;
    Join[{1},Select[Range[10000],inA275407Q]] (* Peter J. C. Moses, Jul 29 2016 *)
  • PARI
    isok(n) = {f = factor(n); nbpok = 0; for (k=1, #f~, ip = primepi(f[k, 1]); if ((ip % 2) && (kk = vecsearch(f[,1]~, prime(ip+1))) && (f[kk, 2] == f[k,2]), nbpok++;)); nbpok == #f~/2;} \\ Michel Marcus, Jul 27 2016
    
  • Sage
    def is_A275407(n):
        L = list(factor(n))
        if is_odd(len(L)): return False
        for i in range(0,len(L)//2+1,2):
            if L[i][1] != L[i+1][1]: return False
            if L[i][0] != previous_prime(L[i+1][0]): return False
            if is_even(len(prime_range(1, L[i+1][0]))): return False
        return True
    [n for n in (2..5000) if is_A275407(n)] # Peter Luschny, Jul 27 2016

Extensions

More terms from Peter J. C. Moses, Jul 26 2016

A319523 Square array T(n, k) (n >= 1, k >= 1) read by antidiagonals upwards: T(n, k) is the unique positive integer m such that A319521(m) = n and A319522(m) = k.

Original entry on oeis.org

1, 2, 3, 5, 6, 7, 4, 15, 14, 9, 11, 12, 35, 18, 13, 10, 33, 28, 45, 26, 21, 17, 30, 77, 36, 65, 42, 19, 8, 51, 70, 99, 52, 105, 38, 27, 25, 24, 119, 90, 143, 84, 95, 54, 49, 22, 75, 56, 153, 130, 231, 76, 135, 98, 39, 23, 66, 175, 72, 221, 210, 209, 108, 245
Offset: 1

Views

Author

Rémy Sigrist, Sep 22 2018

Keywords

Examples

			Array T(n, k) begins:
  n\k|    1    2    3    4    5    6    7    8    9   10   11   12
  ---+------------------------------------------------------------
    1|    1    3    7    9   13   21   19   27   49   39   29   63
    2|    2    6   14   18   26   42   38   54   98   78   58  126
    3|    5   15   35   45   65  105   95  135  245  195  145  315
    4|    4   12   28   36   52   84   76  108  196  156  116  252
    5|   11   33   77   99  143  231  209  297  539  429  319  693
    6|   10   30   70   90  130  210  190  270  490  390  290  630
    7|   17   51  119  153  221  357  323  459  833  663  493 1071
    8|    8   24   56   72  104  168  152  216  392  312  232  504
    9|   25   75  175  225  325  525  475  675 1225  975  725 1575
   10|   22   66  154  198  286  462  418  594 1078  858  638 1386
		

Crossrefs

Cf. A001221, A001222, A061898, A275407 (main diagonal), A297002 (first row), A319521, A319522, A319525 (first column).

Programs

  • PARI
    T(n,k) = my (fn=factor(n), fk=factor(k)); prod(i=1, #fn~, prime(2*primepi(fn[i,1])-1)^fn[i,2]) * prod(i=1, #fk~, prime(2*primepi(fk[i,1]))^fk[i,2])

Formula

T(n, k) = A061898(T(k, n)).
T(n, n) = A275407(n).
T(n, 1) = A319525(n).
T(1, k) = A297002(k).
T(n, k) = T(n, 1) * T(1, k) = A319525(n) * A297002(k).
A001221(T(n, k)) = A001221(n) + A001221(k).
A001222(T(n, k)) = A001222(n) + A001222(k).

A360648 Fully multiplicative with a(A027697(k)) = A027699(k) and a(A027699(k)) = A027697(k) for any k > 0.

Original entry on oeis.org

1, 3, 2, 9, 7, 6, 5, 27, 4, 21, 17, 18, 23, 15, 14, 81, 11, 12, 29, 63, 10, 51, 13, 54, 49, 69, 8, 45, 19, 42, 43, 243, 34, 33, 35, 36, 53, 87, 46, 189, 71, 30, 31, 153, 28, 39, 83, 162, 25, 147, 22, 207, 37, 24, 119, 135, 58, 57, 89, 126, 101, 129, 20, 729
Offset: 1

Views

Author

Rémy Sigrist, Feb 15 2023

Keywords

Comments

In other words, we replace odious prime numbers with evil prime numbers and vice versa.
This sequence is a self-inverse permutation of the positive integers.

Examples

			For n = 84:
- 82 = 2^2 * 3 * 7,
- a(2) = a(A027697(1)) = A027699(1) = 3,
- a(3) = a(A027699(1)) = A027697(1) = 2,
- a(7) = a(A027697(2)) = A027699(2) = 5,
- so a(84) = 3^2 * 2 * 5 = 90.
		

Crossrefs

Programs

  • PARI
    See Links section.
Showing 1-7 of 7 results.