Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A064722
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A064722 a(1) = 0; for n >= 2, a(n) = n - (largest prime <= n). +0
7
0, 0, 0, 1, 0, 1, 0, 1, 2, 3, 0, 1, 0, 1, 2, 3, 0, 1, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 0, 1, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 0, 1, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 0, 1, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 0, 1, 0, 1, 2, 3 (list; graph; listen)
OFFSET

1,9

LINKS

Harry J. Smith, Table of n, a(n) for n=1,...,1000

FORMULA

a(n) = 0 iff n is 1 or a prime.

Computable also as a "commutator": PrimePi[Prime[m]]-Prime[PrimePi[m]]= A000720[A000040(m)]-A000040[A000720(m)]. Labels position of composites between 2 consecutive primes. - Labos E. (labos(AT)ana.sot.hu), Oct 19 2001

a(n) = a(n-1)*0^A010051(n) + 1 - A010051(n), a(1) = 0. - Reinhard Zumkeller (reinhard.zumkeller(AT)gmail.com), Mar 23 2006

EXAMPLE

a(26) = 26 - 23 = 3, a(37) = 37 - 37 = 0.

PROGRAM

(PARI) { for (n = 1, 1000, if (n>1, a=n - precprime(n), a=0); write("b064722.txt", n, " ", a) ) } [From Harry J. Smith (hjsmithh(AT)sbcglobal.net), Sep 23 2009]

CROSSREFS

Equals n - A007917(n).

Cf. A007920

Sequence in context: A073644 A123343 A054439 this_sequence A123735 A155839 A135814

Adjacent sequences: A064719 A064720 A064721 this_sequence A064723 A064724 A064725

KEYWORD

nonn

AUTHOR

Reinhard Zumkeller (reinhard.zumkeller(AT)gmail.com), Oct 13 2001

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 December 15 00:47 EST 2009. Contains 170825 sequences.


AT&T Labs Research