OFFSET
0,3
REFERENCES
D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, Vol. 3, p. 208.
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..5000
MATHEMATICA
A003073[n_]:= If[Mod[n, 3]==0, Floor[3*2^Floor[n/3]/2] - Boole[Floor[n/3] >0], If[Mod[n, 3]==2, 2*Floor[17*2^Floor[n/3]/14] +Boole[Floor[n/3] == 2], Floor[53*2^Floor[n/3]/28] - Boole[Floor[n/3] >2] ]];
Table[A003073[n], {n, 0, 60}] (* G. C. Greubel, Nov 03 2022 *)
PROG
(PARI) a(n)=local(k); k=n\3; if(n%3==0, 3*2^k\2-(k>0), if(n%3==2, 2*(17*2^k\14)+(k==2), 53*2^k\28-(k>2))) /* Michael Somos, May 04 2000 */
(SageMath)
def A003073(n):
if (n%3==0): return ((3*2^(n//3))//2) - int((n//3)>0)
elif (n%3==2): return 2*((17*2^(n//3))//14) + int((n//3)==2)
else: return ((53*2^(n//3))//28) - int((n//3)>2)
[A003073(n) for n in range(61)] # G. C. Greubel, Nov 03 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
More terms from Michael Somos, May 04 2000
STATUS
approved