A005428 a(n) = ceiling((1 + sum of preceding terms) / 2) starting with a(0) = 1.
1, 1, 2, 3, 4, 6, 9, 14, 21, 31, 47, 70, 105, 158, 237, 355, 533, 799, 1199, 1798, 2697, 4046, 6069, 9103, 13655, 20482, 30723, 46085, 69127, 103691, 155536, 233304, 349956, 524934, 787401, 1181102, 1771653, 2657479, 3986219, 5979328, 8968992, 13453488, 20180232, 30270348, 45405522, 68108283, 102162425, 153243637, 229865456, 344798184
Offset: 0
Examples
n........0...1...2...3...4...5...6...7...8...9..10..11..12..13..14. state=1......1...........4...6...9..........31.....70..105......... state=2..1.......2...3..............14..21......47.........158..237
References
Links
- T. D. Noe, Table of n, a(n) for n = 0..500
- K. Burde, Das Problem der Abzählreime und Zahlentwicklungen mit gebrochenen Basen [The problem of counting rhymes and number expansions with fractional bases], J. Number Theory 26(2) (1987), 192-209.
- B. Chen, R. Chen, J. Guo, S. Lee et al., On Base 3/2 and its sequences, arXiv:1808.04304 [math.NT], 2018.
- L. Halbeisen and N. Hungerbuehler, The Josephus Problem, J. Théor. Nombres Bordeaux 9(2) (1997), 303-318.
- A. M. Odlyzko and H. S. Wilf, Functional iteration and the Josephus problem, Glasgow Math. J. 33 (1991), 235-240.
- Eric Weisstein's World of Mathematics, Josephus Problem.
- Wikipedia, Josephus problem.
- Index entries for sequences related to the Josephus Problem
Crossrefs
First differences of D_3(n) (A061419) in the terminology of Odlyzko and Wilf. - Ralf Stephan, Apr 23 2002
Same as log_2(A082125(n+3)). - Ralf Stephan, Apr 16 2002
Apart from initial terms, same as A073941, which has further information.
a(n) is the number of positive even k for which A024629(k) has n+1 digits. - Glen Whitney, Jul 09 2017
Programs
-
Haskell
a005428 n = a005428_list !! n a005428_list = (iterate j (1, 1)) where j (a, s) = (a', (s + a') `mod` 2) where a' = (3 * a + (1 - s) * a `mod` 2) `div` 2 -- Reinhard Zumkeller, May 10 2015 (fixed), Oct 26 2011
-
Mathematica
f[s_] := Append[s, Ceiling[(1 + Plus @@ s)/2]]; Nest[f, {1}, 40] (* Robert G. Wilson v, Jul 07 2006 *) nxt[{t_,a_}]:=Module[{c=Ceiling[(1+t)/2]},{t+c,c}]; NestList[nxt,{1,1},50][[All,2]] (* Harvey P. Dale, Nov 05 2017 *)
-
PARI
{ a=1; s=2; for(k=1,50, print1(a,", "); a=(3*a+s-1)\2; s=(s+a)%3; ) } \\ Max Alekseyev, Mar 28 2009
-
PARI
s=0;vector(50,n,-s+s+=s\2+1) \\ M. F. Hasler, Oct 14 2012
-
Python
from itertools import islice def A005428_gen(): # generator of terms a, c = 1, 0 yield 1 while True: yield (a:=1+((c:=c+a)>>1)) A005428_list = list(islice(A005428_gen(),30)) # Chai Wah Wu, Sep 21 2022
Formula
a(0) = 1; a(n) = ceiling((1 + Sum_{k=0..n-1} a(k)) / 2). - Don Reble, Apr 23 2003
a(1) = 1, s(1) = 2, and for n > 1, a(n) = floor((3*a(n-1) + s(n-1) - 1) / 2), s(n) = (s(n-1) + a(n)) mod 3. - Max Alekseyev, Mar 28 2009
a(n) = floor(1 + (sum of preceding terms)/2). - M. F. Hasler, Oct 14 2012
Extensions
More terms from Hans Havermann, Apr 23 2003
Definition replaced with a simpler formula due to Don Reble, by M. F. Hasler, Oct 14 2012
Comments