OFFSET
1,2
COMMENTS
LINKS
M. F. Hasler, Table of n, a(n) for n = 1..500
Peter Luschny, Re: Is the A123706 triangle an extension of the Moebius function?, seqcomp list, Feb 12 2012
FORMULA
a(n) = 2^(m+1) - 1 when n is the product of m distinct odd primes. [Corrected by M. F. Hasler, Feb 13 2012]
For any k>1, a(n)=2^k if, and only if, n is a nonsquarefree number with A001221(n) = k-1 (= omega(n), number of distinct prime factors), with the only exception of a(n=6)=2^2. - M. F. Hasler, Feb 12 2012
A123709(n) = 1 + #{ k in 1..n-1 | Moebius(n,k+1) <> Moebius(n,k) }, where Moebius(n,k)={moebius(n/k) if n=0 (mod k), 0 else}, cf. link to message by P. Luschny. - M. F. Hasler, Feb 13 2012
EXAMPLE
a(n) = 3 when n is an odd prime.
a(n) = 7 when n is the product of two different odd primes. [Corrected by M. F. Hasler, Feb 13 2012]
a(n) = 15 when n is the product of three different odd primes. [Corrected by M. F. Hasler, Feb 13 2012]
MATHEMATICA
Moebius[i_, j_]:=If[Divisible[i, j], MoebiusMu[i/j], 0];
A123709[n_]:=Length[Select[Table[Moebius[n, j]-Moebius[n, j+1], {j, 1, n}], #!=0&]];
Array[A123709, 500] (* Enrique Pérez Herrero, Feb 13 2012 *)
PROG
(PARI) {a(n)=local(M=matrix(n, n, r, c, if(r>=c, floor(r/c)))^-1); sum(k=1, n, if(M[n, k]==0, 0, 1))}
(PARI) A123709(n)=#select((matrix(n, n, r, c, r\c)^-1)[n, ], x->x) \\ M. F. Hasler, Feb 12 2012
(PARI) A123709(n)={ my(t=moebius(n)); sum(k=2, n, t+0 != t=if(n%k, 0, moebius(n\k)))+1} /* the "t+0 != ..." is required because of a bug in PARI versions <= 2.4.2, maybe beyond, which seems to be fixed in v. 2.5.1 */ \\ M. F. Hasler, Feb 13 2012
CROSSREFS
KEYWORD
nonn
AUTHOR
Paul D. Hanna, Oct 09 2006
STATUS
approved