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

A297161 Restricted growth sequence transform of A297171, which is Möbius transform of A243071.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 27 2017

Keywords

Crossrefs

Programs

  • PARI
    up_to = 8192;
    rgs_transform(invec) = { my(occurrences = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(occurrences,invec[i]), my(pp = mapget(occurrences, invec[i])); outvec[i] = outvec[pp] , mapput(occurrences,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])); }
    A064989(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)};
    A243071(n) = if(n<=2, n-1, if(!(n%2), 2*A243071(n/2), 1+(2*A243071(A064989(n)))));
    A297171(n) = sumdiv(n,d,moebius(n/d)*A243071(d));
    write_to_bfile(1,rgs_transform(vector(up_to,n,A297171(n))),"b297161.txt");

A364571 a(n) = A297171(A163511(n)), where A297171 is the Möbius transform of the inverse permutation of A163511.

Original entry on oeis.org

0, 1, 1, 3, 2, 2, 2, 7, 4, 4, 2, 4, 5, 3, 6, 15, 8, 8, 4, 8, 4, 4, 4, 8, 10, 10, 4, 5, 13, 11, 14, 31, 16, 16, 8, 16, 8, 8, 8, 16, 8, 8, 4, 8, 8, 8, 8, 16, 20, 20, 10, 20, 7, 9, 6, 9, 26, 26, 12, 21, 29, 27, 30, 63, 32, 32, 16, 32, 16, 16, 16, 32, 16, 16, 8, 16, 16, 16, 16, 32, 16, 16, 8, 16, 8, 8, 8, 16, 16, 16
Offset: 0

Views

Author

Antti Karttunen, Aug 05 2023

Keywords

Crossrefs

Cf. also A364567.

Programs

Formula

a(n) = A297171(A163511(n)).

A243071 Permutation of nonnegative integers: a(1) = 0, a(2) = 1, a(2n) = 2*a(n), a(2n+1) = 1 + 2*a(A064989(2n+1)).

Original entry on oeis.org

0, 1, 3, 2, 7, 6, 15, 4, 5, 14, 31, 12, 63, 30, 13, 8, 127, 10, 255, 28, 29, 62, 511, 24, 11, 126, 9, 60, 1023, 26, 2047, 16, 61, 254, 27, 20, 4095, 510, 125, 56, 8191, 58, 16383, 124, 25, 1022, 32767, 48, 23, 22, 253, 252, 65535, 18, 59, 120, 509, 2046, 131071
Offset: 1

Views

Author

Antti Karttunen, Jun 20 2014

Keywords

Comments

Note the indexing: the domain starts from 1, while the range includes also zero.
See also the comments at A163511, which is the inverse permutation to this one.

Crossrefs

Inverse: A163511.
Cf. A000040, A000225, A007814, A054429, A064989, A064216, A122111, A209229, A245611 (= (a(2n-1)-1)/2, for n > 1), A245612, A292383, A292385, A297171 (Möbius transform).
Cf. A007283 (known positions where a(n)=n), A364256 [= gcd(n,a(n))], A364288 [= n-a(n)], A364289 [where a(n)>=n], A364290 [where a(n)A364291 [where a(n)<=n], A364497 [where n|a(n)].
Cf. A156552 (variant with inverted binary code), A253566, A332215, A332811, A334859 (other variants).

Programs

  • PARI
    A064989(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)};
    A243071(n) = if(n<=2, n-1, if(!(n%2), 2*A243071(n/2), 1+(2*A243071(A064989(n))))); \\ Antti Karttunen, Jul 18 2020
    
  • PARI
    A243071(n) = if(n<=2, n-1, my(f=factor(n), p, p2=1, res=0); for(i=1, #f~, p = 1 << (primepi(f[i, 1]) - 1); res += (p*p2*(2^(f[i, 2]) - 1)); p2 <<= f[i, 2]); ((3<<#binary(res\2))-res-1)); \\ (Combining programs given in A156552 and A054429) - Antti Karttunen, Jul 28 2023
    
  • Python
    from functools import reduce
    from sympy import factorint, prevprime
    from operator import mul
    def a064989(n):
        f = factorint(n)
        return 1 if n==1 else reduce(mul, (1 if i==2 else prevprime(i)**f[i] for i in f))
    def a(n): return n - 1 if n<3 else 2*a(n//2) if n%2==0 else 1 + 2*a(a064989(n))
    print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 15 2017
  • Scheme
    ;; With memoizing definec-macro from Antti Karttunen's IntSeq-library.
    (definec (A243071 n) (cond ((<= n 2) (- n 1)) ((even? n) (* 2 (A243071 (/ n 2)))) (else (+ 1 (* 2 (A243071 (A064989 n)))))))
    

Formula

a(1) = 0, a(2) = 1, a(2n) = 2*a(n), a(2n+1) = 1 + 2*a(A064989(2n+1)).
For n >= 1, a(A000040(n)) = A000225(n).
For n >= 1, a(2n+1) = 1 + 2*a(A064216(n+1)).
From Antti Karttunen, Jul 18 2020: (Start)
a(n) = A245611(A048673(n)).
a(n) = A253566(A122111(n)).
a(n) = A334859(A225546(n)).
For n >= 2, a(n) = A054429(A156552(n)).
a(n) = A292383(n) + A292385(n) = A292383(n) OR A292385(n).
For n > 1, A007814(a(n)) = A007814(n) - A209229(n). [This map preserves the 2-adic valuation of n, except when n is a power of two, in which cases it is decremented by one.]
(End)

A297112 Möbius transform of A156552.

Original entry on oeis.org

0, 1, 2, 2, 4, 2, 8, 4, 4, 4, 16, 4, 32, 8, 4, 8, 64, 4, 128, 8, 8, 16, 256, 8, 8, 32, 8, 16, 512, 4, 1024, 16, 16, 64, 8, 8, 2048, 128, 32, 16, 4096, 8, 8192, 32, 8, 256, 16384, 16, 16, 8, 64, 64, 32768, 8, 16, 32, 128, 512, 65536, 8, 131072, 1024, 16, 32, 32, 16, 262144, 128, 256, 8, 524288, 16, 1048576, 2048, 8
Offset: 1

Views

Author

Antti Karttunen, Dec 26 2017

Keywords

Crossrefs

Programs

  • PARI
    A064989(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)};
    A156552(n) = if(1==n, 0, if(!(n%2), 1+(2*A156552(n/2)), 2*A156552(A064989(n))));
    A297112(n) = sumdiv(n,d,moebius(n/d)*A156552(d));
    
  • Scheme
    ;; With memoization-macro definec.
    (definec (A297112 n) (cond ((<= n 2) (- n 1)) ((odd? n) (* 2 (A297112 (A064989 n)))) ((= 2 (modulo n 4)) (A297112 (/ n 2))) (else (* 2 (A297112 (/ n 2)))))) ;; Antti Karttunen, Dec 27 2017

Formula

a(1) = 0, a(2) = 1, after which, a(2n+1) = 2*a(A064989(2n+1)), a(4n) = 2*a(2n), a(4n+2) = a(2n+1).
a(n) = Sum_{d|n} A008683(n/d)*A156552(d).
For n > 1, a(n) = A000079(A297113(n)-1).

A297156 Möbius transform of A243354.

Original entry on oeis.org

0, 1, 3, 1, 7, 2, 15, 3, 1, 6, 31, 6, 63, 14, 2, 5, 127, 2, 255, 14, 10, 30, 511, 10, 1, 62, 7, 30, 1023, 4, 2047, 11, 26, 126, 2, 2, 4095, 254, 58, 26, 8191, 12, 16383, 62, 14, 510, 32767, 22, 1, 2, 122, 126, 65535, 6, 18, 58, 250, 1022, 131071, 4, 262143, 2046, 30, 21, 50, 28, 524287, 254, 506, 4, 1048575, 6
Offset: 1

Views

Author

Antti Karttunen, Dec 28 2017

Keywords

Crossrefs

Cf. A006068, A156552, A243354, A297157 (rgs-transform of this sequence).
Cf. also A297112, A297171, A297172.

Programs

  • PARI
    A064989(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)};
    A156552(n) = if(1==n, 0, if(!(n%2), 1+(2*A156552(n/2)), 2*A156552(A064989(n))));
    A006068(n)= { my(s=1, ns); while(1, ns = n >> s; if(0==ns, break()); n = bitxor(n, ns); s <<= 1; ); return (n); } \\ Essentially Joerg Arndt's Jul 19 2012 code.
    A243354(n) = A006068(A156552(n));
    A297156(n) = sumdiv(n,d,moebius(n/d)*A243354(d));

A297172 Möbius transform of A253564.

Original entry on oeis.org

0, 1, 3, 1, 7, 1, 15, 2, 3, 3, 31, 3, 63, 7, 3, 4, 127, 2, 255, 7, 9, 15, 511, 6, 7, 31, 6, 15, 1023, 3, 2047, 8, 21, 63, 7, 4, 4095, 127, 45, 14, 8191, 7, 16383, 31, 9, 255, 32767, 12, 15, 4, 93, 63, 65535, 4, 21, 30, 189, 511, 131071, 5, 262143, 1023, 21, 16, 49, 15, 524287, 127, 381, 5, 1048575, 8, 2097151, 2047, 6
Offset: 1

Views

Author

Antti Karttunen, Dec 26 2017

Keywords

Crossrefs

Cf. A008683, A064989, A122111, A156552, A253564, A297162 (rgs-transform of this sequence).
Cf. also A297112, A297156, A297171.

Programs

Formula

a(n) = Sum_{d|n} A008683(n/d)*A253564(d).
Showing 1-6 of 6 results.