Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A131378
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A131378 Starting with 0, the sequence a(n) changes from 0 to 1 or back when the next number n is a prime. +0
3
0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1 (list; graph; listen)
OFFSET

0,1

EXAMPLE

n = 0, 1, 2, 3, 4, 5, etc..

a(n)= 0, 0, 1, 0, 0, 1, etc.

Starting with 0 the sequence changes when we move from 1 to 2 because 2 is prime, again from 2 to 3 because also 3 is prime, then from 4 to 5 being 5 prime and so on.

MAPLE

P:=proc(n) local i, k; k:=0; for i from 0 by 1 to n do if isprime(i) then if k=1 then k:=0; else k:=1; fi; fi; print(k); od; end: P(100);

CROSSREFS

Cf. A131377.

Sequence in context: A116178 A028999 A091244 this_sequence A014707 A106138 A059125

Adjacent sequences: A131375 A131376 A131377 this_sequence A131379 A131380 A131381

KEYWORD

easy,nonn

AUTHOR

Paolo P. Lava & Giorgio Balzarotti (ppl(AT)spl.at), Jul 04 2007

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 July 26 23:19 EDT 2008. Contains 142293 sequences.


AT&T Labs Research