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

This page as a plain text file.
%I A284584 #16 May 09 2021 09:51:41
%S A284584 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,
%T A284584 18,19,12,20,21,22,13,23,24,25,14,26,27,28,15,16,29,30,17,18,19,31,20,
%U A284584 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
%N A284584 a(1) = 0; for n > 1, if n is not squarefree, then a(n) = A057627(n), otherwise a(n) = A013928(n).
%C A284584 Each number n > 0 occurs exactly twice in this sequence, at the positions A005117(1+n) and A013929(n).
%H A284584 Antti Karttunen, <a href="/A284584/b284584.txt">Table of n, a(n) for n = 1..10000</a>
%F A284584 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).
%o A284584 (Scheme) (define (A284584 n) (cond ((= 1 n) 0) ((zero? (A008683 n)) (A057627 n)) (else (A013928 n))))
%o A284584 (Python)
%o A284584 from sympy import mobius
%o A284584 from sympy.ntheory.factor_ import core
%o A284584 def a057627(n): return n - sum([mobius(k)**2 for k in range(1, n + 1)])
%o A284584 def a013928(n): return sum([1 for i in range(1, n) if core(i) == i])
%o A284584 def a(n):
%o A284584     if n==1: return 0
%o A284584     if core(n)==n: return a013928(n)
%o A284584     else: return a057627(n)
%o A284584 print([a(n) for n in range(1, 121)]) # _Indranil Ghosh_, Apr 17 2017
%Y A284584 Cf. A005117, A008683, A013928, A013929, A057627, A243343, A243345, A243347, A243352.
%Y A284584 Cf. A066136 (a similar sequence).
%K A284584 nonn
%O A284584 1,3
%A A284584 _Antti Karttunen_, Apr 17 2017