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.

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)).

A286462 Compound filter (3-adic valuation & the length of rightmost run of 1's in base-2): a(n) = P(A051064(n), A089309(n)), where P(n,k) is sequence A000027 used as a pairing function.

Original entry on oeis.org

1, 1, 5, 1, 1, 5, 4, 1, 6, 1, 2, 5, 1, 4, 12, 1, 1, 6, 2, 1, 3, 2, 4, 5, 1, 1, 14, 4, 1, 12, 11, 1, 3, 1, 2, 6, 1, 2, 8, 1, 1, 3, 2, 2, 6, 4, 7, 5, 1, 1, 5, 1, 1, 14, 4, 4, 3, 1, 2, 12, 1, 11, 31, 1, 1, 3, 2, 1, 3, 2, 4, 6, 1, 1, 5, 2, 1, 8, 7, 1, 15, 1, 2, 3, 1, 2, 8, 2, 1, 6, 2, 4, 3, 7, 11, 5, 1, 1, 9, 1, 1, 5, 4, 1, 3, 1, 2, 14, 1, 4, 12, 4, 1, 3, 2, 1
Offset: 1

Views

Author

Antti Karttunen, May 10 2017

Keywords

Crossrefs

Programs

  • PARI
    A051064(n) = if(n<1, 0, 1+valuation(n, 3));
    A089309(n) = valuation((n/2^valuation(n, 2))+1, 2); \\ After Ralf Stephan
    A286462(n) = (1/2)*(2 + ((A051064(n)+A089309(n))^2) - A051064(n) - 3*A089309(n));
    for(n=1, 10000, write("b286462.txt", n, " ", A286462(n)));
    
  • Python
    from sympy import divisors, divisor_count, mobius
    def a051064(n): return -sum([mobius(3*d)*divisor_count(n/d) for d in divisors(n)])
    def v(n): return bin(n)[2:][::-1].index("1")
    def a089309(n): return  0 if n==0 else v(n/2**v(n) + 1)
    def T(n, m): return ((n + m)**2 - n - 3*m + 2)/2
    def a(n): return T(a051064(n), a089309(n)) # Indranil Ghosh, May 11 2017
  • Scheme
    (define (A286462 n) (* (/ 1 2) (+ (expt (+ (A051064 n) (A089309 n)) 2) (- (A051064 n)) (- (* 3 (A089309 n))) 2)))
    

Formula

a(n) = (1/2)*(2 + ((A051064(n)+A089309(n))^2) - A051064(n) - 3*A089309(n)).
Showing 1-2 of 2 results.