OFFSET
1,2
COMMENTS
This sequence has similarities with A084110.
Fixed points appear to be sparse; the first few are 1, 6, 126, 198, 1433322, 317533782, 386625738, 451240398.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10000
FORMULA
a(p^k) = (p^(k+1)-1)/(p-1) for any k >= 0 and any prime number p.
n <= a(n) < 2*n.
EXAMPLE
For n = 30:
- we have:
k e_k d_k
- --- ---
0 0 N/A
1 1 1
2 3 2
3 0 3
4 5 5
5 11 6
6 1 10
7 16 15
8 46 30
- so a(30) = 46.
PROG
(PARI) a(n) = my (e=0); fordiv (n, d, if (e>=d, e-=d, e+=d)); e
CROSSREFS
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Jan 25 2020
STATUS
approved