OFFSET
2,3
COMMENTS
The main sequence is A331787; this is added because some people may search for this.
LINKS
Jianing Song, Table of n, a(n) for n = 2..7627 (Note: T(b,n) occurs at the ((n+b-2)*(n+b-1)/2-b+3)-th place)
FORMULA
EXAMPLE
Table begins
b\n 1 2 3 4 5 6 7 8 9 10
2 1 3 7 15 31 63 127 255 511 1023
3 1 2 5 8 17 26 53 80 161 242
4 1 3 3 7 15 15 31 63 63 127
5 1 2 5 4 9 14 29 24 49 74
6 1 3 5 7 5 11 23 35 47 35
7 1 2 3 6 9 6 13 20 27 48
8 1 3 5 7 9 11 7 15 31 47
9 1 2 5 4 9 10 13 8 17 26
10 1 3 3 7 9 9 13 15 9 19
PROG
(PARI) T(b, n) = my(s=(n-1)\(b-1), t=(n-1)%(b-1)+1); b^s*(2*t-gcd(t, b-1)+1)-1
CROSSREFS
KEYWORD
AUTHOR
Jianing Song, Jan 25 2020
STATUS
approved