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

A300824 Difference between A300222(n) and its Möbius transform.

Original entry on oeis.org

0, 0, 0, 2, 0, 2, 0, 0, 0, 4, 0, 4, 0, 8, 2, 8, 0, 6, 0, -2, 6, 4, 0, 8, 2, 2, 0, 0, 0, 8, 0, 6, 2, 10, 8, 12, 0, 20, 0, 28, 0, 18, 0, 16, 6, 22, 0, 22, 6, 22, 8, 24, 0, 18, 4, 8, 18, 4, 0, 16, 0, 2, 18, 2, 2, 26, 0, 4, 20, 0, 0, 24, 0, 2, 28, 0, 8, 30, 0, -2, 0, 4, 0, 0, 10, 8, 2, 16, 0, 24, 6, 16, 0, 22, 20, 14, 0, 14, 6, 40, 0, 26, 0, 32, 24
Offset: 1

Views

Author

Antti Karttunen, Mar 14 2018

Keywords

Crossrefs

Programs

  • Mathematica
    f[n_] := FromDigits[IntegerDigits[n, 3] /. 1 -> 0, 3]; Table[f@ n - DivisorSum[n, MoebiusMu[n/#] f@ # &], {n, 105}] (* Michael De Vlieger, Mar 17 2018 *)
  • PARI
    A300222(n) = fromdigits(apply(x->(if (1==x, 0, x)), digits(n, 3)), 3);
    A300824(n) = -sumdiv(n,d,(dA300222(d));

Formula

a(n) = A300222(n) - A300822(n).
a(n) = -Sum_{d|n, dA008683(n/d)*A300222(d) = Sum_{d|n, dA300822(d).
a(n) = A051953(n) - A300823(n).

A300822 Möbius transform of A300222.

Original entry on oeis.org

0, 2, 0, -2, 2, 4, 6, 8, 0, -4, 2, -4, 0, -6, 4, -2, 8, 12, 18, 22, 12, 14, 20, 16, 22, 24, 0, 0, 2, -8, 0, -4, 4, -4, 0, -12, 0, -18, 0, -28, 2, -12, 6, -8, 12, -4, 20, -4, 12, -2, 16, 0, 26, 36, 50, 48, 36, 50, 56, 44, 60, 60, 36, 52, 54, 28, 54, 52, 40, 60, 62, 48, 72, 72, 44, 72, 66, 48, 78, 82, 0, -4, 2, 0, -10, -6, 4, -10, 8, -24, -6, -14, 0
Offset: 1

Views

Author

Antti Karttunen, Mar 14 2018

Keywords

Crossrefs

Programs

  • Mathematica
    Table[DivisorSum[n, MoebiusMu[n/#] FromDigits[IntegerDigits[#, 3] /. 1 -> 0, 3] &], {n, 93}] (* Michael De Vlieger, Mar 17 2018 *)
  • PARI
    A300222(n) = fromdigits(apply(x->(if (1==x, 0, x)), digits(n, 3)), 3);
    A300822(n) = sumdiv(n,d,moebius(n/d)*A300222(d));

Formula

a(n) = Sum_{d|n} moebius(n/d)*A300222(d).
a(n) = A000010(n) - A300821(n).
a(n) = A300222(n) - A300824(n).

A004488 Tersum n + n.

Original entry on oeis.org

0, 2, 1, 6, 8, 7, 3, 5, 4, 18, 20, 19, 24, 26, 25, 21, 23, 22, 9, 11, 10, 15, 17, 16, 12, 14, 13, 54, 56, 55, 60, 62, 61, 57, 59, 58, 72, 74, 73, 78, 80, 79, 75, 77, 76, 63, 65, 64, 69, 71, 70, 66, 68, 67, 27, 29, 28, 33, 35, 34, 30, 32, 31, 45, 47, 46, 51
Offset: 0

Views

Author

Keywords

Comments

Could also be described as "Write n in base 3, then replace each digit with its base-3 negative" as with A048647 for base 4. - Henry Bottomley, Apr 19 2000
a(a(n)) = n, a self-inverse permutation of the nonnegative integers. - Reinhard Zumkeller, Dec 19 2003
First 3^n terms of the sequence form a permutation s(n) of 0..3^n-1, n>=1; the number of inversions of s(n) is A016142(n-1). - Gheorghe Coserea, Apr 23 2018

Crossrefs

Programs

  • Haskell
    a004488 0 = 0
    a004488 n = if d == 0 then 3 * a004488 n' else 3 * a004488 n' + 3 - d
                where (n', d) = divMod n 3
    -- Reinhard Zumkeller, Mar 12 2014
    
  • Maple
    a:= proc(n) local t, r, i;
          t, r:= n, 0;
          for i from 0 while t>0 do
            r:= r+3^i *irem(2*irem(t, 3, 't'), 3)
          od; r
        end:
    seq(a(n), n=0..80);  # Alois P. Heinz, Sep 07 2011
  • Mathematica
    a[n_] := FromDigits[Mod[3-IntegerDigits[n, 3], 3], 3]; Table[a[n], {n, 0, 66}] (* Jean-François Alcover, Mar 03 2014 *)
  • PARI
    a(n) = my(b=3); fromdigits(apply(d->(b-d)%b, digits(n, b)), b);
    vector(67, i, a(i-1))  \\ Gheorghe Coserea, Apr 23 2018
    
  • Python
    from sympy.ntheory.factor_ import digits
    def a(n): return int("".join([str((3 - i)%3) for i in digits(n, 3)[1:]]), 3) # Indranil Ghosh, Jun 06 2017

Formula

Tersum m + n: write m and n in base 3 and add mod 3 with no carries, e.g., 5 + 8 = "21" + "22" = "10" = 1.
a(n) = Sum(3-d(i)-3*0^d(i): n=Sum(d(i)*3^d(i): 0<=d(i)<3)). - Reinhard Zumkeller, Dec 19 2003
a(3*n) = 3*a(n), a(3*n+1) = 3*a(n)+2, a(3*n+2) = 3*a(n)+1. - Robert Israel, May 09 2014

A300825 Filter sequence combining A300823(n) and A300824(n).

Original entry on oeis.org

1, 2, 2, 3, 2, 4, 2, 5, 6, 7, 2, 8, 2, 9, 10, 9, 2, 11, 2, 12, 13, 14, 2, 15, 16, 17, 18, 19, 2, 20, 2, 21, 22, 23, 24, 25, 2, 26, 27, 28, 2, 29, 2, 30, 31, 32, 2, 33, 34, 35, 36, 37, 2, 38, 39, 40, 41, 42, 2, 43, 2, 44, 45, 44, 46, 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, 64, 67, 68, 69
Offset: 1

Views

Author

Antti Karttunen, Mar 14 2018

Keywords

Comments

Restricted growth sequence transform of ordered pair [A300823(n), A300824(n)].
For all i, j: a(i) = a(j) => A051953(i) = A051953(j).

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; };
    write_to_bfile(start_offset,vec,bfilename) = { for(n=1, length(vec), write(bfilename, (n+start_offset)-1, " ", vec[n])); }
    A244042(n) = fromdigits(apply(x->(x%2), digits(n, 3)), 3);
    A300823(n) = -sumdiv(n,d,(dA244042(d));
    A300222(n) = (n - A244042(n));
    A300824(n) = -sumdiv(n,d,(dA300222(d));
    Aux300825(n) = [A300823(n), A300824(n)];
    write_to_bfile(1,rgs_transform(vector(up_to,n,Aux300825(n))),"b300825.txt");
Showing 1-4 of 4 results.