login
A370857
Let L_1 = (1) and L_2 = (1, 2); for any n > 2, L_n is obtained by inserting one n between each pair of consecutive terms of L_{n-1} coprime to n; a(n) gives the number of n's in L_n.
2
1, 1, 1, 1, 3, 1, 7, 9, 19, 13, 55, 21, 131, 157, 303, 317, 1039, 393, 2471, 2505, 5643, 6145, 19235, 7413, 40235, 51905, 110435, 110683, 359141, 45877, 764159, 1077437, 2253143, 2251065, 6699111, 2200709, 16009783, 20505321, 43172899, 29699143, 125396929
OFFSET
1,5
FORMULA
a(p) = (Sum_{k = 1, p-1} a(k)) - 1 for any odd prime number p.
EXAMPLE
The first terms, alongside the corresponding lists, are:
n a(n) L_n
- ---- ---------------------------------------------
1 1 (1 )
2 1 (1, 2)
3 1 (1, 3, 2)
4 1 (1, 4, 3, 2)
5 3 (1, 5, 4, 5, 3, 5, 2)
6 1 (1, 6, 5, 4, 5, 3, 5, 2)
7 7 (1, 7, 6, 7, 5, 7, 4, 7, 5, 7, 3, 7, 5, 7, 2)
PROG
(PARI) See Links section.
CROSSREFS
Cf. A049456, A370858 (partials sums).
Sequence in context: A347840 A033465 A096431 * A171501 A280332 A279939
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Mar 03 2024
STATUS
approved