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 85 results. Next

A268385 a(1) = 1, for n > 1, a(n) = A020639(n)^A193231(A067029(n)) * a(A028234(n)).

Original entry on oeis.org

1, 2, 3, 8, 5, 6, 7, 4, 27, 10, 11, 24, 13, 14, 15, 32, 17, 54, 19, 40, 21, 22, 23, 12, 125, 26, 9, 56, 29, 30, 31, 16, 33, 34, 35, 216, 37, 38, 39, 20, 41, 42, 43, 88, 135, 46, 47, 96, 343, 250, 51, 104, 53, 18, 55, 28, 57, 58, 59, 120, 61, 62, 189, 64, 65, 66, 67, 136, 69, 70, 71, 108, 73, 74, 375, 152, 77, 78, 79, 160, 243
Offset: 1

Views

Author

Antti Karttunen, Feb 10 2016

Keywords

Comments

Self-inverse permutation of natural numbers obtained by mapping the exponent of each prime in the prime factorization of n through involution A193231.
Multiplicative with p^e -> p^A193231(e), p prime and e > 0.

Examples

			For n = 4 = 2^2, A193231(2) = 3, thus a(4) = 2^3 = 8.
For n = 9 = 3^2, A193231(2) = 3, thus a(9) = 3^3 = 27.
For n = 72 = 2^3 * 3^2, as A193231(2) = 3 and vice versa A193231(3) = 2, we have a(72) = 2^2 * 3^3 = 108. Note also how a(72) = a(8*9) = a(8) * a(9) = 4*27.
For n = 81 = 3^4, A193231(4) = 5, thus a(81) = 3^5 = 243.
		

Crossrefs

Formula

a(1) = 1, and for n > 1, a(n) = A020639(n)^A193231(A067029(n)) * a(A028234(n)).
a(1) = 1, and for n > 1, a(n) = A000079(A193231(A007814(n))) * A003961(a(A064989(n))).
a(A059897(n,k)) = A059897(a(n), a(k)). - Peter Munn, Nov 27 2019

A234027 Self-inverse permutation of nonnegative integers, A054429-conjugate of blue code: a(n) = A054429(A193231(A054429(n))).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 28 2013

Keywords

Crossrefs

Programs

  • Python
    def a065621(n): return n^(2*(n - (n&-n)))
    def a048724(n): return n^(2*n)
    def a054429(n): return 1 if n==1 else 2*a054429(int(n/2)) + 1 - n%2
    def a193231(n):
        if n<2: return n
        if n%2==0: return a048724(a193231(n/2))
        else: return a065621(1 + a193231((n - 1)/2))
    def a(n): return n if n<2 else a054429(a193231(a054429(n))) # Indranil Ghosh, Jun 05 2017
  • Scheme
    (define (A234027 n) (A054429 (A193231 (A054429 n))))
    

Formula

a(n) = A054429(A193231(A054429(n))).
a(n) = A234025(A054429(n)).
a(n) = A054429(A234026(n)).
a(n) = A059894(A234024(A059894(n))).

A293231 a(n) = Product_{d|n, dA019565(A193231(d)).

Original entry on oeis.org

1, 2, 2, 12, 2, 36, 2, 120, 6, 60, 2, 5400, 2, 360, 30, 25200, 2, 56700, 2, 21000, 180, 840, 2, 23814000, 10, 504, 630, 50400, 2, 661500, 2, 554400, 420, 132, 300, 392931000, 2, 792, 252, 242550000, 2, 24948000, 2, 2772000, 22050, 1980, 2, 605113740000, 60, 4851000, 66, 3880800, 2, 720373500, 700, 4889808000, 396, 2772, 2, 588305025000, 2, 1848
Offset: 1

Views

Author

Antti Karttunen, Oct 03 2017

Keywords

Crossrefs

Cf. A019565, A193231, A290090, A293214, A293232 (rgs-version of this sequence).
Cf. also A001317, A045544, A053576.

Programs

  • PARI
    A019565(n) = {my(j,v); factorback(Mat(vector(if(n, #n=vecextract(binary(n), "-1..1")), j, [prime(j), n[j]])~))}; \\ This function from M. F. Hasler
    A193231(n) = { my(x='x); subst(lift(Mod(1, 2)*subst(Pol(binary(n), x), x, 1+x)), x, 2) }; \\ This function from Franklin T. Adams-Watters
    A293231(n) = { my(m=1); fordiv(n,d,if(d < n,m *= A019565(A193231(d)))); m; };

Formula

a(n) = Product_{d|n, dA019565(A193231(d)).
For all n >= 1, A007814(a(n)) = A290090(n).
For n = 0..5, a(A001317((2^n)-1)) = A002110((2^n)-1).

A293232 Restricted growth sequence transform of A293231, where A293231(n) = Product_{d|n, dA019565(A193231(d)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Oct 03 2017

Keywords

Crossrefs

Cf. A290090.
Differs from related A293215 for the first time at n=55, where a(55) = 39, while A293215(55) = 28.

Programs

  • PARI
    rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };
    write_to_bfile(start_offset,vec,bfilename) = { for(n=1, length(vec), write(bfilename, (n+start_offset)-1, " ", vec[n])); }
    A019565(n) = {my(j,v); factorback(Mat(vector(if(n, #n=vecextract(binary(n), "-1..1")), j, [prime(j), n[j]])~))}; \\ This function from M. F. Hasler
    A193231(n) = { my(x='x); subst(lift(Mod(1, 2)*subst(Pol(binary(n), x), x, 1+x)), x, 2) }; \\ This function from Franklin T. Adams-Watters
    A293231(n) = { my(m=1); fordiv(n,d,if(d < n,m *= A019565(A193231(d)))); m; };
    write_to_bfile(1,rgs_transform(vector(65537,n,A293231(n))),"b293232.txt");

A303775 Permutation of nonnegative integers: Minimal subset/superset bitmask transform of Blue code, A193231.

Original entry on oeis.org

0, 1, 3, 2, 6, 4, 5, 7, 15, 14, 12, 8, 13, 9, 11, 10, 30, 16, 17, 19, 18, 23, 20, 21, 31, 22, 54, 50, 48, 32, 51, 49, 33, 55, 53, 52, 36, 60, 28, 24, 29, 25, 27, 26, 63, 61, 57, 56, 40, 62, 58, 34, 59, 35, 39, 38, 46, 44, 45, 37, 47, 41, 43, 42, 106, 64, 85, 84, 80, 86, 82, 66, 87, 81, 65, 83, 67, 91, 90, 88, 72, 89, 73, 95, 94, 92, 68, 93, 69
Offset: 0

Views

Author

Antti Karttunen, May 05 2018

Keywords

Comments

In "minimal subset/superset bitmask transform", applicable to any N -> N injection f, we start from a(0) = 0, after which for n > 0, if there are one or more k_i that are not already present in the sequence among terms a(0) .. a(n-1), and for which bitor(k_i,a(n-1)) = a(n-1), then a(n) = that k_i for which f(k_i) is minimized; otherwise, a(n) = that h_i for which f(h_i) is minimized among the infinite set of numbers h_i for which bitand(h_i,a(n-1)) = a(n-1) and that are not yet present in the sequence. In this case f(n) = A193231(n).
Shares with permutations like A003188, A006068, A163252, A300838, A302846, A303763, A303765, A303767, A303773 and A304083 the property that when moving from any a(n) to a(n+1) either a subset of 0-bits are toggled on (changed to 1's), or a subset of 1-bits are toggled off (changed to 0's), but no both kind of changes may occur at the same step. Note that A303767 is obtained when the same transform is applied to A001477, and A304083 when it is applied to A054429.

Examples

			After a(3) = 2, "10" in binary, there are no submasks that wouldn't have been used, so one selects from supermasks h_i = "110" (6), "111" (7), "1010" (10), "1011" (11), "1110" (14), "1111" (15), "10010" (18), "10011" (19), etc. that one for which A193231(h_i) is minimized, which happens to be at 6 (as A193231(6) = 6, but A193231(7) = 7, and for n >= 8, A193231(n) >= 8), thus a(4) = 6.
After a(4) = 6, "110" in binary, the submask "10" (2) is already present in sequence, while submask "100" (4) is only one which is not present, thus 4 is selected to be the value of a(5).
After a(8) = 15, "1111" in binary, none of the submasks "1000" (8), "1001" (9), "1010" (10), "1011" (11), "1100" (12), "1101" (13) or "1110" (14) are present, and as A193231 obtains its minimum value in the range [8 .. 14] at 14 (A193231(14) = 9), we have a(9) = 14.
		

Crossrefs

Cf. A303776 (inverse).
Cf. also A303767, A304083.

Programs

  • PARI
    up_to = (2^18)+2;
    A193231(n) = { my(x='x); subst(lift(Mod(1, 2)*subst(Pol(binary(n), x), x, 1+x)), x, 2) }; \\ From A193231
    v303775 = vector(up_to);
    m303776 = Map();
    find_minimal_submask_for_A193231(n,m_inverses) = { my(minval=0,minmask=0); for(m=1,n,if((bitor(m,n)==n) && !mapisdefined(m_inverses,m) && (!minval || (A193231(m) < minval)), minval = A193231(m); minmask = m)); (minmask); };
    find_minimal_supermask_for_A193231(n,m_inverses) = { my(minval=0,minmask=0); for(m=1,(1<<(1+#binary(n)))-1,if((bitand(m,n)==n) && !mapisdefined(m_inverses,m) && (!minval || (A193231(m) < minval)), minval = A193231(m); minmask = m)); (minmask); };
    w=1; for(n=1,up_to,s = Set([]); if((submask = find_minimal_submask_for_A193231(w,m303776)), w = submask, w = find_minimal_supermask_for_A193231(w,m303776)); v303775[n] = w; mapput(m303776,w,n));
    A303775(n) = if(!n,n,v303775[n]);
    A303776(n) = if(!n,n,mapget(m303776,n));

Formula

Derived sequences:
A019565(a(n)) = A303778(n).
A000120(a(n)) = A303780(n).

A234022 a(n) = A000120(A193231(n)); number of 1-bits in blue code for n.

Original entry on oeis.org

0, 1, 2, 1, 2, 1, 2, 3, 4, 3, 2, 3, 2, 3, 2, 1, 2, 1, 2, 3, 2, 3, 4, 3, 4, 5, 4, 3, 4, 3, 2, 3, 4, 3, 2, 3, 4, 5, 4, 3, 4, 5, 6, 5, 4, 3, 4, 5, 2, 3, 2, 1, 4, 3, 2, 3, 4, 3, 4, 5, 2, 3, 4, 3, 4, 3, 4, 5, 2, 3, 4, 3, 4, 5, 4, 3, 6, 5, 4, 5, 2, 3, 4, 3, 2, 1, 2
Offset: 0

Views

Author

Antti Karttunen, Dec 28 2013

Keywords

Crossrefs

A234023 gives the positions where abs(a(n)-a(n+1)) > 1.

Programs

  • Python
    def a065621(n): return n^(2*(n - (n&-n)))
    def a048724(n): return n^(2*n)
    l=[0, 1]
    z=[0, 1]
    for n in range(2, 101):
        if n%2==0: l.append(a048724(l[n//2]))
        else: l.append(a065621(1 + l[(n - 1)//2]))
        z.append(bin(l[-1])[2:].count("1"))
    print(z) # Indranil Ghosh, Jun 05 2017
  • Scheme
    (define (A234022 n) (A000120 (A193231 n)))
    

Formula

a(n) = A000120(A193231(n)).
A000035(a(n)) = A000035(n) = (n mod 2) for all n. [Even terms occur only on even indices and odd terms only on odd indices, respectively]

A234025 Permutation of nonnegative integers: a(n) = A054429(A193231(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 28 2013

Keywords

Crossrefs

Inverse permutation: A234026.

Programs

  • Python
    def a065621(n): return n^(2*(n - (n&-n)))
    def a048724(n): return n^(2*n)
    def a054429(n): return 1 if n==1 else 2*a054429(int(n/2)) + 1 - n%2
    def a193231(n):
        if n<2: return n
        if n%2==0: return a048724(a193231(n/2))
        else: return a065621(1 + a193231((n - 1)/2))
    def a(n): return n if n<2 else a054429(a193231(n)) # Indranil Ghosh, Jun 05 2017
  • Scheme
    (define (A234025 n) (A054429 (A193231 n)))
    

Formula

a(n) = A054429(A193231(n)).
a(n) = A234027(A054429(n)).

A234612 Self-inverse permutation of nonnegative integers, "blue-gray" code: a(n) = A003188(A193231(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 28 2013

Keywords

Crossrefs

Programs

  • Python
    def a065621(n): return n^(2*(n - (n&-n)))
    def a048724(n): return n^(2*n)
    def a003188(n): return n^(n>>1)
    def a193231(n):
        if n<2: return n
        if n%2==0: return a048724(a193231(n/2))
        else: return a065621(1 + a193231((n - 1)/2))
    def a(n): return n if n<2 else a003188(a193231(n)) # Indranil Ghosh, Jun 05 2017
  • Scheme
    (define (A234612 n) (A003188 (A193231 n)))
    (define (A234612v2 n) (A193231 (A006068 n))) ;; Alternative 2.
    

Formula

a(n) = A003188(A193231(n)).
a(n) = A193231(A006068(n)).
a(n) = A193231(A234613(A193231(n))).

A234747 Self-inverse and multiplicative permutation of natural numbers, A091202-conjugate of Blue code: a(n) = A091203(A193231(A091202(n))).

Original entry on oeis.org

0, 1, 3, 2, 9, 5, 6, 11, 27, 4, 15, 7, 18, 13, 33, 10, 81, 19, 12, 17, 45, 22, 21, 37, 54, 25, 39, 8, 99, 43, 30, 41, 243, 14, 57, 55, 36, 23, 51, 26, 135, 31, 66, 29, 63, 20, 111, 59, 162, 121, 75, 38, 117, 61, 24, 35, 297, 34, 129, 47, 90, 53, 123, 44, 729
Offset: 0

Views

Author

Antti Karttunen, Dec 31 2013

Keywords

Comments

a(n) has the same prime signature as n: the permutation maps primes to primes, squares to squares, cubes to cubes, and so on.

Examples

			Example of multiplicativity: a(7)=11, a(23)=37, a(7*23) = a(161) = a(7)*a(23) = 11*37 = 407.
		

Crossrefs

See A234748 for a variant.

Programs

Formula

a(n) = A091203(A193231(A091202(n))).
Completely multiplicative with p_i = p_{A234751(i)} (where p_i stands for the i-th prime, A000040(i)), and a(x*y) = a(x)*a(y) for x, y > 0.

A234748 Self-inverse and multiplicative permutation of natural numbers, A235041-conjugate of Blue code: a(n) = A235042(A193231(A235041(n))).

Original entry on oeis.org

0, 1, 3, 2, 9, 31, 6, 7, 27, 4, 93, 13, 18, 11, 21, 62, 81, 37, 12, 19, 279, 14, 39, 67, 54, 961, 33, 8, 63, 73, 186, 5, 243, 26, 111, 217, 36, 17, 57, 22, 837, 61, 42, 53, 117, 124, 201, 59, 162, 49, 2883, 74, 99, 43, 24, 403, 189, 38, 219, 47, 558, 41, 15, 28, 729, 341, 78, 23, 333
Offset: 0

Views

Author

Antti Karttunen, Dec 31 2013

Keywords

Comments

a(n) has the same prime signature as n: The permutation maps primes to primes, squares to squares, cubes to cubes, and so on.

Examples

			Example of multiplicativity:
a(5)=31, a(11)=13, a(5*11) = a(55) = a(5) * a(11) = 31*13 = 403.
		

Crossrefs

Cf. A234747 for a variant.

Programs

Formula

a(n) = A235042(A193231(A235041(n))).
Showing 1-10 of 85 results. Next