login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A215030 a(n) = A215029(A000040(n)), where A000040(n) is the n-th prime. 3
2, 1, 0, 1, 0, 1, 0, 1, 0, 1, 2, 1, 2, 1, 2, 1, 0, 1, 2, 1, 0, 1, 0, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 0, 1, 2, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 2, 1, 2, 1, 0, 1, 2, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 2, 1, 2, 1, 0, 1, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
For primes whose value is 0, see A214912; for value 1 see A031215; and for value 2 see A215031.
LINKS
StackExchange, A prime number pattern, Jul 29 2012.
PROG
(PARI)
A215029(n) = if(n<=2, n, my(mp=precprime(n-1), d=n); while(mp>0, if(d>0, d -= mp, d += mp); mp = precprime(mp-1)); (d));
A215030(n) = A215029(prime(n)); \\ Antti Karttunen, Nov 28 2018
CROSSREFS
Sequence in context: A307194 A331218 A120086 * A175816 A227573 A085004
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Aug 05 2012
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 14:35 EDT 2024. Contains 371989 sequences. (Running on oeis4.)