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.

A078772 a(n) = phi(n-p) where p is largest prime < n, a(1) = a(2) = 1 by convention.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 1, 1, 2, 2, 4, 2, 1, 1, 1, 1, 2, 2, 4, 2, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 1, 1, 2, 2, 4, 2, 1, 1, 2, 2, 4, 2, 1, 1, 1, 1, 2, 2, 4, 2, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 4, 2, 1, 1, 2, 2, 1, 1, 2, 2, 4, 2, 1, 1, 2, 2, 4, 2, 6, 4, 1, 1, 2
Offset: 1

Views

Author

Jon Perry, Jan 09 2003

Keywords

Comments

This sequence is a block of concatenations of vectors of lengths of prime gaps with elements phi(i) for i = 1 to that prime gap. Those vectors are (1), (1, 1), (1, 1, 2, 2), (1, 1, 2, 2, 4, 2), ... - David A. Corneth, Oct 20 2017

Examples

			a(10) = phi(10-7) = phi(3) = 2.
		

Crossrefs

Programs

  • PARI
    for (n=1,100, print1(eulerphi(n-precprime(n-1))","))
    
  • PARI
    first(n) = {n = nextprime(n); my(res = vector(n), phimap = Map(), q = 2, v); res[1] = res[2] = 1; forprime(p=3, n, if(!mapisdefined(phimap, p - q), mapput(phimap, p - q, vector(p - q, i, eulerphi(i)))); v = mapget(phimap, p-q); for(i = q + 1, p, res[i] = v[i - q]); q = p); res} \\ David A. Corneth, Oct 20 2017

Formula

For n >= 3, a(n) = A000010(A049711(n)). - Antti Karttunen, Oct 20 2017

Extensions

Description clarified by Antti Karttunen, Oct 20 2017