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.

Previous Showing 11-13 of 13 results.

A181351 Exchange 2 and 5 in the prime factorization of n.

Original entry on oeis.org

1, 5, 3, 25, 2, 15, 7, 125, 9, 10, 11, 75, 13, 35, 6, 625, 17, 45, 19, 50, 21, 55, 23, 375, 4, 65, 27, 175, 29, 30, 31, 3125, 33, 85, 14, 225, 37, 95, 39, 250, 41, 105, 43, 275, 18, 115, 47, 1875, 49, 20, 51, 325, 53, 135, 22, 875, 57, 145, 59, 150, 61, 155, 63
Offset: 1

Views

Author

Jonathan Vos Post, Jan 29 2011

Keywords

Comments

A self-inverse permutation of the natural numbers.
a(1) = 1, a(2) = 5, a(5) = 2, a(p) = p for primes p = 3 and p > 5 and a(u * v) = a(u) * a(v) for u, v > 0.
A permutation of the natural numbers: a(a(n)) = n for all n and a(n) = n if and only if n = 10^k * m for k >= 0 and m > 0 with GCD(m, 10) = 1. This is to (2,5) as A064614 is to (2,3).

Examples

			a(15) = a(3*5) = a(3)*a(5) = 3*2 = 6.
a(16) = a(2^4) = a(2)^4 = 5^4 = 625.
		

Crossrefs

Cf. A064614.

Programs

  • Mathematica
    a[n_] := n * Times @@ ({5/2, 2/5}^IntegerExponent[n, {2, 5}]); Array[a, 100] (* Amiram Eldar, Jul 18 2023 *)
  • PARI
    a(n)=n*(5/2)^valuation(n,2)*(2/5)^valuation(n,5) \\ Charles R Greathouse IV, Dec 07 2011

Formula

Dirichlet g.f.: zeta(s-1)*(2^s-2)*(5^s-5)/((2^s-5)*(5^s-2)). - Amiram Eldar, Jul 18 2023

Extensions

a(20) corrected by Charles R Greathouse IV, Dec 07 2011

A253047 Start with the natural numbers 1,2,3,...; interchange 2*prime(i) and 3*prime(i+1) for each i, and interchange prime(prime(i)) with prime(2*prime(i)) for each i.

Original entry on oeis.org

1, 2, 7, 9, 13, 15, 3, 8, 4, 21, 29, 12, 5, 33, 6, 16, 43, 18, 19, 20, 10, 39, 23, 24, 25, 51, 27, 28, 11, 30, 79, 32, 14, 57, 35, 36, 37, 69, 22, 40, 101, 42, 17, 44, 45, 87, 47, 48, 49, 50, 26, 52, 53, 54, 55, 56, 34, 93, 139, 60, 61, 111, 63
Offset: 1

Views

Author

N. J. A. Sloane, Dec 26 2014

Keywords

Comments

This is an involution on the natural numbers: applying it twice gives the identity permutation.

Crossrefs

Programs

  • Maple
    f:= proc(t)
    local r;
      if t mod 2 = 0 and isprime(t/2) then  3*nextprime(t/2)
      elif t mod 3 = 0 and isprime(t/3) then 2*prevprime(t/3)
      elif isprime(t) then
        r:= numtheory:-pi(t);
        if isprime(r) then ithprime(2*r)
        elif r mod 2 = 0 and isprime(r/2) then ithprime(r/2)
        else t
        fi
      else t
      fi
    end proc:
    seq(f(i),i=1..100); # Robert Israel, Dec 26 2014
  • Mathematica
    f[t_] := Module[{r}, Which[EvenQ[t] && PrimeQ[t/2], 3 NextPrime[t/2], Divisible[t, 3] && PrimeQ[t/3], 2 NextPrime[t/3, -1], PrimeQ[t], r = PrimePi[t]; Which[PrimeQ[r], Prime[2r], EvenQ[r] && PrimeQ[r/2], Prime[r/2], True, t], True, t]];
    Array[f, 100] (* Jean-François Alcover, Jul 27 2020, after Robert Israel *)
  • Python
    from sympy import isprime, primepi, prevprime, nextprime, prime
    def A253047(n):
        if n <= 2:
            return n
        if n == 3:
            return 7
        q2, r2 = divmod(n,2)
        if r2:
            q3, r3 = divmod(n,3)
            if r3:
                if isprime(n):
                    m = primepi(n)
                    if isprime(m):
                        return prime(2*m)
                    x, y = divmod(m,2)
                    if not y:
                        if isprime(x):
                            return prime(x)
                return n
            if isprime(q3):
                return 2*prevprime(q3)
            return n
        if isprime(q2):
            return 3*nextprime(q2)
        return n # Chai Wah Wu, Dec 27 2014

Extensions

Definition supplied by Robert Israel, Dec 26 2014
Offset changed to 1 by Chai Wah Wu, Dec 27 2014

A357872 a(n) = n * (3/2)^(v(n, 2) - v(n, 3)) where v(n, k) = valuation(n, k) mod 2 for n > 0.

Original entry on oeis.org

1, 3, 2, 4, 5, 6, 7, 12, 9, 15, 11, 8, 13, 21, 10, 16, 17, 27, 19, 20, 14, 33, 23, 24, 25, 39, 18, 28, 29, 30, 31, 48, 22, 51, 35, 36, 37, 57, 26, 60, 41, 42, 43, 44, 45, 69, 47, 32, 49, 75, 34, 52, 53, 54, 55, 84, 38, 87, 59, 40, 61, 93, 63, 64, 65, 66, 67, 68, 46, 105, 71, 108, 73, 111
Offset: 1

Views

Author

Werner Schulte, Oct 17 2022

Keywords

Comments

Equivalently: If n = 2^x * 3^y * f with gcd(f, 2) * gcd(f, 3) = 1 and x, y >= 0 and f > 0, then: a(n) = 2^(x - x mod 2 + y mod 2) * 3^(y - y mod 2 + x mod 2) * f for n > 0.
A self-inverse permutation of the natural numbers, i.e., a(a(n)) = n for all n.
Multiplicative but not completely multiplicative (see formula).

Examples

			n = 40320 = 2^(2*3+1)*3^(2*1+0)*5*7, then a(n) = 2^(2*3+0)*3^(2*1+1)*5*7 = 60480.
		

Crossrefs

Programs

  • Maple
    p := (n, k) -> modp(padic[ordp](n, k), 2): a := n -> n*(3/2)^(p(n, 2) - p(n, 3)):
    seq(a(n), n = 1..74); # Peter Luschny, Oct 20 2022
  • Mathematica
    a[n_] := (3/2)^Differences[Mod[IntegerExponent[n, {3, 2}], 2]][[1]] * n; Array[a, 100] (* Amiram Eldar, Oct 20 2022 *)
  • PARI
    a(n) = my(x=valuation(n,2), y=valuation(n,3), f=n/2^x/3^y, x2=x%2, y2 = y%2); 2^(x - x2 + y2) * 3^(y - y2 + x2) * f; \\ Michel Marcus, Oct 19 2022

Formula

Multiplicative with a(p^e) = p^e if e is even or p > 3, a(2^e) = 3 * 2^(e-1) and a(3^e) = 2 * 3^(e-1) if e is odd.
Let n = 2^(2*x+r) * 3^(2*y+s) * Product_{prime p > 3} p^z(p) with 0 <= r,s <= 1; then a(n) = 2^(2*x+s) * 3^(2*y+r) * Product_{prime p > 3} p^z(p); especially: a(n) = n * 2 / 3 if r < s, a(n) = n if r = s, and a(n) = n * 3 / 2 if r > s.
a(n) = n * (3/2)^(A096268(n-1) - A182581(n)) for n > 0.
Sum_{k=1..n} a(k) ~ (77/144) * n^2. - Amiram Eldar, Nov 29 2022
Previous Showing 11-13 of 13 results.