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

A286251 Compound filter: a(n) = P(A001511(1+n), A046523(n)), where P(n,k) is sequence A000027 used as a pairing function.

Original entry on oeis.org

3, 2, 9, 7, 5, 16, 14, 29, 12, 16, 9, 67, 5, 16, 50, 121, 5, 67, 9, 67, 23, 16, 14, 277, 12, 16, 48, 67, 5, 436, 27, 497, 23, 16, 31, 631, 5, 16, 40, 277, 5, 436, 9, 67, 80, 16, 20, 1129, 12, 67, 31, 67, 5, 277, 40, 277, 23, 16, 9, 1771, 5, 16, 160, 2017, 23, 436, 9, 67, 23, 436, 14, 2557, 5, 16, 94, 67, 23, 436, 20, 1129, 138, 16, 9, 1771, 23, 16, 40, 277, 5
Offset: 1

Views

Author

Antti Karttunen, May 07 2017

Keywords

Crossrefs

Programs

  • PARI
    A001511(n) = (1+valuation(n,2));
    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
    A286251(n) = (2 + ((A001511(1+n)+A046523(n))^2) - A001511(1+n) - 3*A046523(n))/2;
    for(n=1, 10000, write("b286251.txt", n, " ", A286251(n)));
    
  • Python
    from sympy import factorint
    def a001511(n): return 2 + bin(n - 1)[2:].count("1") - bin(n)[2:].count("1")
    def T(n, m): return ((n + m)**2 - n - 3*m + 2)/2
    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): return T(a001511(n + 1), a046523(n)) # Indranil Ghosh, May 07 2017
  • Scheme
    (define (A286251 n) (* (/ 1 2) (+ (expt (+ (A001511 (+ 1 n)) (A046523 n)) 2) (- (A001511 (+ 1 n))) (- (* 3 (A046523 n))) 2)))
    

Formula

a(n) = (1/2)*(2 + ((A001511(1+n)+A046523(n))^2) - A001511(1+n) - 3*A046523(n)).

A286252 Compound filter: a(n) = P(A001511(1+n), A278222(n)), where P(n,k) is sequence A000027 used as a pairing function.

Original entry on oeis.org

1, 5, 2, 18, 2, 23, 7, 59, 2, 23, 16, 94, 7, 80, 29, 195, 2, 23, 16, 94, 16, 467, 67, 355, 7, 80, 67, 706, 29, 302, 121, 672, 2, 23, 16, 94, 16, 467, 67, 355, 16, 467, 436, 1894, 67, 1832, 277, 1331, 7, 80, 67, 706, 67, 1832, 631, 2779, 29, 302, 277, 2704, 121, 1178, 497, 2422, 2, 23, 16, 94, 16, 467, 67, 355, 16, 467, 436, 1894, 67, 1832, 277, 1331, 16, 467, 436
Offset: 0

Views

Author

Antti Karttunen, May 07 2017

Keywords

Crossrefs

Programs

  • PARI
    A001511(n) = (1+valuation(n,2));
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t }; \\ Modified from code of M. F. Hasler
    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
    A278222(n) = A046523(A005940(1+n));
    A286252(n) = (2 + ((A001511(1+n)+A278222(n))^2) - A001511(1+n) - 3*A278222(n))/2;
    for(n=0, 16384, write("b286252.txt", n, " ", A286252(n)));
    
  • Python
    from sympy import prime, factorint
    import math
    def T(n, m): return ((n + m)**2 - n - 3*m + 2)/2
    def A(n): return n - 2**int(math.floor(math.log(n, 2)))
    def b(n): return n + 1 if n<2 else prime(1 + (len(bin(n)[2:]) - bin(n)[2:].count("1"))) * b(A(n))
    def a005940(n): return b(n - 1)
    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 a278222(n): return a046523(a005940(n + 1))
    def a001511(n): return 2 + bin(n - 1)[2:].count("1") - bin(n)[2:].count("1")
    def a(n): return T(a001511(n + 1), a278222(n)) # Indranil Ghosh, May 07 2017
  • Scheme
    (define (A286252 n) (* (/ 1 2) (+ (expt (+ (A001511 (+ 1 n)) (A278222 n)) 2) (- (A001511 (+ 1 n))) (- (* 3 (A278222 n))) 2)))
    

Formula

a(n) = (1/2)*(2 + ((A001511(1+n)+A278222(n))^2) - A001511(1+n) - 3*A278222(n)).

A286253 Compound filter: a(n) = P(A055396(n), A001511(1+n)), where P(n,k) is sequence A000027 used as a pairing function.

Original entry on oeis.org

0, 1, 8, 1, 9, 1, 25, 1, 5, 1, 26, 1, 27, 1, 17, 1, 35, 1, 53, 1, 5, 1, 75, 1, 9, 1, 8, 1, 65, 1, 131, 1, 5, 1, 13, 1, 90, 1, 12, 1, 104, 1, 134, 1, 5, 1, 186, 1, 14, 1, 8, 1, 152, 1, 18, 1, 5, 1, 188, 1, 189, 1, 30, 1, 9, 1, 229, 1, 5, 1, 273, 1, 252, 1, 8, 1, 14, 1, 347, 1, 5, 1, 323, 1, 9, 1, 12, 1, 324, 1, 19, 1, 5, 1, 31, 1, 350, 1, 8, 1, 377, 1, 462, 1, 5
Offset: 1

Views

Author

Antti Karttunen, May 07 2017

Keywords

Crossrefs

Programs

  • PARI
    A001511(n) = (1+valuation(n,2));
    A055396(n) = if(n==1, 0, primepi(factor(n)[1, 1])); \\ This function from Charles R Greathouse IV, Apr 23 2015
    A286253(n) = (2 + ((A055396(n)+A001511(1+n))^2) - A055396(n) - 3*A001511(1+n))/2;
    for(n=1, 10000, write("b286253.txt", n, " ", A286253(n)));
    
  • Python
    from sympy import primepi, isprime, primefactors
    def T(n, m): return ((n + m)**2 - n - 3*m + 2)/2
    def a049084(n): return primepi(n)*(1*isprime(n))
    def a055396(n): return 0 if n==1 else a049084(min(primefactors(n)))
    def a001511(n): return 2 + bin(n - 1)[2:].count("1") - bin(n)[2:].count("1")
    def a(n): return T(a055396(n), a001511(n + 1)) # Indranil Ghosh, May 07 2017
  • Scheme
    (define (A286253 n) (* (/ 1 2) (+ (expt (+ (A055396 n) (A001511 (+ 1 n))) 2) (- (A055396 n)) (- (* 3 (A001511 (+ 1 n)))) 2)))
    

Formula

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