cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A113683 a(n)=a(n-1)/3 if a(n-1)=0(mod 3), a(n)=4*a(n-1)+2 if a(n-1)=1(mod 3), a(n)=4*a(n-1)-2 if a(n-1)=2(mod 3).

This page as a plain text file.
%I A113683 #8 Feb 19 2018 17:50:06
%S A113683 10,42,14,54,18,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,
%T A113683 2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,
%U A113683 2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2
%N A113683 a(n)=a(n-1)/3 if a(n-1)=0(mod 3), a(n)=4*a(n-1)+2 if a(n-1)=1(mod 3), a(n)=4*a(n-1)-2 if a(n-1)=2(mod 3).
%t A113683 a[0] = 10; a[n_] := a[n] = Switch[ Mod[a[n - 1], 3], 0, a[n - 1]/3, 1, 4a[n - 1] + 2, 2, 4a[n - 1] - 2]; Table[ a[n], {n, 0, 102}] (* _Robert G. Wilson v_, Nov 10 2005 *)
%t A113683 nxt[a_]:=Module[{m=Mod[a,3]},Which[m==0,a/3,m==1,4a+2,m==2,4a-2]]; NestList[ nxt,10,110] (* or *) PadRight[{10,42,14,54,18},120,{2,6}] (* _Harvey P. Dale_, Feb 19 2018 *)
%K A113683 nonn
%O A113683 0,1
%A A113683 _Edwin F. Sampang_, Nov 04 2005