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

A332893 a(1) = 1, a(2n) = n, a(2n+1) = A332819(2n+1).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Mar 01 2020

Keywords

Comments

For any node n >= 2 in binary trees like A332815, a(n) gives the parent node of n.

Crossrefs

Cf. also A252463.

Programs

Formula

a(1) = 1, after which a(n) = n/2 for even n, and a(n) = A332819(n) for odd n.

A332894 a(1) = 0, a(2n) = 1 + a(n), a(2n+1) = 1 + a(A332819(2n+1)); also binary width of terms of A332816.

Original entry on oeis.org

0, 1, 2, 2, 3, 3, 4, 3, 3, 4, 6, 4, 5, 5, 4, 4, 7, 4, 8, 5, 5, 7, 10, 5, 4, 6, 4, 6, 9, 5, 12, 5, 7, 8, 5, 5, 11, 9, 6, 6, 13, 6, 14, 8, 5, 11, 16, 6, 5, 5, 8, 7, 15, 5, 7, 7, 9, 10, 18, 6, 17, 13, 6, 6, 6, 8, 20, 9, 11, 6, 22, 6, 19, 12, 5, 10, 7, 7, 24, 7, 5, 14, 26, 7, 8, 15, 10, 9, 21, 6, 6, 12, 13, 17, 9, 7, 23, 6, 8, 6, 25, 9, 28, 8, 6
Offset: 1

Views

Author

Antti Karttunen, Mar 04 2020

Keywords

Comments

a(n) tells how many iterations of A332893 are needed before 1 is reached, i.e., the distance of n from 1 in binary trees like A332815.
Each n > 0 occurs 2^(n-1) times in total.

Crossrefs

Programs

Formula

a(n) = A252464(A332808(n)).
a(1) = 0, and for n > 1, a(n) = 1 + a(A332893(n)).
For n >= 1, a(A108546(n)) = n; for all n >= 0, a(2^n) = n.
For n > 1: (Start)
a(n) = 1 + a(n/2) if n is even, and a(n) = 1 + a(A332819(n)), if n is odd.
a(n) = A070939(A332816(n)).
a(n) >= A332899(n).
(End)

A108548 Fully multiplicative with a(prime(j)) = A108546(j), where A108546 is the lexicographically earliest permutation of primes such that after 2 the forms 4*k+1 and 4*k+3 alternate, and prime(j) is the j-th prime in A000040.

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, 73, 68, 87, 70, 67, 72
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 10 2005

Keywords

Comments

Multiplicative with a(2^e) = 2^e, else if p is the m-th prime then a(p^e) = q^e where q is the m/2-th prime of the form 4*k + 3 (A002145) for even m and a(p^e) = r^e where r is the (m-1)/2-th prime of the form 4*k + 1 (A002144) for odd m. - David A. Corneth, Apr 25 2022
Permutation of the natural numbers with fixed points A108549: a(A108549(n)) = A108549(n).

Crossrefs

Cf. A002144, A002145, A049084, A108546, A108549 (fixed points), A332808 (inverse permutation).
Cf. also A332815, A332817 (this permutation applied to Doudna tree and its mirror image), also A332818, A332819.
Cf. also A267099, A332212 and A348746 for other similar mappings.

Programs

  • Mathematica
    terms = 72;
    A111745 = Module[{prs = Prime[Range[2 terms]], 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]]];
    A108546[n_] := If[n == 1, 2, A111745[[n - 1]]];
    A049084[n_] := PrimePi[n]*Boole[PrimeQ[n]];
    a[n_] := If[n == 1, 1, Module[{p, e}, Product[{p, e} = pe; A108546[A049084[p]]^e, {pe, FactorInteger[n]}]]];
    Array[a, terms] (* Jean-François Alcover, Nov 19 2021, using Harvey P. Dale's code for A111745 *)
  • PARI
    up_to = 26927; \\ One of the prime fixed points.
    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); }; \\ Antti Karttunen, Apr 25 2022

Extensions

Name edited by Antti Karttunen, Apr 25 2022

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); };

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).

A332897 a(1) = 0, a(2) = 1, and for n > 2, a(n) = a(A332893(n)) + [n == 1 (mod 4)].

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Mar 04 2020

Keywords

Comments

Starting from x=n, iterate the map x -> A332893(x) which divides even numbers by 2, and for odd n changes every 4k+1 prime in their prime factorization to 4k+3 prime and vice versa (except 3 -> 2), like in A332819. a(n) counts the numbers of the form 4k+1 encountered until 1 has been reached, which is also included in the count when n > 1. This count includes also n itself when it is of the form 4k+1 (A016813) and larger than 1.

Crossrefs

Programs

Formula

a(1) = 0, a(2) = 1, and for n > 2, a(n) = a(A332893(n)) + [n == 1 (mod 4)].
a(n) = A000120(A332895(n)).

A332898 a(1) = 0, and for n > 1, a(n) = a(A332893(n)) + [n == 3 (mod 4)].

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Mar 04 2020

Keywords

Comments

Starting from x=n, iterate the map x -> A332893(x) which divides even numbers by 2, and for odd n, changes every 4k+1 prime in the prime factorization to 4k+3 prime and vice versa (except 3 --> 2), like in A332819. a(n) counts the numbers of the form 4k+3 encountered until 1 has been reached. The count includes also n itself if it is of the form 4k+3 (A004767).
In other words, locate the node which contains n in binary tree A332815 and traverse from that node towards the root, counting all numbers of the form 4k+3 that occur on the path.

Crossrefs

Cf. A028982 (positions of zeros).
Cf. also A292377.

Programs

Formula

a(1) = 0, and for n > 1, a(n) = a(A332893(n)) + [n == 3 (mod 4)].
a(n) = A000120(A332896(n)).

A348747 Fully multiplicative with a(2) = 1, a(3) = 2, a(5) = 3, a(A002144(1+n)) = A002144(n) and a(A002145(1+n)) = a(A002145(1+n)) for all n >= 1, where A002144 and A002145 give the primes of the form 4k+1 and 4k+3 respectively.

Original entry on oeis.org

1, 1, 2, 1, 3, 2, 7, 1, 4, 3, 11, 2, 5, 7, 6, 1, 13, 4, 19, 3, 14, 11, 23, 2, 9, 5, 8, 7, 17, 6, 31, 1, 22, 13, 21, 4, 29, 19, 10, 3, 37, 14, 43, 11, 12, 23, 47, 2, 49, 9, 26, 5, 41, 8, 33, 7, 38, 17, 59, 6, 53, 31, 28, 1, 15, 22, 67, 13, 46, 21, 71, 4, 61, 29, 18, 19, 77, 10, 79, 3, 16, 37, 83, 14, 39, 43, 34, 11, 73
Offset: 1

Views

Author

Antti Karttunen, Nov 02 2021

Keywords

Crossrefs

Left inverse of A348746.
Cf. also A064989, A332819 for similar maps.

Programs

  • PARI
    A348747(n) = { my(f=factor(n)); for(k=1,#f~, if(f[k,1]<=3, f[k,1]--, if(5==f[k,1], f[k,1]=3, if(1==(f[k,1]%4), forstep(i=primepi(f[k,1])-1,0,-1,if(1==(prime(i)%4), f[k,1]=prime(i); break)))))); factorback(f); };

Formula

Fully multiplicative with a(p) = A348745(A000720(p)).
a(A348746(n)) = n.
a(2n) = a(A000265(n)) = a(n).
Showing 1-8 of 8 results.