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

A332817 a(n) = A108548(A163511(n)).

Original entry on oeis.org

1, 2, 4, 3, 8, 9, 6, 5, 16, 27, 18, 25, 12, 15, 10, 7, 32, 81, 54, 125, 36, 75, 50, 49, 24, 45, 30, 35, 20, 21, 14, 13, 64, 243, 162, 625, 108, 375, 250, 343, 72, 225, 150, 245, 100, 147, 98, 169, 48, 135, 90, 175, 60, 105, 70, 91, 40, 63, 42, 65, 28, 39, 26, 11, 128, 729, 486, 3125, 324, 1875, 1250, 2401, 216, 1125, 750, 1715, 500
Offset: 0

Views

Author

Antti Karttunen, Mar 05 2020

Keywords

Comments

This irregular table can be represented as a binary tree. Each child to the left is obtained by doubling the parent, and each child to the right is obtained by applying A332818 to the parent:
1
|
...................2...................
4 3
8......../ \........9 6......../ \........5
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
16 27 18 25 12 15 10 7
32 81 54 125 36 75 50 49 24 45 30 35 20 21 14 13
etc.
This is the mirror image of the tree in A332815.

Crossrefs

Cf. A332811 (inverse permutation).
Cf. A054429, A108548, A163511, A332815 (mirror image).
Cf. A108546 (the right edge of the tree from 2 downward).
Cf. also A332214.

Programs

  • PARI
    up_to = 26927;
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t }; \\ From A005940
    A054429(n) = ((3<<#binary(n\2))-n-1); \\ From A054429
    A163511(n) = if(!n,1,A005940(1+A054429(n)));
    A108546list(up_to) = { my(v=vector(up_to), p,q); v[1] = 2; v[2] = 3; v[3] = 5; for(n=4,up_to, p = v[n-2]; q = nextprime(1+p); while(q%4 != p%4, q=nextprime(1+q)); v[n] = q); (v); };
    v108546 = A108546list(up_to);
    A108546(n) = v108546[n]; \\ Antti Karttunen, Mar 05 2020
    A108548(n) = { my(f=factor(n)); f[,1] = apply(A108546,apply(primepi,f[,1])); factorback(f); };
    A332817(n) = A108548(A163511(n));

Formula

a(n) = A108548(A163511(n)).
For n >= 1, a(n) = A332815(A054429(n)).

A332815 a(n) = A108548(A005940(1+n)).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 9, 8, 7, 10, 15, 12, 25, 18, 27, 16, 13, 14, 21, 20, 35, 30, 45, 24, 49, 50, 75, 36, 125, 54, 81, 32, 11, 26, 39, 28, 65, 42, 63, 40, 91, 70, 105, 60, 175, 90, 135, 48, 169, 98, 147, 100, 245, 150, 225, 72, 343, 250, 375, 108, 625, 162, 243, 64, 17, 22, 33, 52, 55, 78, 117, 56, 77, 130, 195, 84
Offset: 0

Views

Author

Antti Karttunen, Feb 28 2020

Keywords

Comments

This is variant of Doudna-sequence, A005940 and thus can be represented as a binary tree. Each child to the left is obtained by applying A332818 to the parent, and each child to the right is obtained by doubling the parent:
1
|
...................2...................
3 4
5......../ \........6 9......../ \........8
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
7 10 15 12 25 18 27 16
13 14 21 20 35 30 45 24 49 50 75 36 125 54 81 32
etc.
Note the indexing: the sequence starts with a(0)=1, as is natural for sequences based on maps from base-2 expansion to prime factorization. This is
in contrast to A005940, which for historical reasons starts from offset 1.
For any n > 1, A332893(n) gives the value of the parent node. For any n >= 1, A332894(n) gives the distance to 1, and A332899(n) gives the number of odd numbers that occur (inclusively) on the path from 1 to n.

Crossrefs

Cf. A332816 (inverse permutation).
Cf. A108546 (the left edge of the tree from 2 downward).

Programs

  • PARI
    up_to = 26927;
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t }; \\ From A005940
    A108546list(up_to) = { my(v=vector(up_to), p,q); v[1] = 2; v[2] = 3; v[3] = 5; for(n=4,up_to, p = v[n-2]; q = nextprime(1+p); while(q%4 != p%4, q=nextprime(1+q)); v[n] = q); (v); };
    v108546 = A108546list(up_to);
    A108546(n) = v108546[n];
    A108548(n) = { my(f=factor(n)); f[,1] = apply(A108546,apply(primepi,f[,1])); factorback(f); };
    A332815(n) = A108548(A005940(1+n));

Formula

a(n) = A108548(A005940(1+n)).

A332818 a(n) = A108548(A003961(A332808(n))).

Original entry on oeis.org

1, 3, 5, 9, 7, 15, 13, 27, 25, 21, 17, 45, 11, 39, 35, 81, 19, 75, 29, 63, 65, 51, 37, 135, 49, 33, 125, 117, 23, 105, 41, 243, 85, 57, 91, 225, 31, 87, 55, 189, 43, 195, 53, 153, 175, 111, 61, 405, 169, 147, 95, 99, 47, 375, 119, 351, 145, 69, 73, 315, 59, 123, 325, 729, 77, 255, 89, 171, 185, 273, 97, 675, 67, 93, 245, 261, 221, 165, 101
Offset: 1

Views

Author

Antti Karttunen, Feb 27 2020

Keywords

Comments

Permutation of odd numbers. Preserves prime signature.

Crossrefs

Cf. A332819 (a left inverse).

Programs

Formula

Fully multiplicative with a(2) = 3, a(A002145(n)) = A002144(n) and a(A002144(n)) = A002145(1+n), for all n >= 1.
a(n) = A108548(A003961(A332808(n))).
A332819(a(n)) = n.
A046523(a(n)) = A046523(n).

A332819 a(n) = A108548(A064989(A332808(n))).

Original entry on oeis.org

1, 1, 2, 1, 3, 2, 5, 1, 4, 3, 13, 2, 7, 5, 6, 1, 11, 4, 17, 3, 10, 13, 29, 2, 9, 7, 8, 5, 19, 6, 37, 1, 26, 11, 15, 4, 23, 17, 14, 3, 31, 10, 41, 13, 12, 29, 53, 2, 25, 9, 22, 7, 43, 8, 39, 5, 34, 19, 61, 6, 47, 37, 20, 1, 21, 26, 73, 11, 58, 15, 89, 4, 59, 23, 18, 17, 65, 14, 97, 3, 16, 31, 101, 10, 33, 41, 38, 13, 67, 12, 35, 29
Offset: 1

Views

Author

Antti Karttunen, Feb 27 2020

Keywords

Crossrefs

A left inverse of A332818.

Programs

Formula

Fully multiplicative with a(2) = 1, a(3) = 2, a(A002144(n)) = A002145(n), and a(A002145(1+n)) = A002144(n) for all n >= 1.
a(n) = A108548(A064989(A332808(n))).
a(A332818(n)) = n.

A108549 Fixed points for A108548.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 19, 20, 21, 24, 25, 27, 28, 30, 32, 34, 35, 36, 38, 40, 41, 42, 43, 45, 48, 49, 50, 51, 54, 56, 57, 60, 63, 64, 68, 70, 72, 75, 76, 80, 81, 82, 84, 85, 86, 90, 95, 96, 98, 100, 102, 105, 108, 112, 114, 119, 120, 123, 125
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 10 2005

Keywords

Comments

A108548(a(n)) = a(n); multiplicative closure of A108547.

Crossrefs

Cf. A108546.

A331137 a(n) = Sum_{primes p <= n} b(p-1), where b = A108548.

Original entry on oeis.org

0, 1, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12
Offset: 1

Views

Author

N. J. A. Sloane, Jan 11 2020

Keywords

Crossrefs

Cf. A108548.

A267099 Fully multiplicative involution swapping the positions of 4k+1 and 4k+3 primes: a(1) = 1; a(prime(k)) = A267101(k), a(x*y) = a(x)*a(y) for x, y > 1.

Original entry on oeis.org

1, 2, 5, 4, 3, 10, 13, 8, 25, 6, 17, 20, 7, 26, 15, 16, 11, 50, 29, 12, 65, 34, 37, 40, 9, 14, 125, 52, 19, 30, 41, 32, 85, 22, 39, 100, 23, 58, 35, 24, 31, 130, 53, 68, 75, 74, 61, 80, 169, 18, 55, 28, 43, 250, 51, 104, 145, 38, 73, 60, 47, 82, 325, 64, 21, 170, 89, 44, 185, 78, 97, 200, 59, 46, 45, 116, 221, 70, 101
Offset: 1

Views

Author

Antti Karttunen, Feb 01 2016

Keywords

Comments

Lexicographically earliest self-inverse permutation of natural numbers where each prime of the form 4k+1 is replaced by a prime of the form 4k+3 and vice versa, with the composite numbers determined by multiplicativity.
Fully multiplicative with a(p_n) = p_{A267100(n)} = A267101(n).
Maps each term of A004613 to some term of A004614, each (nonzero) term of A001481 to some term of A268377 and each term of A004431 to some term of A268378 and vice versa.
Sequences A072202 and A078613 are closed with respect to this permutation.

Crossrefs

Cf. A000035, A000040, A000720, A010051, A020639, A032742, A267100, A267101, A354102 (Möbius transform), A354103 (inverse Möbius transform), A354192 (fixed points).
Cf. also A108548.

Programs

  • PARI
    up_to = 2^16;
    A267097list(up_to) = { my(v=vector(up_to),i=0,c=0); forprime(p=2,prime(up_to), if(1==(p%4), c++); i++; v[i] = c); (v); };
    v267097 = A267097list(up_to);
    A267097(n) = v267097[n];
    A267098(n) = ((n-1)-A267097(n));
    list_primes_of_the_form(up_to,m,k) = { my(v=vector(up_to),i=0); forprime(p=2,, if(k==(p%m), i++; v[i] = p; if(i==up_to,return(v)))); };
    v002144 = list_primes_of_the_form(2*up_to,4,1);
    A002144(n) = v002144[n];
    v002145 = list_primes_of_the_form(2*up_to,4,3);
    A002145(n) = v002145[n];
    A267101(n) = if(1==n,2,if(1==(prime(n)%4),A002145(A267097(n)),A002144(A267098(n))));
    A267099(n) = { my(f=factor(n)); for(k=1,#f~,f[k,1] = A267101(primepi(f[k,1]))); factorback(f); }; \\ Antti Karttunen, May 18 2022
    (Scheme, with memoization-macro definec)
    (definec (A267099 n) (cond ((<= n 1) n) ((= 1 (A010051 n)) (A267101 (A000720 n))) (else (* (A267099 (A020639 n)) (A267099 (A032742 n))))))

Formula

a(1) = 1; after which, if n is k-th prime [= A000040(k)], then a(n) = A267101(k), otherwise a(A020639(n)) * a(A032742(n)).
Other identities. For all n >= 1:
a(A000040(n)) = A267101(n).
a(2*n) = 2*a(n).
a(3*n) = 5*a(n).
a(5*n) = 3*a(n).
a(7*n) = 13*a(n).
a(11*n) = 17*a(n).
etc. See examples in A267101.
A000035(n) = A000035(a(n)). [Preserves the parity of n.]
A005094(a(n)) = -A005094(n).
A079635(a(n)) = -A079635(n).

Extensions

Verbal description prefixed to the name by Antti Karttunen, May 19 2022

A108546 Lexicographically earliest permutation of primes such that for n>1 forms 4*k+1 and 4*k+3 alternate.

Original entry on oeis.org

2, 3, 5, 7, 13, 11, 17, 19, 29, 23, 37, 31, 41, 43, 53, 47, 61, 59, 73, 67, 89, 71, 97, 79, 101, 83, 109, 103, 113, 107, 137, 127, 149, 131, 157, 139, 173, 151, 181, 163, 193, 167, 197, 179, 229, 191, 233, 199, 241, 211, 257, 223, 269, 227, 277, 239, 281, 251, 293
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 10 2005

Keywords

Crossrefs

Cf. A000040, A002144, A002145, A102261, A108547 (fixed points), A108548, A111745, A332806 (inverse), A332807.
Cf. also A267101, A332211.

Programs

  • Haskell
    import Data.List (transpose)
    a108546 n = a108546_list !! (n-1)
    a108546_list =  2 : concat
       (transpose [a002145_list, a002144_list])
    -- Reinhard Zumkeller, Nov 13 2014, Feb 22 2011
    
  • Mathematica
    terms = 60; A111745 = Module[{prs = Prime[Range[2terms]], m3, m1, min}, m3 = Select[prs, Mod[#, 4] == 3&]; m1 = Select[prs, Mod[#, 4] == 1&]; min = Min[Length[m1], Length[m3]]; Riffle[Take[m3, min], Take[m1, min]]]; a[1] = 2; a[n_] := A111745[[n-1]]; Table[a[n], {n, 1, terms}] (* Jean-François Alcover, May 18 2017, using Harvey P. Dale's code for A111745 *)
  • PARI
    up_to = 10000;
    A108546list(up_to) = { my(v=vector(up_to), p,q); v[1] = 2; v[2] = 3; v[3] = 5; for(n=4,up_to, p = v[n-2]; q = nextprime(1+p); while(q%4 != p%4, q=nextprime(1+q)); v[n] = q); (v); };
    v108546 = A108546list(up_to);
    A108546(n) = v108546[n]; \\ Antti Karttunen, Feb 27 2020

Formula

a(n) mod 4 = 3 - 2 * (n mod 2) for n>1.
For n > 1: a(n) = A111745(n-1).
a(2*n+1) - a(2*n) = A102261(n).
From Antti Karttunen, Feb 27 2020: (Start)
a(1) = 2, a(2n) = A002145(n), a(2n+1) = A002144(n).
a(n) = A000040(A332807(n)).
(End)

A332808 Fully multiplicative with a(p) = A332806(A000720(p)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Feb 27 2020

Keywords

Crossrefs

Cf. A000720, A332806, A108549 (fixed points), A332818, A332819.
Inverse permutation is A108548, from which this differs for the first time at n=67, where a(67) = 71, while A108548(67) = 73.

Programs

  • PARI
    up_to = 10000;
    A332806list(up_to) = { my(v=vector(2), xs=Map(), lista=List([]), p,q,u); v[2] = 3; v[1] = 5; mapput(xs,1,1); mapput(xs,2,2); mapput(xs,3,3);  for(n=4,up_to, p = v[2-(n%2)]; q = nextprime(1+p); while(q%4 != p%4, q=nextprime(1+q)); v[2-(n%2)] = q; mapput(xs,primepi(q),n)); for(i=1, oo, if(!mapisdefined(xs, i, &u), return(Vec(lista)), listput(lista, prime(u)))); };
    v332806 = A332806list(up_to);
    A332806(n) = v332806[n];
    A332808(n) = { my(f=factor(n)); f[,1] = apply(A332806,apply(primepi,f[,1])); factorback(f); };

A354202 Fully multiplicative with a(p^e) = A354200(A000720(p))^e.

Original entry on oeis.org

1, 5, 7, 25, 13, 35, 11, 125, 49, 65, 19, 175, 17, 55, 91, 625, 29, 245, 23, 325, 77, 95, 31, 875, 169, 85, 343, 275, 37, 455, 43, 3125, 133, 145, 143, 1225, 41, 115, 119, 1625, 53, 385, 47, 475, 637, 155, 59, 4375, 121, 845, 203, 425, 61, 1715, 247, 1375, 161, 185, 67, 2275, 73, 215, 539, 15625, 221, 665, 71, 725
Offset: 1

Views

Author

Antti Karttunen, May 23 2022

Keywords

Comments

Permutation of A007310. Preserves the prime signature.

Crossrefs

Cf. A007310 (terms sorted into ascending order), A354200, A354203 (left inverse), A354204 (Möbius transform), A354205 (inverse Möbius transform).
Cf. also A003961, A108548, A267099, A332818, A348746, A354091 for similar constructions.

Programs

  • PARI
    A354200(n) = if(1==n,5,my(p=prime(n), m=p%4); forprime(q=1+p,,if(m==(q%4),return(q))));
    A354202(n) = { my(f=factor(n)); for(k=1,#f~,f[k,1] = A354200(primepi(f[k,1]))); factorback(f); };
Showing 1-10 of 13 results. Next