Svoboda | Graniru | BBC Russia | Golosameriki | Facebook
login
A338852
a(n) = (7*floor(a(n-1)/3)) + (a(n-1) mod 3) with a(1) = 3.
0
3, 7, 15, 35, 79, 183, 427, 995, 2319, 5411, 12623, 29451, 68719, 160343, 374131, 872971, 2036931, 4752839, 11089955, 25876559, 60378635, 140883479, 328728115, 767032267, 1789741955, 4176064559, 9744150635, 22736351479, 53051486783
OFFSET
1,1
COMMENTS
Maximum reduction height sequence for a (7,3) counter.
LINKS
ARITH Project, 7/3 counter, Aoki lab., Tohoku University.
Stenzel, Kubitz and Garcia, A Compact High-Speed Parallel Multiplication Scheme, in IEEE Transactions on Computers, vol. C-26, no. 10, pp. 948-957, Oct. 1977, doi: 10.1109/TC.1977.1674730. See p. 137.
EXAMPLE
a(6) = 7*floor(79/3) + mod(79/3) = 183.
MATHEMATICA
NestList[7 Floor[#/3] + Mod[#, 3] &, 3, 28] (* Michael De Vlieger, Nov 12 2020 *)
PROG
(C) int a(int n) {
int t1 = 3, nextTerm;
for (int i = 2; i <= n; ++i) {
nextTerm = 7*(t1/3) + t1%3;
t1 = nextTerm;
}
return t1;
}
(PARI) a(n) = if (n==1, 3, my(x=divrem(a(n-1), 3)); 7*x[1] + x[2]); \\ Michel Marcus, Nov 12 2020
CROSSREFS
Cf. A061418.
Sequence in context: A221945 A077946 A077970 * A174284 A182892 A124696
KEYWORD
nonn
AUTHOR
Chinmaya Dash, Nov 12 2020
STATUS
approved