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.

A284584 a(1) = 0; for n > 1, if n is not squarefree, then a(n) = A057627(n), otherwise a(n) = A013928(n).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Apr 17 2017

Keywords

Comments

Each number n > 0 occurs exactly twice in this sequence, at the positions A005117(1+n) and A013929(n).

Crossrefs

Cf. A066136 (a similar sequence).

Programs

  • Python
    from sympy import mobius
    from sympy.ntheory.factor_ import core
    def a057627(n): return n - sum([mobius(k)**2 for k in range(1, n + 1)])
    def a013928(n): return sum([1 for i in range(1, n) if core(i) == i])
    def a(n):
        if n==1: return 0
        if core(n)==n: return a013928(n)
        else: return a057627(n)
    print([a(n) for n in range(1, 121)]) # Indranil Ghosh, Apr 17 2017
  • Scheme
    (define (A284584 n) (cond ((= 1 n) 0) ((zero? (A008683 n)) (A057627 n)) (else (A013928 n))))
    

Formula

a(1) = 0; for n > 1, if A008683(n) is 0 [when n is not squarefree], then a(n) = A057627(n), otherwise a(n) = A013928(n).