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

A048673 Permutation of natural numbers: a(n) = (A003961(n)+1) / 2 [where A003961(n) shifts the prime factorization of n one step towards larger primes].

Original entry on oeis.org

1, 2, 3, 5, 4, 8, 6, 14, 13, 11, 7, 23, 9, 17, 18, 41, 10, 38, 12, 32, 28, 20, 15, 68, 25, 26, 63, 50, 16, 53, 19, 122, 33, 29, 39, 113, 21, 35, 43, 95, 22, 83, 24, 59, 88, 44, 27, 203, 61, 74, 48, 77, 30, 188, 46, 149, 58, 47, 31, 158, 34, 56, 138, 365, 60, 98, 36, 86, 73
Offset: 1

Views

Author

Antti Karttunen, Jul 14 1999

Keywords

Comments

Inverse of sequence A064216 considered as a permutation of the positive integers. - Howard A. Landman, Sep 25 2001
From Antti Karttunen, Dec 20 2014: (Start)
Permutation of natural numbers obtained by replacing each prime divisor of n with the next prime and mapping the generated odd numbers back to all natural numbers by adding one and then halving.
Note: there is a 7-cycle almost right in the beginning: (6 8 14 17 10 11 7). (See also comments at A249821. This 7-cycle is endlessly copied in permutations like A250249/A250250.)
The only 3-cycle in range 1 .. 402653184 is (2821 3460 5639).
For 1- and 2-cycles, see A245449.
(End)
The first 5-cycle is (1410, 2783, 2451, 2703, 2803). - Robert Israel, Jan 15 2015
From Michel Marcus, Aug 09 2020: (Start)
(5194, 5356, 6149, 8186, 10709), (46048, 51339, 87915, 102673, 137205) and (175811, 200924, 226175, 246397, 267838) are other 5-cycles.
(10242, 20479, 21413, 29245, 30275, 40354, 48241) is another 7-cycle. (End)
From Antti Karttunen, Feb 10 2021: (Start)
Somewhat artificially, also this permutation can be represented as a binary tree. Each child to the left is obtained by multiplying the parent by 3 and subtracting one, while each child to the right is obtained by applying A253888 to the parent:
1
|
................../ \..................
2 3
5......../ \........4 8......../ \........6
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
14 13 11 7 23 9 17 18
41 10 38 12 32 28 20 15 68 25 26 63 50 16 53 19
etc.
Each node's (> 1) parent can be obtained with A253889. Sequences A292243, A292244, A292245 and A292246 are constructed from the residues (mod 3) of the vertices encountered on the path from n to the root (1).
(End)

Examples

			For n = 6, as 6 = 2 * 3 = prime(1) * prime(2), we have a(6) = ((prime(1+1) * prime(2+1))+1) / 2 = ((3 * 5)+1)/2 = 8.
For n = 12, as 12 = 2^2 * 3, we have a(12) = ((3^2 * 5) + 1)/2 = 23.
		

Crossrefs

Inverse: A064216.
Row 1 of A251722, Row 2 of A249822.
One more than A108228, half the terms of A243501.
Fixed points: A048674.
Positions of records: A029744, their values: A246360 (= A007051 interleaved with A057198).
Positions of subrecords: A247283, their values: A247284.
Cf. A246351 (Numbers n such that a(n) < n.)
Cf. A246352 (Numbers n such that a(n) >= n.)
Cf. A246281 (Numbers n such that a(n) <= n.)
Cf. A246282 (Numbers n such that a(n) > n.), A252742 (their char. function)
Cf. A246261 (Numbers n for which a(n) is odd.)
Cf. A246263 (Numbers n for which a(n) is even.)
Cf. A246260 (a(n) reduced modulo 2), A341345 (modulo 3), A341346, A292251 (3-adic valuation), A292252.
Cf. A246342 (Iterates starting from n=12.)
Cf. A246344 (Iterates starting from n=16.)
Cf. A245447 (This permutation "squared", a(a(n)).)
Other permutations whose formulas refer to this sequence: A122111, A243062, A243066, A243500, A243506, A244154, A244319, A245605, A245608, A245610, A245612, A245708, A246265, A246267, A246268, A246363, A249745, A249824, A249826, and also A183209, A254103 that are somewhat similar.
Cf. also prime-shift based binary trees A005940, A163511, A245612 and A244154.
Cf. A253888, A253889, A292243, A292244, A292245 and A292246 for other derived sequences.
Cf. A323893 (Dirichlet inverse), A323894 (sum with it), A336840 (inverse Möbius transform).

Programs

  • Haskell
    a048673 = (`div` 2) . (+ 1) . a045965
    -- Reinhard Zumkeller, Jul 12 2012
    
  • Maple
    f:= proc(n)
    local F,q,t;
      F:= ifactors(n)[2];
      (1 + mul(nextprime(t[1])^t[2], t = F))/2
    end proc:
    seq(f(n),n=1..1000); # Robert Israel, Jan 15 2015
  • Mathematica
    Table[(Times @@ Power[If[# == 1, 1, NextPrime@ #] & /@ First@ #, Last@ #] + 1)/2 &@ Transpose@ FactorInteger@ n, {n, 69}] (* Michael De Vlieger, Dec 18 2014, revised Mar 17 2016 *)
  • PARI
    A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ From A003961
    A048673(n) = (A003961(n)+1)/2; \\ Antti Karttunen, Dec 20 2014
    
  • PARI
    A048673(n) = if(1==n,n,if(n%2,A253888(A048673((n-1)/2)),(3*A048673(n/2))-1)); \\ (Not practical, but demonstrates the construction as a binary tree). - Antti Karttunen, Feb 10 2021
    
  • Python
    from sympy import factorint, nextprime, prod
    def a(n):
        f = factorint(n)
        return 1 if n==1 else (1 + prod(nextprime(i)**f[i] for i in f))//2 # Indranil Ghosh, May 09 2017
  • Scheme
    (define (A048673 n) (/ (+ 1 (A003961 n)) 2)) ;; Antti Karttunen, Dec 20 2014
    

Formula

From Antti Karttunen, Dec 20 2014: (Start)
a(1) = 1; for n>1: If n = product_{k>=1} (p_k)^(c_k), then a(n) = (1/2) * (1 + product_{k>=1} (p_{k+1})^(c_k)).
a(n) = (A003961(n)+1) / 2.
a(n) = floor((A045965(n)+1)/2).
Other identities. For all n >= 1:
a(n) = A108228(n)+1.
a(n) = A243501(n)/2.
A108951(n) = A181812(a(n)).
a(A246263(A246268(n))) = 2*n.
As a composition of other permutations involving prime-shift operations:
a(n) = A243506(A122111(n)).
a(n) = A243066(A241909(n)).
a(n) = A241909(A243062(n)).
a(n) = A244154(A156552(n)).
a(n) = A245610(A244319(n)).
a(n) = A227413(A246363(n)).
a(n) = A245612(A243071(n)).
a(n) = A245608(A245605(n)).
a(n) = A245610(A244319(n)).
a(n) = A249745(A249824(n)).
For n >= 2, a(n) = A245708(1+A245605(n-1)).
(End)
From Antti Karttunen, Jan 17 2015: (Start)
We also have the following identities:
a(2n) = 3*a(n) - 1. [Thus a(2n+1) = 0 or 1 when reduced modulo 3. See A341346]
a(3n) = 5*a(n) - 2.
a(4n) = 9*a(n) - 4.
a(5n) = 7*a(n) - 3.
a(6n) = 15*a(n) - 7.
a(7n) = 11*a(n) - 5.
a(8n) = 27*a(n) - 13.
a(9n) = 25*a(n) - 12.
and in general:
a(x*y) = (A003961(x) * a(y)) - a(x) + 1, for all x, y >= 1.
(End)
From Antti Karttunen, Feb 10 2021: (Start)
For n > 1, a(2n) = A016789(a(n)-1), a(2n+1) = A253888(a(n)).
a(2^n) = A007051(n) for all n >= 0. [A property shared with A183209 and A254103].
(End)
a(n) = A003602(A003961(n)). - Antti Karttunen, Apr 20 2022
Sum_{k=1..n} a(k) ~ c * n^2, where c = (1/4) * Product_{p prime} ((p^2-p)/(p^2-nextprime(p))) = 1.0319981... , where nextprime is A151800. - Amiram Eldar, Jan 18 2023

Extensions

New name and crossrefs to derived sequences added by Antti Karttunen, Dec 20 2014

A245606 Permutation of natural numbers: a(1) = 1, a(2n) = 1 + A003961(a(n)), a(2n+1) = A003961(1+a(n)). [Where A003961(n) shifts the prime factorization of n one step left].

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 9, 10, 7, 8, 15, 16, 11, 26, 21, 22, 13, 12, 27, 28, 25, 36, 81, 82, 19, 14, 45, 52, 125, 56, 39, 40, 29, 18, 33, 46, 17, 126, 99, 100, 31, 50, 51, 226, 41, 626, 129, 130, 89, 24, 63, 34, 35, 176, 87, 154, 59, 344, 825, 298, 115, 86, 189, 190, 43, 32, 105, 76, 23, 66, 57, 88, 53, 20
Offset: 1

Views

Author

Antti Karttunen, Jul 29 2014

Keywords

Comments

The even bisection halved gives A245608. The odd bisection incremented by one and halved gives A245708.

Crossrefs

Programs

Formula

a(1) = 1, a(2n) = A243501(a(n)), a(2n+1) = A003961(1+a(n)).
As a composition of related permutations:
a(n) = A064216(A245608(n)).

A244319 Self-inverse permutation of natural numbers: a(1) = 1, a(2n) = A003961(1+a(A064989(2n-1))), a(2n+1) = 1+A003961(a(A064989(2n+1)-1)).

Original entry on oeis.org

1, 3, 2, 9, 6, 5, 26, 11, 4, 21, 8, 125, 56, 25, 16, 15, 344, 115, 36, 1015, 10, 39, 204, 41, 14, 7, 52, 45, 86, 301, 176, 155, 298, 51, 50, 19, 518, 305, 22, 189, 24, 895, 1376, 49, 28, 825, 1268, 11875, 44, 35, 34, 27, 3186, 6625, 2388, 13, 454, 153, 126, 3191, 476, 131
Offset: 1

Views

Author

Antti Karttunen, Jul 18 2014; description corrected and PARI code added Jul 30 2014

Keywords

Comments

After 1, maps each even number to a unique odd number and vice versa, i.e., for all n > 1, A000035(a(n)) XOR A000035(n) = 1, where XOR is given in A003987.

Crossrefs

Related permutations: A048673, A064216, A245609-A245610.
Similar entanglement permutations: A245605-A245606, A235491, A236854, A243347, A244152.

Programs

Formula

a(1) = 1, a(2n) = A003961(1+a(A064989(2n-1))), a(2n+1) = A243501(a(A064989(2n+1)-1)).
As a composition of related permutations:
a(n) = A245609(A048673(n)) = A064216(A245610(n)).

A245448 Permutation of natural numbers: a(n) = A064216(A064216(n)).

Original entry on oeis.org

1, 2, 3, 4, 5, 11, 10, 7, 9, 14, 17, 31, 13, 6, 12, 34, 8, 23, 59, 41, 71, 16, 19, 39, 25, 26, 58, 37, 61, 30, 44, 22, 33, 49, 18, 85, 86, 15, 38, 69, 29, 151, 35, 55, 42, 107, 57, 97, 106, 21, 191, 122, 53, 111, 134, 74, 145, 109, 46, 82, 89, 50, 47, 36, 157, 133, 121, 43, 92, 110, 68, 52, 131, 28
Offset: 1

Views

Author

Antti Karttunen, Jul 22 2014

Keywords

Crossrefs

Inverse: A245447.
Fixed points: A245449.

Programs

Formula

a(n) = A064216(A064216(n)).
For all n >= 1, A243502(n) = A243501(a(n)).

A249734 Even bisection of A003961: Replace in 2n each prime factor p(k) with prime p(k+1).

Original entry on oeis.org

3, 9, 15, 27, 21, 45, 33, 81, 75, 63, 39, 135, 51, 99, 105, 243, 57, 225, 69, 189, 165, 117, 87, 405, 147, 153, 375, 297, 93, 315, 111, 729, 195, 171, 231, 675, 123, 207, 255, 567, 129, 495, 141, 351, 525, 261, 159, 1215, 363, 441, 285, 459, 177, 1125, 273, 891, 345, 279, 183, 945, 201, 333, 825, 2187, 357, 585, 213, 513, 435, 693, 219, 2025, 237, 369
Offset: 1

Views

Author

Antti Karttunen, Nov 23 2014

Keywords

Crossrefs

Row 2 of A246278.
Cf. A249735 (the other bisection of A003961).
Cf. also A000079, A000244.

Formula

a(n) = A003961(2*n).
a(n) = 3 * A003961(n).
a(n) = A064989(A249827(n)).
a(n) = A003961(A243501(A064216(n))).
a(n) = A003961(A243502(A048673(n))).
a(n) = A016945(A048673(n)-1). [Permutation of A016945, 6n+3.]
Other identities. For all n >= 1:
a(A000079(n-1)) = A000244(n). [Maps each 2^n to 3^(n+1).]

A243502 Permutation of even numbers: a(n) = 2 * A064216(n).

Original entry on oeis.org

2, 4, 6, 10, 8, 14, 22, 12, 26, 34, 20, 38, 18, 16, 46, 58, 28, 30, 62, 44, 74, 82, 24, 86, 50, 52, 94, 42, 68, 106, 118, 40, 66, 122, 76, 134, 142, 36, 70, 146, 32, 158, 78, 92, 166, 110, 116, 102, 178, 56, 194, 202, 60, 206, 214, 124, 218, 114, 88, 130, 98, 148, 54, 226, 164, 254, 170, 48
Offset: 1

Views

Author

Antti Karttunen, Jul 21 2014

Keywords

Crossrefs

Programs

Formula

a(n) = 2 * A064216(n) = A005843(A064216(n)).
a(n) = A243501(A245448(n)).

A245447 Permutation of natural numbers: a(n) = A048673(A048673(n)).

Original entry on oeis.org

1, 2, 3, 4, 5, 14, 8, 17, 9, 7, 6, 15, 13, 10, 38, 22, 11, 35, 23, 122, 50, 32, 18, 86, 25, 26, 138, 74, 41, 30, 12, 101, 33, 16, 43, 64, 28, 39, 24, 81, 20, 45, 68, 31, 176, 59, 63, 171, 34, 62, 203, 72, 53, 239, 44, 76, 47, 27, 19, 125, 29, 149, 218, 277, 158, 182, 113, 71, 40
Offset: 1

Views

Author

Antti Karttunen, Jul 22 2014

Keywords

Crossrefs

Inverse: A245448.
Fixed points: A245449.

Programs

Formula

a(n) = A048673(A048673(n)).
a(n) = (1/2) * (1 + A003961((1/2) * (1+A003961(n)))). [Where A003961(n) shifts the prime factorization of n one step left.]
a(n) = ((A003961(A243501(n)/2)) + 1) / 2 = ((A003961(A243501(n))/3) + 1) / 2.
For all n >= 1, A243501(n) = A243502(a(n)).

A253885 Permutation of even numbers: a(n) = A003961(n+1) - 1.

Original entry on oeis.org

0, 2, 4, 8, 6, 14, 10, 26, 24, 20, 12, 44, 16, 32, 34, 80, 18, 74, 22, 62, 54, 38, 28, 134, 48, 50, 124, 98, 30, 104, 36, 242, 64, 56, 76, 224, 40, 68, 84, 188, 42, 164, 46, 116, 174, 86, 52, 404, 120, 146, 94, 152, 58, 374, 90, 296, 114, 92, 60, 314, 66, 110, 274, 728, 118, 194, 70, 170, 144, 230, 72, 674, 78, 122, 244, 206, 142, 254, 82
Offset: 0

Views

Author

Antti Karttunen, Jan 18 2015

Keywords

Crossrefs

Programs

Formula

a(n) = A003961(n+1) - 1.
a(n) = A243501(n+1) - 2.

A269360 Permutation of even numbers: a(n) = 1 + A250469(n).

Original entry on oeis.org

2, 4, 6, 10, 8, 16, 12, 22, 26, 28, 14, 34, 18, 40, 36, 46, 20, 52, 24, 58, 56, 64, 30, 70, 50, 76, 66, 82, 32, 88, 38, 94, 86, 100, 78, 106, 42, 112, 96, 118, 44, 124, 48, 130, 116, 136, 54, 142, 122, 148, 126, 154, 60, 160, 92, 166, 146, 172, 62, 178, 68, 184, 156, 190, 120, 196, 72, 202, 176, 208, 74, 214, 80, 220, 186, 226, 144
Offset: 1

Views

Author

Antti Karttunen, Mar 13 2016

Keywords

Crossrefs

Programs

  • Mathematica
    (* b = A250469 *) b[1] = 1; b[n_] := If[PrimeQ[n], NextPrime[n], m1 = p1 = FactorInteger[n][[1, 1]]; For[ k1 = 1, m1 <= n, m1 += p1; If[m1 == n, Break[]]; If[ FactorInteger[m1][[1, 1]] == p1, k1++]]; m2 = p2 = NextPrime[p1]; For[k2 = 1, True, m2 += p2, If[ FactorInteger[m2][[1, 1]] == p2, k2++]; If[k1+2 == k2, Return[m2]]]];
    a[n_] := b[n] + 1;
    Array[a, 100] (* Jean-François Alcover, Mar 14 2016 *)
  • Scheme
    (define (A269360 n) (+ 1 (A250469 n)))

Formula

a(n) = 1 + A250469(n).
a(n) = 2 + A253886(n-1).

A269854 Permutation of natural numbers: a(1) = 1, a(2n) = 2*a(n), a(2n+1) = 2+A003961(a(n)).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 11, 10, 9, 12, 17, 14, 13, 16, 29, 22, 15, 20, 23, 18, 27, 24, 47, 34, 21, 28, 35, 26, 19, 32, 83, 58, 33, 44, 41, 30, 37, 40, 65, 46, 31, 36, 77, 54, 127, 48, 137, 94, 55, 68, 59, 42, 57, 56, 101, 70, 79, 52, 53, 38, 25, 64, 245, 166, 91, 116, 95, 66, 67, 88, 119, 82, 45, 60, 107, 74, 43, 80, 191, 130, 121, 92, 89, 62, 39
Offset: 1

Views

Author

Antti Karttunen, Mar 16 2016

Keywords

Comments

This sequence can be represented as a binary tree. When the parent contains n, the left hand child contains 2n, while the contents of the right hand child is obtained as 2+A003961(n):
1
|
................../ \..................
2 3
4......../ \........5 6......../ \........7
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
8 11 10 9 12 17 14 13
16 29 22 15 20 23 18 27 24 47 34 21 28 35 26 19
etc.

Crossrefs

Programs

  • PARI
    default(primelimit, (2^31)+(2^30));
    A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ Using code of Michel Marcus
    A269854(n) = if(1==n, 1, if(!(n%2), 2*A269854(n/2), 2+A003961(A269854((n-1)/2))));
    for(n=1, 8192, write("b269854.txt", n, " ", A269854(n)));
    (Scheme, with memoization-macro definec)
    (definec (A269854 n) (cond ((= 1 n) n) ((even? n) (* 2 (A269854 (/ n 2)))) (else (+ 1 (A243501 (A269854 (/ (- n 1) 2)))))))

Formula

a(1) = 1, a(2n) = 2*a(n), a(2n+1) = 2+A003961(a(n)) = 1 + 2*A048673(a(n)).
Showing 1-10 of 10 results.