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-6 of 6 results.

A100484 The primes doubled; Even semiprimes.

Original entry on oeis.org

4, 6, 10, 14, 22, 26, 34, 38, 46, 58, 62, 74, 82, 86, 94, 106, 118, 122, 134, 142, 146, 158, 166, 178, 194, 202, 206, 214, 218, 226, 254, 262, 274, 278, 298, 302, 314, 326, 334, 346, 358, 362, 382, 386, 394, 398, 422, 446, 454, 458, 466, 478, 482, 502, 514, 526
Offset: 1

Views

Author

Reinhard Zumkeller, Nov 22 2004

Keywords

Comments

Essentially the same as A001747.
Right edge of the triangle in A065342. - Reinhard Zumkeller, Jan 30 2012
A253046(a(n)) > a(n). - Reinhard Zumkeller, Dec 26 2014
Apart from first term, these are the tau2-primes as defined in [Anderson, Frazier] and [Lanterman]. - Michel Marcus, May 15 2019
For every positive integer b and each m in this sequence b^(m-1) == b (mod m). - Florian Baur, Nov 26 2021

Crossrefs

Subsequence of A091376. After the initial 4 also a subsequence of A039956.
Cf. A001748, A253046, A353478 (characteristic function).
Row 3 of A286625, column 3 of A286623.

Programs

Formula

a(n) = 2 * A000040(n).
a(n) = A001747(n+1).
n>1: A000005(a(n)) = 4; A000203(a(n)) = 3*A008864(n); A000010(a(n)) = A006093(n); intersection of A001358 and A005843.
a(n) = A116366(n-1, n-1) for n>1. - Reinhard Zumkeller, Feb 06 2006
a(n) = A077017(n+1), n>1. - R. J. Mathar, Sep 02 2008
A078834(a(n)) = A000040(n). - Reinhard Zumkeller, Sep 19 2011
a(n) = A087112(n, 1). - Reinhard Zumkeller, Nov 25 2012
A000203(a(n)) = 3*n/2 + 3, n > 1. - Wesley Ivan Hurt, Sep 07 2013

Extensions

Simpler definition.

A001748 a(n) = 3 * prime(n).

Original entry on oeis.org

6, 9, 15, 21, 33, 39, 51, 57, 69, 87, 93, 111, 123, 129, 141, 159, 177, 183, 201, 213, 219, 237, 249, 267, 291, 303, 309, 321, 327, 339, 381, 393, 411, 417, 447, 453, 471, 489, 501, 519, 537, 543, 573, 579, 591, 597, 633, 669, 681, 687, 699, 717, 723, 753
Offset: 1

Views

Author

Keywords

Comments

Semiprimes divisible by 3. - Jianing Song, Oct 02 2022

Crossrefs

Programs

Formula

A164023(a(n)) = A164024(a(n)) = A000040(n). - Reinhard Zumkeller, Aug 09 2009
a(n) = 3*A000040(n). - Omar E. Pol, Jan 31 2012
A253046(a(n)) < a(n). - Reinhard Zumkeller, Dec 26 2014

A064614 Exchange 2 and 3 in the prime factorization of n.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Sep 25 2001

Keywords

Comments

A self-inverse permutation of the natural numbers.
a(1) = 1, a(2) = 3, a(3) = 2, a(p) = p for primes p > 3 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 iff n = 6^k * m for k >= 0 and m > 0 with gcd(m, 6) = 1 (see A064615).
A000244 and A000079 give record values and where they occur. - Reinhard Zumkeller, Feb 08 2010

Examples

			a(15) = a(3*5) = a(3)*a(5) = 2*5 = 10;
a(16) = a(2^4) = a(2)^4 = 3^4 = 81;
a(17) = 17;
a(18) = a(2*3^2) = a(2)*a(3^2) = 3*a(3)^2 = 3*2^2 = 12.
		

Crossrefs

Programs

  • Haskell
    a064614 1 = 1
    a064614 n = product $ map f $ a027746_row n where
       f 2 = 3; f 3 = 2; f p = p
    -- Reinhard Zumkeller, Apr 09 2012, Jan 03 2011
    
  • Mathematica
    a[n_] := Times @@ Power @@@ (FactorInteger[n] /. {2, e2_} -> {0, e2} /. {3, e3_} -> {2, e3} /. {0, e2_} -> {3, e2}); Table[a[n], {n, 1, 69}] (* Jean-François Alcover, Nov 20 2012 *)
    a[n_] := n * Times @@ ({3/2, 2/3}^IntegerExponent[n, {2, 3}]); Array[a, 100] (* Amiram Eldar, Sep 20 2020 *)
  • PARI
    a(n)=my(x=valuation(n, 2)-valuation(n, 3)); n*2^-x*3^x \\ Charles R Greathouse IV, Jun 28 2015
  • Python
    from operator import mul
    from functools import reduce
    from sympy import factorint
    def A064614(n):
        return reduce(mul,((5-p if 2<=p<=3 else p)**e for p,e in factorint(n).items())) if n > 1 else n
    # Chai Wah Wu, Dec 27 2014
    

Formula

a(n) = A065330(n) * (2 ^ A007949(n)) * (3 ^ A007814(n)). - Reinhard Zumkeller, Jan 03 2011
Completely multiplicative with a(2) = 3, a(3) = 2, and a(p) = p for primes p > 3. - Charles R Greathouse IV, Jun 28 2015
Sum_{k=1..n} a(k) ~ (6/7) * n^2. - Amiram Eldar, Oct 28 2022
Dirichlet g.f.: zeta(s-1)*((2^s-2)*(3^s-3))/((2^s-3)*(3^s-2)). - Amiram Eldar, Dec 30 2022

A251561 A permutation of the natural numbers: interchange p and 2p for every prime p.

Original entry on oeis.org

1, 4, 6, 2, 10, 3, 14, 8, 9, 5, 22, 12, 26, 7, 15, 16, 34, 18, 38, 20, 21, 11, 46, 24, 25, 13, 27, 28, 58, 30, 62, 32, 33, 17, 35, 36, 74, 19, 39, 40, 82, 42, 86, 44, 45, 23, 94, 48, 49, 50, 51, 52, 106, 54, 55, 56, 57, 29, 118, 60, 122, 31, 63, 64, 65, 66
Offset: 1

Views

Author

N. J. A. Sloane, Dec 26 2014

Keywords

Comments

a(A001751(n)) != A001751(n). - Reinhard Zumkeller, Dec 27 2014

Crossrefs

Programs

  • Haskell
    a251561 1 = 1
    a251561 n | q == 1                    = 2 * p
              | p == 2 && a010051' q == 1 = q
              | otherwise                 = n
              where q = div n p; p = a020639 n
    -- Reinhard Zumkeller, Dec 27 2014
  • Mathematica
    a251561[n_] := Block[{f}, f[x_] := Which[PrimeQ[x], 2 x, PrimeQ[x/2], x/2, True, x]; Array[f, n]]; a251561[66] (* Michael De Vlieger, Dec 26 2014 *)
  • Python
    from sympy import isprime
    def A251561(n):
        if n == 2:
            return 4
        q,r = divmod(n,2)
        if r :
            if isprime(n):
                return 2*n
            return n
        if isprime(q):
            return q
        return n # Chai Wah Wu, Dec 26 2014
    

A253106 Semiprimes with smallest factor <= 3.

Original entry on oeis.org

4, 6, 9, 10, 14, 15, 21, 22, 26, 33, 34, 38, 39, 46, 51, 57, 58, 62, 69, 74, 82, 86, 87, 93, 94, 106, 111, 118, 122, 123, 129, 134, 141, 142, 146, 158, 159, 166, 177, 178, 183, 194, 201, 202, 206, 213, 214, 218, 219, 226, 237, 249, 254, 262, 267, 274, 278
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 26 2014

Keywords

Comments

A253046(a(n)) != a(n).

Crossrefs

Programs

  • Haskell
    a253106 n = a253106_list !! (n-1)
    a253106_list = filter f [1..] where
       f x = p <= 3 && a010051' (div x p) == 1  where p = a020639 x

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
Showing 1-6 of 6 results.