OFFSET
1,4
COMMENTS
a(n)/n represents, in some sense, how 'square' a positive integer n is. a(n)=1 iff n is a prime number. a(n)=n iff n is a square number. For nonsquare n, the first (note: not zeroth) partial quotient of the continued fraction of a(n)/n is n iff n is prime, else 1.
EXAMPLE
a(6) = 5 because 6-3+2=5
a(7) = 1 because 7-7+1=1
MATHEMATICA
Table[n - If[EvenQ[DivisorSigma[0, n]], Divisors[n][[DivisorSigma[0, n]/2 + 1]], Sqrt[n]] + If[EvenQ[DivisorSigma[0, n]], Divisors[n][[DivisorSigma[0, n]/2]], Sqrt[n]], {n, 1, 128}]
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Joseph Biberstine (jrbibers(AT)indiana.edu), Dec 24 2004
STATUS
approved