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.

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

A323893 Dirichlet inverse of A048673, where A048673(n) = (A003961(n)+1) / 2, and A003961 is fully multiplicative with a(prime(i)) = prime(i+1).

Original entry on oeis.org

1, -2, -3, -1, -4, 4, -6, -2, -4, 5, -7, 3, -9, 7, 6, -4, -10, 8, -12, 4, 8, 8, -15, 8, -9, 10, -12, 6, -16, 5, -19, -8, 9, 11, 9, 8, -21, 13, 11, 11, -22, 11, -24, 7, 16, 16, -27, 20, -25, 18, 12, 9, -30, 32, 10, 17, 14, 17, -31, 6, -34, 20, 24, -16, 12, 14, -36, 10, 17, 20, -37, 16, -40, 22, 27, 12, 12, 20, -42, 28, -36, 23, -45, 12, 13
Offset: 1

Views

Author

Antti Karttunen, Feb 08 2019

Keywords

Crossrefs

Cf. A003961, A048673, A323894, A349134, A378520 (Möbius transform).

Programs

  • PARI
    up_to = 20000;
    DirInverse(v) = { my(u=vector(#v)); u[1] = (1/v[1]); for(n=2, #v, u[n] = (-u[1]*sumdiv(n, d, if(dA003961(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;
    v323893 = DirInverse(vector(up_to,n,A048673(n)));
    A323893(n) = v323893[n];
    
  • PARI
    memoA323893 = Map();
    A323893(n) = if(1==n,1,my(v); if(mapisdefined(memoA323893,n,&v), v, v = -sumdiv(n,d,if(dA048673(n/d)*A323893(d),0)); mapput(memoA323893,n,v); (v))); \\ Antti Karttunen, Nov 30 2024

Formula

a(1) = 1, and for n > 1, a(n) = -Sum_{d|n, dA048673(n/d) * a(d).
a(n) = A349134(A003961(n)). - Antti Karttunen, Nov 30 2024

A323365 Sum of Stern's Diatomic sequence, A002487 and its Dirichlet inverse, A317843.

Original entry on oeis.org

2, 0, 0, 1, 0, 4, 0, 1, 4, 6, 0, 2, 0, 6, 12, 1, 0, 4, 0, 3, 12, 10, 0, 2, 9, 10, 8, 3, 0, -4, 0, 1, 20, 10, 18, 4, 0, 14, 20, 3, 0, 4, 0, 5, 4, 14, 0, 2, 9, 5, 20, 5, 0, 8, 30, 3, 28, 14, 0, 4, 0, 10, 20, 1, 30, -8, 0, 5, 28, 0, 0, 4, 0, 22, -2, 7, 30, 0, 0, 3, 16, 22, 0, 8, 30, 26, 28, 5, 0, 20, 30, 7, 20, 18, 42, 2, 0, 9, 4, 7, 0, 4, 0, 5, 0
Offset: 1

Views

Author

Antti Karttunen, Jan 13 2019

Keywords

Crossrefs

Cf. A002487 (also a quadrisection of this sequence), A317843.

Programs

Formula

a(n) = A002487(n) + A317843(n).
From Antti Karttunen, Dec 08 2021: (Start)
a(1) = 2, and for n > 1, a(n) = -Sum_{d|n, 1A002487(d) * A317843(n/d).
a(4*n) = A002487(n).
(End)

A349135 Sum of Kimberling's paraphrases (A003602) and its Dirichlet inverse.

Original entry on oeis.org

2, 0, 0, 1, 0, 4, 0, 1, 4, 6, 0, 2, 0, 8, 12, 1, 0, 6, 0, 3, 16, 12, 0, 2, 9, 14, 12, 4, 0, 4, 0, 1, 24, 18, 24, 5, 0, 20, 28, 3, 0, 6, 0, 6, 26, 24, 0, 2, 16, 17, 36, 7, 0, 16, 36, 4, 40, 30, 0, 8, 0, 32, 36, 1, 42, 10, 0, 9, 48, 12, 0, 5, 0, 38, 46, 10, 48, 12, 0, 3, 37, 42, 0, 11, 54, 44, 60, 6, 0, 20, 56, 12
Offset: 1

Views

Author

Antti Karttunen, Nov 13 2021

Keywords

Comments

Question: Are all terms nonnegative?
The answer to the above question is no, because A323894 (which is a prime-shifted version of this sequence) also contains negative values. For example, for n=72747675, 88062975, 130945815, 111035925 we get here a(n) = -14126242, -17546656, -14460312, -22677277. The indices are obtained by prime-shifting with A003961 the four indices mentioned in the Apr 20 2022 comment of A323894. - Antti Karttunen, Nov 30 2024

Crossrefs

Cf. A003602 (also quadrisection of this sequence), A349134, A323894 [= a(A003961(n))].
Cf. also A323882, A349126.

Programs

  • Mathematica
    k[n_] := (n/2^IntegerExponent[n, 2] + 1)/2; d[1] = 1; d[n_] := d[n] = -DivisorSum[n, d[#]*k[n/#] &, # < n &]; a[n_] := k[n] + d[n]; Array[a, 100] (* Amiram Eldar, Nov 13 2021 *)
  • PARI
    up_to = 16384;
    DirInverseCorrect(v) = { my(u=vector(#v)); u[1] = (1/v[1]); for(n=2, #v, u[n] = (-u[1]*sumdiv(n, d, if(dA003602(n) = (1+(n>>valuation(n,2)))/2;
    v349134 = DirInverseCorrect(vector(up_to,n,A003602(n)));
    A349134(n) = v349134[n];
    A349135(n) = (A003602(n)+A349134(n));
    
  • PARI
    A349135(n) = if(1==n,2,-sumdiv(n, d, if(1==d||n==d,0,A003602(d)*A349134(n/d)))); \\ (Demonstrates the "cut convolution" formula) - Antti Karttunen, Nov 13 2021
    
  • PARI
    A003602(n) = (1+(n>>valuation(n,2)))/2;
    memoA349134 = Map();
    A349134(n) = if(1==n,1,my(v); if(mapisdefined(memoA349134,n,&v), v, v = -sumdiv(n,d,if(dA003602(n/d)*A349134(d),0)); mapput(memoA349134,n,v); (v)));
    A349135(n) = (A003602(n)+A349134(n)); \\ Antti Karttunen, Nov 30 2024

Formula

a(n) = A003602(n) + A349134(n).
a(1) = 2, and for n > 1, a(n) = -Sum_{d|n, 1A003602(d) * A349134(n/d).
For all n >= 1, a(4*n) = A003602(n). - Antti Karttunen, Dec 07 2021

A323896 Sum of binary Gray code A003188 and its Dirichlet inverse, A323895.

Original entry on oeis.org

2, 0, 0, 9, 0, 12, 0, 9, 4, 42, 0, 0, 0, 24, 28, 27, 0, 62, 0, -15, 16, 84, 0, 33, 49, 66, 44, -6, 0, -74, 0, 45, 56, 150, 56, -4, 0, 156, 44, 123, 0, 118, 0, -36, 130, 168, 0, 24, 16, -105, 100, -27, 0, -62, 196, 69, 104, 114, 0, 230, 0, 96, 180, 99, 154, 46, 0, -69, 112, 42, 0, 186, 0, 330, -98, -72, 112, 118, 0, 39, 117, 366, 0, 47
Offset: 1

Views

Author

Antti Karttunen, Feb 08 2019

Keywords

Crossrefs

Programs

  • PARI
    up_to = 65537;
    DirInverse(v) = { my(u=vector(#v)); u[1] = (1/v[1]); for(n=2, #v, u[n] = -sumdiv(n, d, if(dA003188(n) = bitxor(n, n>>1);
    v323895 = DirInverse(vector(up_to,n,A003188(n)));
    A323895(n) = v323895[n];
    A323896(n) = (A003188(n)+A323895(n));

Formula

a(n) = A003188(n) + A323895(n).

A353336 Sum of A353420 and its Dirichlet inverse.

Original entry on oeis.org

2, 0, 0, 1, 0, 4, 0, 1, 4, 6, 0, 2, 0, 8, 12, 1, 0, 14, 0, 3, 16, 10, 0, 2, 9, 12, 28, 4, 0, 12, 0, 1, 20, 14, 24, 9, 0, 16, 24, 3, 0, 22, 0, 5, 66, 20, 0, 2, 16, 25, 28, 6, 0, 56, 30, 4, 32, 22, 0, 12, 0, 26, 100, 1, 36, 24, 0, 7, 40, 28, 0, 9, 0, 28, 86, 8, 40, 34, 0, 3, 157, 30, 0, 19, 42, 32, 44, 5, 0, 52, 48
Offset: 1

Views

Author

Antti Karttunen, Apr 20 2022

Keywords

Comments

The first negative term is a(255255) = -11936.

Crossrefs

Cf. A003961, A126760, A353420 (also a quadrisection of this sequence), A353335.
Cf. also A323882, A323894, A349135.

Programs

  • PARI
    up_to = 65537;
    DirInverseCorrect(v) = { my(u=vector(#v)); u[1] = (1/v[1]); for(n=2, #v, u[n] = (-u[1]*sumdiv(n, d, if(dA003961(n) = { my(f = factor(n)); for(i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); };
    A126760(n) = {n&&n\=3^valuation(n, 3)<A126760
    A353420(n) = A126760(A003961(n));
    v353335 = DirInverseCorrect(vector(up_to,n,A353420(n)));
    A353335(n) = v353335[n];
    A353336(n) = (A353420(n)+A353335(n));

Formula

a(n) = A353420(n) + A353335(n).
For n > 1, a(n) = -Sum_{d|n, 1A353420(d) * A353335(n/d).

A349349 Sum of A252463 and its Dirichlet inverse, where A252463 shifts the prime factorization of odd numbers one step towards smaller primes and divides even numbers by two.

Original entry on oeis.org

2, 0, 0, 1, 0, 4, 0, 3, 4, 6, 0, 8, 0, 10, 12, 7, 0, 8, 0, 13, 20, 14, 0, 15, 9, 22, 8, 19, 0, 14, 0, 15, 28, 26, 30, 19, 0, 34, 44, 25, 0, 18, 0, 29, 12, 38, 0, 28, 25, 21, 52, 37, 0, 24, 42, 35, 68, 46, 0, 28, 0, 58, 20, 31, 66, 30, 0, 47, 76, 32, 0, 38, 0, 62, 18, 55, 70, 30, 0, 47, 16, 74, 0, 36, 78, 82, 92, 55
Offset: 1

Views

Author

Antti Karttunen, Nov 15 2021

Keywords

Comments

Question: Are there any negative terms? All terms in range 1 .. 2^23 are nonnegative. (See also A349126). - Antti Karttunen, Apr 20 2022

Crossrefs

Coincides with A349126 on odd numbers.

Programs

  • PARI
    up_to = 20000;
    DirInverseCorrect(v) = { my(u=vector(#v)); u[1] = (1/v[1]); for(n=2, #v, u[n] = (-u[1]*sumdiv(n, d, if(dA064989(n) = {my(f); f = factor(n); if((n>1 && f[1,1]==2), f[1,2] = 0); for (i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f)};
    A252463(n) = if(!(n%2),n/2,A064989(n));
    v349348 = DirInverseCorrect(vector(up_to,n,A252463(n)));
    A349348(n) = v349348[n];
    A349349(n) = (A252463(n)+A349348(n));

Formula

a(n) = A252463(n) + A349348(n).
a(1) = 2, and for n > 1, a(n) = -Sum_{d|n, 1A252463(d) * A349348(n/d).
For all n >= 1, a(2n-1) = A349126(2n-1).

A349359 Sum of A064216 and its Dirichlet inverse, where A064216 = A064989(2n-1), and A064989 is fully multiplicative with a(2) = 1 and a(p) = prevprime(p) for odd primes p.

Original entry on oeis.org

2, 0, 0, 4, 0, 12, 0, 12, 9, 16, 0, 22, 0, 44, 24, 5, 0, 40, 0, 60, 66, 40, 0, 14, 16, 36, 51, 10, 0, 106, 0, 82, 60, 56, 88, 26, 0, 124, 54, -10, 0, -46, 0, 144, 134, 48, 0, 235, 121, 140, 84, 86, 0, 19, 80, -108, 186, 136, 0, -44, 0, 236, 211, 29, 72, 158, 0, 216, 72, 62, 0, 152, 0, 284, 190, 10, 220, 98, 0, 260, 181
Offset: 1

Views

Author

Antti Karttunen, Nov 17 2021

Keywords

Comments

Compare to A323894 which in contrast to this sequence seems to have only nonnegative terms.

Crossrefs

Programs

Formula

a(n) = A064216(n) + A349358(n).
a(1) = 2, and for n >1, a(n) = -Sum_{d|n, 1A064216(d) * A349358(n/d).
Showing 1-8 of 8 results.