login
A098371
a(1) = 1; for n > 1, a(n) is the number of i in range 1..n-1 for which gcd(n, a(i)) = Max_{k=1..n-1} gcd(n, a(k)).
4
1, 1, 2, 1, 4, 2, 6, 1, 1, 4, 10, 1, 12, 7, 1, 3, 16, 2, 18, 1, 1, 10, 22, 1, 2, 13, 1, 1, 28, 2, 30, 1, 1, 16, 2, 1, 36, 19, 1, 3, 40, 1, 42, 1, 1, 21, 46, 2, 4, 4, 9, 1, 52, 2, 1, 1, 1, 27, 58, 1, 60, 29, 2, 2, 2, 1, 66, 12, 1, 2, 70, 1, 72, 37, 2, 1, 2, 1, 78, 1, 1, 40, 82, 1, 7, 42, 2, 2, 88, 2, 3
OFFSET
1,3
COMMENTS
a(n) = n-1 iff n = 1 or n is prime;
a(A098373(n)) = n and a(m) <> n for m < A098373(n);
a(A098374(n)) = 1;
a(n) = #{m: gcd(n,a(m)) = A098372(n)}.
Notes from Antti Karttunen, Mar 30 2021: (Start)
The original definition was: #{m: gcd(n, a(m)) = Max_{k=1..n-1} gcd(n, a(k))}, but it hardly seems well-defined unless the range of m is somehow restricted.
Informally the definition could be expressed as: Number of k in range 1..n-1 for which gcd(n, a(k)) attains the maximal such gcd-value that occurs in the same range.
(End)
PROG
(PARI) A098371list(up_to) = { my(v=vector(up_to)); v[1] = 1; for(n=2, #v, my(m=1); for(k=1, n-1, m = max(m, gcd(n, v[k]))); v[n] = sum(k=1, n-1, m == gcd(n, v[k]))); (v); }; \\ Antti Karttunen, Mar 30 2021
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Reinhard Zumkeller, Sep 05 2004
EXTENSIONS
Definition clarified by Antti Karttunen, Mar 30 2021
STATUS
approved