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.

A285330 If n is squarefree, then a(n) = A048675(n), otherwise a(n) = A285328(n).

Original entry on oeis.org

0, 1, 2, 2, 4, 3, 8, 4, 3, 5, 16, 6, 32, 9, 6, 8, 64, 12, 128, 10, 10, 17, 256, 18, 5, 33, 9, 14, 512, 7, 1024, 16, 18, 65, 12, 24, 2048, 129, 34, 20, 4096, 11, 8192, 22, 15, 257, 16384, 36, 7, 40, 66, 26, 32768, 48, 20, 28, 130, 513, 65536, 30, 131072, 1025, 21, 32, 36, 19, 262144, 34, 258, 13, 524288, 54, 1048576, 2049, 45, 38, 24, 35, 2097152, 50, 27
Offset: 1

Views

Author

Antti Karttunen, Apr 19 2017

Keywords

Comments

Each n > 1 occurs exactly twice in this sequence. a(n) tells which number is located at the parent node of the node that contains n in the binary tree A285332. See further comments there.

Crossrefs

Programs

  • Mathematica
    Table[Which[n == 1, 0, MoebiusMu@ n != 0, Total@ Map[#2*2^(PrimePi@ #1 - 1) & @@ # &, FactorInteger[n]], True, With[{r = DivisorSum[n, EulerPhi[#] Abs@ MoebiusMu[#] &]}, SelectFirst[Range[n - 2, 2, -1], DivisorSum[#, EulerPhi[#] Abs@ MoebiusMu[#] &] == r &]]], {n, 81}] (* Michael De Vlieger, Dec 31 2018 *)
  • PARI
    A007947(n) = factorback(factorint(n)[, 1]); \\ From Andrew Lelechenko, May 09 2014
    A048675(n) = my(f = factor(n)); sum(k=1, #f~, f[k, 2]*2^primepi(f[k, 1]))/2; \\ Michel Marcus, Oct 10 2016
    A285328(n) = { my(r); if((n > 1 && !bitand(n,(n-1))), (n/2), r=A007947(n); if(r==n,1,n = n-r; while(A007947(n) <> r, n = n-r); n)); };
    A285330(n) = if(moebius(n)<>0,A048675(n),A285328(n));
    
  • Scheme
    (define (A285330 n) (if (not (zero? (A008683 n))) (A048675 n) (A285328 n)))

Formula

If A008683(n) <> 0 [when n is squarefree], a(n) = A048675(n), otherwise a(n) = A285328(n).