OFFSET
1,3
COMMENTS
All primes are records and there exists records which are not primes, but they are rare (see A120033). - Robert G. Wilson v, Jun 05 2006
EXAMPLE
The positive integers which are <= 8 and are coprime to 8 are 1, 3, 5 and 7. So a(8) = 1*3 + 3*5 + 5*7 = 53.
MATHEMATICA
a[n_] := Block[{s = Select[ Range@n, GCD[ #, n] == 1 &]}, Plus @@ (Most@s*Rest@s)]; Array[a, 46] (* Robert G. Wilson v, Jun 05 2006 *)
PROG
(PARI) a(n) = my(v=select(x->gcd(x, n)==1, [1..n])); sum(k=1, #v-1, v[k]*v[k+1]); \\ Michel Marcus, Mar 07 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, May 31 2006
EXTENSIONS
More terms from Robert G. Wilson v, Jun 05 2006
STATUS
approved