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.

A126760 a(0) = 0, a(2n) = a(n), a(3n) = a(n), a(6n+1) = 2n + 1, a(6n+5) = 2n + 2.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Feb 19 2007

Keywords

Comments

For further information see A126759, which provided the original motivation for this sequence.
From Antti Karttunen, Jan 28 2015: (Start)
The odd bisection of the sequence gives A253887, and the even bisection gives the sequence itself.
A254048 gives the sequence obtained when this sequence is restricted to A007494 (numbers congruent to 0 or 2 mod 3).
For all odd numbers k present in square array A135765, a(k) = the column index of k in that array. (End)
A322026 and this sequence (without the initial zero) are ordinal transforms of each other. - Antti Karttunen, Feb 09 2019
Also ordinal transform of A065331 (after the initial 0). - Antti Karttunen, Sep 08 2024

Crossrefs

One less than A126759.
Cf. A347233 (Möbius transform) and also A349390, A349393, A349395 for other Dirichlet convolutions.
Ordinal transform of A065331 and of A322026 (after the initial 0).
Related arrays: A135765, A254102.

Programs

  • Mathematica
    f[n_] := Block[{a}, a[0] = 0; a[1] = a[2] = a[3] = 1; a[x_] := Which[EvenQ@ x, a[x/2], Mod[x, 3] == 0, a[x/3], Mod[x, 6] == 1, 2 (x - 1)/6 + 1, Mod[x, 6] == 5, 2 (x - 5)/6 + 2]; Table[a@ i, {i, 0, n}]] (* Michael De Vlieger, Feb 03 2015 *)
  • PARI
    A126760(n)={n&&n\=3^valuation(n,3)<M. F. Hasler, Jan 19 2016

Formula

a(n) = A126759(n)-1. [The original definition.]
From Antti Karttunen, Jan 28 2015: (Start)
a(0) = 0, a(2n) = a(n), a(3n) = a(n), a(6n+1) = 2n + 1, a(6n+5) = 2n + 2.
Or with the last clause represented in another way:
a(0) = 0, a(2n) = a(n), a(3n) = a(n), a(6n+1) = 2n + 1, a(6n-1) = 2n.
Other identities. For all n >= 1:
a(n) = A253887(A003602(n)).
a(6n-3) = a(4n-2) = a(2n-1) = A253887(n).
(End)
a(n) = A249746(A003602(A064989(n))). - Antti Karttunen, Feb 04 2015
a(n) = A323882(4*n). - Antti Karttunen, Apr 18 2022

Extensions

Name replaced with an independent recurrence and the old description moved to the Formula section - Antti Karttunen, Jan 28 2015

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

A323881 Dirichlet inverse of A126760.

Original entry on oeis.org

1, -1, -1, 0, -2, 1, -3, 0, 0, 2, -4, 0, -5, 3, 2, 0, -6, 0, -7, 0, 3, 4, -8, 0, -5, 5, 0, 0, -10, -2, -11, 0, 4, 6, 0, 0, -13, 7, 5, 0, -14, -3, -15, 0, 0, 8, -16, 0, -8, 5, 6, 0, -18, 0, -3, 0, 7, 10, -20, 0, -21, 11, 0, 0, -2, -4, -23, 0, 8, 0, -24, 0, -25, 13, 5, 0, -2, -5, -27, 0, 0, 14, -28, 0, -5, 15, 10, 0, -30, 0, -1, 0
Offset: 1

Views

Author

Antti Karttunen, Feb 08 2019

Keywords

Crossrefs

Programs

  • Mathematica
    b[n_] := b[n] = Which[n == 0, 0, 0 < n < 4, 1, EvenQ[n], b[n/2], Mod[n, 3] == 0, b[n/3], Mod[n, 6] == 1, (n-1)/3 + 1, Mod[n, 6] == 5, (n-5)/3 + 2];
    a[n_] := a[n] = If[n == 1, 1, -Sum[b[n/d] a[d], {d, Most@ Divisors[n]}]];
    Array[a, 100] (* Jean-François Alcover, Feb 16 2020 *)
  • 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(dA126760(n) = {n&&n\=3^valuation(n, 3)<A126760
    v323881 = DirInverseCorrect(vector(up_to,n,A126760(n)));
    A323881(n) = v323881[n];

A323885 Sum of A001511 and its Dirichlet inverse.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Feb 08 2019

Keywords

Crossrefs

Programs

  • PARI
    A001511(n) = (1+valuation(n,2));
    A092673(n) = (moebius(n)-if(n%2,0,moebius(n/2)));
    A323885(n) = (A001511(n)+A092673(n));
    
  • Python
    from sympy import mobius
    def A323885(n): return (n&-n).bit_length()+mobius(n)-(0 if n&1 else mobius(n>>1)) # Chai Wah Wu, Jul 13 2022

Formula

a(n) = A001511(n) + A092673(n).

A323887 Sum of Per Nørgård's "infinity sequence" (A004718) and its Dirichlet inverse (A323886).

Original entry on oeis.org

2, 0, 0, 1, 0, -4, 0, -1, 4, 0, 0, 2, 0, -6, 0, 1, 0, 0, 0, 0, 12, -2, 0, -2, 0, 2, 0, 3, 0, -8, 0, -1, 4, 0, 0, 2, 0, -6, -4, 0, 0, 10, 0, 1, 16, -4, 0, 2, 9, -6, 0, -1, 0, 0, 0, -3, 12, 4, 0, 4, 0, -10, -20, 1, 0, 0, 0, 0, 8, -2, 0, -2, 0, 2, 12, 3, 6, -12, 0, 0, -4, -2, 0, 1, 0, -4, -8, -1, 0, 16, -6, 2, 20, -6, 0, -2, 0, 11, 0, 3, 0, -8, 0, 1, 28
Offset: 1

Views

Author

Antti Karttunen, Feb 08 2019

Keywords

Comments

The composer Per Nørgård's name is also written in the OEIS as Per Noergaard.

Crossrefs

Programs

  • PARI
    up_to = 65537;
    A004718list(up_to) = { my(v=vector(up_to)); v[1]=1; v[2]=-1; for(n=3, up_to, v[n] = if(n%2, 1+v[n>>1], -v[n/2])); (v); }; \\ After code in A004718.
    DirInverse(v) = { my(u=vector(#v)); u[1] = (1/v[1]); for(n=2, #v, u[n] = -sumdiv(n, d, if(dA004718list(up_to);
    A004718(n) = v004718[n];
    v323886 = DirInverse(v004718);
    A323886(n) = v323886[n];
    A323887(n) = (A004718(n)+A323886(n));

Formula

a(n) = A004718(n) + A323886(n).

A323884 Sum of A322026 and its Dirichlet inverse.

Original entry on oeis.org

2, 0, 0, 4, 0, 12, 0, 8, 9, 4, 0, 8, 0, 4, 6, 8, 0, 4, 0, 4, 6, 4, 0, 0, 1, 4, 15, 4, 0, -2, 0, 12, 6, 4, 2, 13, 0, 4, 6, 4, 0, -2, 0, 4, 5, 4, 0, 22, 1, 2, 6, 4, 0, 7, 2, 4, 6, 4, 0, 8, 0, 4, 5, 20, 2, -2, 0, 4, 6, 0, 0, 38, 0, 4, 3, 4, 2, -2, 0, 10, 13, 4, 0, 8, 2, 4, 6, 4, 0, 16, 2, 4, 6, 4, 2, 28, 0, 2, 5, 4, 0, -2, 0, 4, 0
Offset: 1

Views

Author

Antti Karttunen, Feb 08 2019

Keywords

Crossrefs

Programs

  • PARI
    up_to = 65537;
    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; };
    A007814(n) = valuation(n,2);
    A007949(n) = valuation(n,3);
    v322026 = rgs_transform(vector(up_to, n, [A007814(n), A007949(n)]));
    A322026(n) = v322026[n];
    DirInverse(v) = { my(u=vector(#v)); u[1] = (1/v[1]); for(n=2, #v, u[n] = -sumdiv(n, d, if(dA323883(n) = v323883[n];
    A323884(n) = (A322026(n)+A323883(n));

Formula

a(n) = A322026(n) + A323883(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).

A359165 Difference between A126760 and its Möbius transform.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 22 2022

Keywords

Crossrefs

Programs

Formula

a(n) = A126760(n) - A347233(n).
a(n) = Sum_{d|n, dA347233(d).
a(n) = -Sum_{d|n, dA008683(n/d)*A126760(d).
Showing 1-8 of 8 results.