OFFSET
1,1
COMMENTS
Includes prime numbers and the sequence A071700.
a(n) = A240960(n) for n <= 35. - Reinhard Zumkeller, Aug 05 2014
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
MATHEMATICA
fa = FactorInteger; A060968[p_, s_] := Which[Mod[p, 4] == 1, p^( s - 1)*(p - 1), Mod[p, 4] == 3, p^(s - 1)*(p + 1), s == 1, 2, True, 2^(s + 1)]; A060968[1] = 1; A060968[n_] := Product[A060968[fa[n][[i, 1]], fa[n][[i, 2]]], {i, Length[fa[n]]}]; A201629[n_] := Which[Mod[n, 4] == 1, (n - 1), Mod[n, 4] == 3, (n + 1), True, n]; Select[Range[1000], A060968[#] == A201629[#] &]
PROG
(PARI) is(n)=my(f=factor(n)[, 1]); n*prod(i=if(n%2, 1, 2), #f, if(f[i]%4==1, 1-1/f[i], 1+1/f[i]))*if(n%4, 1, 2)==if(n%2, (n+1)\4*4, n) \\ Charles R Greathouse IV, Jul 03 2013
(Haskell)
a182140 n = a182140_list !! (n-1)
a182140_list = [x | x <- [1..], a060968 x == a201629 x]
-- Reinhard Zumkeller, Aug 05 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
José María Grau Ribas, Apr 14 2012
STATUS
approved