A078772 a(n) = phi(n-p) where p is largest prime < n, a(1) = a(2) = 1 by convention.
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
Keywords
Examples
a(10) = phi(10-7) = phi(3) = 2.
Links
- Antti Karttunen, Table of n, a(n) for n = 1..16384
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
Extensions
Description clarified by Antti Karttunen, Oct 20 2017
Comments