It's a rough old world when two era-defining television shows end within a week of each other. In the UK, ABC's island mystery Lost broadcasts its final episode this week while Fox's counterterrorist drama 24 finishes on 6 June. One made sci-fi respectable again and the other became the longest-running espionage-themed drama on TV. Both spawned imitators across the board and leave strange, occasionally dark legacies.

24 premiered a month after 9/11 to a world in turmoil that sought new certainties, new heroes. 24 delivered them in the shape of Los Angeles-based Counter Terrorist Unit (CTU) agent Jack Bauer. The show fed off the paranoia of 11 September, then stoked it with its enemy-within storylines.

The show's central conceit was to show a full 24 hours unfolding in real-time, a bold move for an already complex show. The gambit paid off. Viewers were thrilled by the show's breathless pace, daring storylines and the constant battle against the clock to prevent a terrorist spectacular. Claustrophobic direction combined with CTU's murky open-plan office and dark corridors only added to the paranoia.

24 had completed its third season when a strange new show premiered at Comic-Con in 2004. In it, a plane fell out of the sky and its survivors landed on a magical island where physics, time and logic went haywire. Memorable characters, taut storytelling and the most obtuse, intriguing mystery since Twin Peaks made Lost as much of an instant hit as 24 was three years earlier.

As broadband connections spread, Lost raced past 24 and became the first show to fully explore the possibilities of the internet. ABC developed The Lost Experience, an online multimedia scavenger hunt where fans could discover the deeper secrets that propped up the show's mysteries. The Experience included voicemail lines and a website for the show's fictional Hanso Foundation where code and passwords could be entered to reveal hidden information. It was a geek's treasure chest. While reality TV shows blathered about "viewer interactivity", Lost fans were living it.

As Lost's popularity snowballed, 24 was becoming a victim of its own excess. Although it was as compelling as ever, its eye-popping torture scenes were causing concern. Brigadier general Patrick Finnegan, dean of the military academy at West Point, met the show's producers to request that they tone down its torture content. You knew the show had arrived when only the US army could hold it back. But as the human pyramids tumbled at Guantánamo Bay it wasn't so easy for 24 to dismiss its critics. They said it was reactionary, a neocon fantasy. The word "fascist" was bandied about.

Fans of the show knew it was a lot more complicated than that. 24 portrayed principled Muslim leaders, showed Arab-Americans as patriots and hawkish politicians as villains. Season six bad guy Noah Daniels conspired to usurp the President's authority and implement racial profiling and detention centres for American Muslims and spent much of the season gagging for a nuclear strike on the Middle East. Not to mention the comically corrupt Nixon-channelling President Logan, the saint-like black Democrat President Palmer and the multiple Big Oil interests behind terrorist attacks.

Their unpredictable nature is why they're so addictive. Psychological research shows that intermittent rewards result in addiction more than continuous guaranteed rewards

As 24 fought its corner, Lost was also picking up critics. With the mythology growing ever more complex, some episodes hit bum notes and many lost patience. It was obscure for the sake of it, they said; they were making it up as they went along; worst of all, they said it never answered any of the questions it so intriguingly raised.

That final point is the most enduring myth about Lost, spread mainly by people who stopped watching around season two. The show does answer key questions. Here are a few: What's in the hatch? A crazy Scottish man preventing calamity by pushing a button. Do they make it off the island? Hell yes. What exactly is the island? The island is a cork, keeping an evil smoke monster contained so it doesn't leak out and infect the rest of the world. If these answers seem strange then you're watching the wrong show.

Just like 24, Lost retained a loyal and passionate fan base throughout its run. Both shows have had their ups and downs, yet 3,000 film and TV fans had them occupying the top two slots in lovefilm.com's most addictive shows survey. Their unpredictable nature is probably why they're so addictive. Psychological research shows that intermittent rewards result in addiction more than continuous guaranteed rewards. So 24 and Lost with their big highs with lulls in between are more likely to produce addiction than, say, the consistency of The West Wing.

Just when you thought you had a handle on these shows they broke formation and produced something spectacular. They demanded a lot from their viewers and following them required real commitment. True believers never doubted it was worth the effort. Both shows could infuriate but a great episode of Lost was just magical and a great episode of 24 was just exhilarating.

Ultimately, that's what makes Lost and 24 stand apart – their connection with the fans. They brought the best out of its viewers – Jack Bauer fan sites, forums and Facebook groups and the Lost conspiracy theories, even more labyrinthine than the show itself. The fan-led podcasts, YouTube tribute videos and thriving fan fiction subculture let you know that these shows had an impact like few others are even capable of doing. They helped produce the most literate, media savvy, actively participating generation of television viewers yet. As legacies go, it's not a bad one to be going on with.

LOST IN NUMBERS

121 Number of episodes 6 Series 23.47 million Highest-rated episode: "Man of Science, Man Of Faith" (season two) 8.56 million Lowest-rated episode: "Dead Is Dead" (season five) $10-14m Approximate cost of pilot 324 Oceanic Flight 815 Passengers 72 Initial survivors (71 humans and Vincent the dog) 50 Island deaths 7 Known survivors 16 Status unknown 4 8 15 16 23 42 The Magic Numbers 4 Years of John Locke's paralysis 15 Gate number of Ajira Airlines flight 16 Age of Jack's first solo surgery patient 23 Survivors from 815's midsection 42 Kate's number 108 Sum of Magic Numbers 108 Hatch countdown clock 815 Oceanic flight number 2342 Hurley's Sydney hotel room number 2342 The auction block number for the Black Rock diary 4 8 15 16 23 42 Desmond's computer code

24 IN NUMBERS

192 Number of episodes 8 Series 17 million Highest-rated episode: Day 5: 7.00am–8.00am 7.9 million Lowest-rated episode: Day 8: 7.00am–8.00am $3-$4m Cost of each episode $550,000 Amount Kiefer Sutherland earned per episode 10.5 Months filming in a season 1 Number of Jack Bauer bathroom breaks in eight seasons 13,627 Total deaths 260 Jack Bauer kills 67 Torture scenes in first five seasons 2 Black American Presidents 1 Female American President 13 Female villains 71 Writers 1,143 Actors