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

A291761 Restricted growth sequence transform of ((-1)^n)*A046523(n); filter combining the parity and the prime signature of n.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Sep 11 2017

Keywords

Comments

Equally, restricted growth sequence transform of sequence b defined as b(1) = 1, and for n > 1, b(n) = A046523(n) + A000035(n), which starts as 1, 2, 3, 4, 3, 6, 3, 8, 5, 6, 3, 12, 3, 6, 7, 16, 3, 12, 3, 12, ...

Crossrefs

Cf. A291767, A291768 (bisections), A147516.
Cf. A046523, A101296, A286161, A286251, A286367, A291762 (related or similar filtering sequences).
Cf. A065091 (positions of 3's), A100484 (of 4 and 5's), A001248 (of 4 and 7's), A046388 (of 9's), A030078 (of 6 and 12's).
Cf. A098108 (one of the matching sequences).

Programs

  • PARI
    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])); }
    A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); };  \\ This function from Charles R Greathouse IV, Aug 17 2011
    write_to_bfile(1,rgs_transform(vector(65537,n,((-1)^n)*A046523(n))),"b291761.txt");
    \\ Or alternatively:
    f(n) = if(1==n,n,A046523(n)+(n%2));
    write_to_bfile(1,rgs_transform(vector(16385,n,f(n))),"b291761.txt");

A286365 Compound filter: a(n) = 2*A286364(n) + A000035(A007814(n)).

Original entry on oeis.org

2, 3, 4, 2, 6, 5, 4, 3, 14, 7, 4, 4, 6, 5, 10, 2, 6, 15, 4, 6, 32, 5, 4, 5, 20, 7, 58, 4, 6, 11, 4, 3, 32, 7, 10, 14, 6, 5, 10, 7, 6, 33, 4, 4, 24, 5, 4, 4, 14, 21, 10, 6, 6, 59, 10, 5, 32, 7, 4, 10, 6, 5, 134, 2, 42, 33, 4, 6, 32, 11, 4, 15, 6, 7, 28, 4, 32, 11, 4, 6, 242, 7, 4, 32, 42, 5, 10, 5, 6, 25, 10, 4, 32, 5, 10, 5, 6, 15, 134, 20, 6, 11, 4, 7, 46, 7
Offset: 1

Views

Author

Antti Karttunen, May 08 2017

Keywords

Comments

This sequence contains, in addition to the information contained in A286364 (which packs the values of A286361(n) and A286363(n) to a single value with the pairing function A000027) also information whether the exponent of the highest power of 2 dividing n is even or odd, which is stored in the least significant bit of a(n). Thus, for example, all squares (A000290) can be obtained by listing such numbers n that a(n) is even and both A002260(a(n)/2) & A004736(a(n)/2) are perfect squares.

Crossrefs

Cf. A286366, A286367 (similar, but contain more information).

Programs

  • Python
    from sympy import factorint
    from operator import mul
    def P(n):
        f = factorint(n)
        return sorted([f[i] for i in f])
    def a046523(n):
        x=1
        while True:
            if P(n) == P(x): return x
            else: x+=1
    def A(n, k):
        f = factorint(n)
        return 1 if n == 1 else reduce(mul, [1 if i%4==k else i**f[i] for i in f])
    def T(n, m): return ((n + m)**2 - n - 3*m + 2)/2
    def a286364(n): return T(a046523(n/A(n, 1)), a046523(n/A(n, 3)))
    def a007814(n): return 1 + bin(n - 1)[2:].count("1") - bin(n)[2:].count("1")
    def a(n): return 2*a286364(n) + a007814(n)%2 # Indranil Ghosh, May 09 2017
  • Scheme
    (define (A286365 n) (+ (* 2 (A286364 n)) (A000035 (A007814 n))))
    

Formula

a(n) = (2*A286364(n)) + (1 - A035263(n)) = 2*A286364(n) + A000035(A007814(n)).
Showing 1-2 of 2 results.