Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A096016
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A096016 A modified Fibonacci sequence controlled by a toggle switch. The toggle switch (initial state of 2) flips between 2 and 3 after each reduction. +0
1
0, 1, 1, 2, 3, 5, 4, 3, 7, 5, 4, 9, 13, 11, 8, 19, 27, 23, 50, 73, 41, 57, 98, 155, 253, 136, 389, 525, 457, 982, 1439, 807, 1123, 1930, 3053, 1661, 2357, 4018, 2125, 6143, 4134, 10277, 14411, 24688, 13033, 37721, 25377, 63098, 88475, 151573, 80016, 231589 (list; graph; listen)
OFFSET

0,4

COMMENT

Initial state: a(1)=0, a(2)=1, j=2; thereafter a(n)=a(n-1)+a(n-2) and if a(n)>2, j=2 and a(n) == 0 (mod 2) then a(n)=a(n)/j and j=3; if a(n)>3, j=3 and a(n) == 0 (mod 3) then a(n)=a(n)/j and j=2.

EXAMPLE

a(0) = 0 by definition and the initial state of the toggle switch is 2

a(1) = 1 by definition

a(2) = 0+1 = 1

a(3) = 1+1 = 2

a(4) = 1+2 = 3

a(5) = 2+3 = 5

a(6) = 3+5 => 8 => 4 since 8 > 2, therefore 8/2 = 4 and toggle the switch from 2 to 3

a(7) = 5+4 => 9 => 3 since 9 is > 3, therefore 9/3 = 3 and toggle the switch from 3 back to 2

a(8) = 4+3 = 7

a(9) = 3+7 => 10 => 5 since 10 is > 2, therefore 10/2 = 5 and toggle the switch to 3

a(10) = 7+5 => 12 => 4 since 12 is > 3, therefore 12/3 = 4 and toggle the switch to 2

a(11) = 5+4 = 9, can not reduce by the toggle switch because 9/2 is not an integer

a(12) = 4+9 = 13

a(13) = 9+13 => 22 => 11 and toggle the switch to 3

a(14) = 13+11 => 24 => 8 and set the toggle switch to 2

a(15) = 11+8 = 19, etc.

MATHEMATICA

a[0] = 0; a[1] = 1; ts = 0; a[n_] := a[n] = Block[{b = a[n - 1] + a[n - 2]}, If[ IntegerQ[ b / (ts + 2)] && b > 3, b = b/(ts + 2); ts = Mod[ts + 1, 2]]; b]; Table[ a[n], {n, 0, 52}] (from Robert G. Wilson v Jul 21 2004)

CROSSREFS

Adjacent sequences: A096013 A096014 A096015 this_sequence A096017 A096018 A096019

Sequence in context: A082233 A058981 A117339 this_sequence A123274 A023818 A102149

KEYWORD

nonn

AUTHOR

Pierre CAMI (pierrecami(AT)tele2.fr), Jul 20 2004

EXTENSIONS

Edited by Robert G. Wilson v (rgwv(AT)rgwv.com), Jul 21 2004

page 1

Search completed in 0.002 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified October 13 09:05 EDT 2008. Contains 145008 sequences.


AT&T Labs Research